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

The following examples show how to use android.widget.ImageView#setImageAlpha() . 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 check out the related API usage on the sidebar.
Example 1
Source File: ExpandedControllerActivity.java    From delion with Apache License 2.0 6 votes vote down vote up
@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
Source File: ExpandedControllerActivity.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@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
Source File: ExpandedControllerActivity.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@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 File: LegacySDKUtil.java    From Dali with 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 File: ImageViewAnimationBuilder.java    From scene with Apache License 2.0 4 votes vote down vote up
@Override
public void setValue(ImageView object, int value) {
    object.setImageAlpha(value);
}
 
Example 6
Source File: ViewUtils.java    From materialup with Apache License 2.0 4 votes vote down vote up
@Override
public void setValue(ImageView imageView, int value) {
    imageView.setImageAlpha(value);
}
 
Example 7
Source File: ViewUtils.java    From android-proguards with Apache License 2.0 4 votes vote down vote up
@Override
public void set(ImageView imageView, int alpha) {
    imageView.setImageAlpha(alpha);
}
 
Example 8
Source File: ViewHolderImpl.java    From commonadapter with 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
Source File: MediaAdapter.java    From Pix-Art-Messenger with GNU General Public License v3.0 4 votes vote down vote up
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
Source File: CompatibilityImpl.java    From Overchan-Android with GNU General Public License v3.0 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public static void setImageAlpha(ImageView imageView, int alpha) {
    imageView.setImageAlpha(alpha);
}
 
Example 11
Source File: MediaAdapter.java    From Conversations with GNU General Public License v3.0 4 votes vote down vote up
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)));
}