Java Code Examples for android.graphics.drawable.Drawable#getAlpha()
The following examples show how to use
android.graphics.drawable.Drawable#getAlpha() .
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: StatusbarBattery.java From GravityBox with Apache License 2.0 | 6 votes |
public StatusbarBattery(View batteryView) { mBattery = batteryView; createHooks(); try { Object drawable = getDrawable(); final int[] colors = (int[]) XposedHelpers.getObjectField(drawable, "mColors"); mDefaultColor = colors[colors.length - 1]; if (Utils.isLineageOs()) { Drawable frameDrawable = (Drawable) XposedHelpers.getObjectField(drawable, "mFrameDrawable"); // mDefaultFrameColor = frameDrawable.setTint(); mFrameAlpha = frameDrawable.getAlpha(); } else { final Paint framePaint = (Paint) XposedHelpers.getObjectField(drawable, "mFramePaint"); mDefaultFrameColor = framePaint.getColor(); mFrameAlpha = framePaint.getAlpha(); } mDefaultChargeColor = XposedHelpers.getIntField(drawable, "mChargeColor"); } catch (Throwable t) { log("Error backing up original colors: " + t.getMessage()); } if (SysUiManagers.IconManager != null) { SysUiManagers.IconManager.registerListener(this); } }
Example 2
Source File: DrawableAlphaProperty.java From material-components-android with Apache License 2.0 | 5 votes |
@Nullable @Override public Integer get(@NonNull Drawable object) { if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) { return object.getAlpha(); } if (alphaCache.containsKey(object)) { return alphaCache.get(object); } return 0xFF; }
Example 3
Source File: LayerDrawable.java From Carbon with Apache License 2.0 | 5 votes |
@Override @TargetApi(Build.VERSION_CODES.KITKAT) public int getAlpha() { final Drawable dr = getFirstNonNullDrawable(); if (dr != null) { return dr.getAlpha(); } else { return super.getAlpha(); } }
Example 4
Source File: DrawableAnimationBuilder.java From scene with Apache License 2.0 | 4 votes |
@Override public Integer get(Drawable object) { return object.getAlpha(); }
Example 5
Source File: ViewUtils.java From android-proguards with Apache License 2.0 | 4 votes |
@Override public int get(Drawable drawable) { return drawable.getAlpha(); }