Example usage for android.widget ImageView setActivated

List of usage examples for android.widget ImageView setActivated

Introduction

In this page you can find the example usage for android.widget ImageView setActivated.

Prototype

public void setActivated(boolean activated) 

Source Link

Document

Changes the activated state of this view.

Usage

From source file:io.vit.vitio.Settings.ComingSoonActivity.java

private void toggleCircle(ImageView imon, ImageView imoff[]) {
    imon.setActivated(true);
    ObjectAnimator animatorX = ObjectAnimator.ofFloat(imon, "scaleX", 0.5f, 1.0f);
    ObjectAnimator animatorY = ObjectAnimator.ofFloat(imon, "scaleY", 0.5f, 1.0f);
    animatorX.setDuration(300);//www  .j  a  va  2  s  .  c o  m
    animatorY.setDuration(300);
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.playTogether(animatorX, animatorY);
    animatorSet.start();
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
            (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10,
                    getResources().getDisplayMetrics()),
            (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10,
                    getResources().getDisplayMetrics()));
    params.setMargins(0, 0, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 13,
            getResources().getDisplayMetrics()), 0);
    imon.setLayoutParams(params);
    for (int i = 0; i < imoff.length; i++) {
        imoff[i].setActivated(false);
        params = new LinearLayout.LayoutParams(
                (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 6,
                        getResources().getDisplayMetrics()),
                (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 6,
                        getResources().getDisplayMetrics()));
        params.setMargins(0, 0, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 13,
                getResources().getDisplayMetrics()), 0);
        imoff[i].setLayoutParams(params);
    }
}

From source file:io.vit.vitio.StartScreens.FragmentHolder.java

private void toggleCircle(ImageView imon, ImageView imoff[]) {
    imon.setActivated(true);
    ObjectAnimator animatorX = ObjectAnimator.ofFloat(imon, "scaleX", 0.5f, 1.0f);
    ObjectAnimator animatorY = ObjectAnimator.ofFloat(imon, "scaleY", 0.5f, 1.0f);
    animatorX.setDuration(300);// w  w  w . ja  v a 2s.  c o  m
    animatorY.setDuration(300);
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.playTogether(animatorX, animatorY);
    animatorSet.start();
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
            (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10,
                    getResources().getDisplayMetrics()),
            (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10,
                    getResources().getDisplayMetrics()));
    if (imon != im7)
        params.setMargins(0, 0, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 13,
                getResources().getDisplayMetrics()), 0);
    imon.setLayoutParams(params);
    for (int i = 0; i < imoff.length; i++) {
        imoff[i].setActivated(false);
        params = new LinearLayout.LayoutParams(
                (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 6,
                        getResources().getDisplayMetrics()),
                (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 6,
                        getResources().getDisplayMetrics()));
        if (imoff[i] != im7)
            params.setMargins(0, 0, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 13,
                    getResources().getDisplayMetrics()), 0);
        imoff[i].setLayoutParams(params);
    }
}

From source file:uk.org.downiesoft.slideshow.ThumbnailAdapter.java

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ImageView imageView;
    if (convertView == null) {
        imageView = (ImageView) mLayoutInflater.inflate(R.layout.gridview_item, parent, false);
        imageView.setLayoutParams(mLayoutParams);
    } else {//  www.ja v a2  s  .  c om
        imageView = (ImageView) convertView;
        // hack to reset selection state of re-used views after action mode ended
        AbsListView list = (AbsListView) parent;
        if (list != null && list.getChoiceMode() == ListView.CHOICE_MODE_NONE) {
            imageView.setActivated(false);
        }

    }
    if (mThumbBitmaps.size() > position && mThumbBitmaps.get(position) != null) {
        Bitmap bmp = mThumbBitmaps.get(position);
        imageView.setImageBitmap(bmp);
        if (bmp.getWidth() >= mThumbSize || bmp.getHeight() >= mThumbSize) {
            imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        } else {
            imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
        }
    } else {
        imageView.setImageResource(R.drawable.ic_launcher);
    }
    return imageView;
}