Java Code Examples for android.widget.ImageView#setImageAlpha()

The following examples show how to use android.widget.ImageView#setImageAlpha() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
@Override
protected void onResume() {
    super.onResume();
    if (mVideoInfo.state == PlayerState.FINISHED) finish();
    if (mMediaRouteController == null) return;

    // Lifetime of the media element is bound to that of the {@link MediaStateListener}
    // of the {@link MediaRouteController}.
    RecordCastAction.recordFullscreenControlsShown(
            mMediaRouteController.getMediaStateListener() != null);

    mMediaRouteController.prepareMediaRoute();

    ImageView iv = (ImageView) findViewById(R.id.cast_background_image);
    if (iv == null) return;
    Bitmap posterBitmap = mMediaRouteController.getPoster();
    if (posterBitmap != null) iv.setImageBitmap(posterBitmap);
    iv.setImageAlpha(POSTER_IMAGE_ALPHA);
}
 
Example 2
@Override
protected void onResume() {
    super.onResume();
    if (mVideoInfo.state == PlayerState.FINISHED) finish();
    if (mMediaRouteController == null) return;

    // Lifetime of the media element is bound to that of the {@link MediaStateListener}
    // of the {@link MediaRouteController}.
    RecordCastAction.recordFullscreenControlsShown(
            mMediaRouteController.getMediaStateListener() != null);

    mMediaRouteController.prepareMediaRoute();

    ImageView iv = (ImageView) findViewById(R.id.cast_background_image);
    if (iv == null) return;
    Bitmap posterBitmap = mMediaRouteController.getPoster();
    if (posterBitmap != null) iv.setImageBitmap(posterBitmap);
    iv.setImageAlpha(POSTER_IMAGE_ALPHA);
}
 
Example 3
@Override
protected void onResume() {
    super.onResume();
    if (mVideoInfo.state == PlayerState.FINISHED) finish();
    if (mMediaRouteController == null) return;

    // Lifetime of the media element is bound to that of the {@link MediaStateListener}
    // of the {@link MediaRouteController}.
    RecordCastAction.recordFullscreenControlsShown(
            mMediaRouteController.getMediaStateListener() != null);

    mMediaRouteController.prepareMediaRoute();

    ImageView iv = (ImageView) findViewById(R.id.cast_background_image);
    if (iv == null) return;
    Bitmap posterBitmap = mMediaRouteController.getPoster();
    if (posterBitmap != null) iv.setImageBitmap(posterBitmap);
    iv.setImageAlpha(POSTER_IMAGE_ALPHA);
}
 
Example 4
Source Project: Dali   File: LegacySDKUtil.java    License: Apache License 2.0 5 votes vote down vote up
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public static void setImageAlpha(ImageView imageView, int alpha) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        imageView.setImageAlpha(alpha);
    } else {
        imageView.setAlpha(alpha);
    }
}
 
Example 5
Source Project: scene   File: ImageViewAnimationBuilder.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setValue(ImageView object, int value) {
    object.setImageAlpha(value);
}
 
Example 6
Source Project: materialup   File: ViewUtils.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setValue(ImageView imageView, int value) {
    imageView.setImageAlpha(value);
}
 
Example 7
Source Project: android-proguards   File: ViewUtils.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void set(ImageView imageView, int alpha) {
    imageView.setImageAlpha(alpha);
}
 
Example 8
Source Project: commonadapter   File: ViewHolderImpl.java    License: MIT License 4 votes vote down vote up
@TargetApi(16)
public void setImageAlpha(int viewId, int alpha) {
    ImageView target = findViewById(viewId);
    target.setImageAlpha(alpha);
}
 
Example 9
static void renderPreview(Context context, Attachment attachment, ImageView imageView) {
    imageView.setBackgroundColor(StyledAttributes.getColor(context, R.attr.color_background_tertiary));
    imageView.setImageAlpha(Math.round(StyledAttributes.getFloat(context, R.attr.icon_alpha) * 255));
    imageView.setImageDrawable(StyledAttributes.getDrawable(context, getImageAttr(attachment)));
}
 
Example 10
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public static void setImageAlpha(ImageView imageView, int alpha) {
    imageView.setImageAlpha(alpha);
}
 
Example 11
static void renderPreview(Context context, Attachment attachment, ImageView imageView) {
    imageView.setBackgroundColor(StyledAttributes.getColor(context, R.attr.color_background_tertiary));
    imageView.setImageAlpha(Math.round(StyledAttributes.getFloat(context, R.attr.icon_alpha) * 255));
    imageView.setImageDrawable(StyledAttributes.getDrawable(context, getImageAttr(attachment)));
}