Merge "Merge "Fix safezone and getAlpha b/38361276 Test: frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java" into oc-dev am: cca181bfbb" into oc-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
fa5f8fa8a8
@@ -84,7 +84,7 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback
|
|||||||
/**
|
/**
|
||||||
* Launcher icons design guideline
|
* Launcher icons design guideline
|
||||||
*/
|
*/
|
||||||
private static final float SAFEZONE_SCALE = 72f/66f;
|
private static final float SAFEZONE_SCALE = 66f/72f;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All four sides of the layers are padded with extra inset so as to provide
|
* All four sides of the layers are padded with extra inset so as to provide
|
||||||
@@ -676,12 +676,7 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAlpha() {
|
public int getAlpha() {
|
||||||
final Drawable dr = getFirstNonNullDrawable();
|
return PixelFormat.TRANSLUCENT;
|
||||||
if (dr != null) {
|
|
||||||
return dr.getAlpha();
|
|
||||||
} else {
|
|
||||||
return super.getAlpha();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -719,17 +714,6 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Drawable getFirstNonNullDrawable() {
|
|
||||||
final ChildDrawable[] array = mLayerState.mChildren;
|
|
||||||
for (int i = 0; i < mLayerState.N_CHILDREN; i++) {
|
|
||||||
final Drawable dr = array[i].mDrawable;
|
|
||||||
if (dr != null) {
|
|
||||||
return dr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpacity(int opacity) {
|
public void setOpacity(int opacity) {
|
||||||
mLayerState.mOpacityOverride = opacity;
|
mLayerState.mOpacityOverride = opacity;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user