You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
AdaptiveIconDrawable: add hacks to make it work
We don't currently have "shaders" implemented properly, so just draw the layers and don't mask anything.
This commit is contained in:
@@ -348,12 +348,13 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int insetWidth = (int)(bounds.width() / (DEFAULT_VIEW_PORT_SCALE * 2));
|
/*int insetWidth = (int)(bounds.width() / (DEFAULT_VIEW_PORT_SCALE * 2));
|
||||||
int insetHeight = (int)(bounds.height() / (DEFAULT_VIEW_PORT_SCALE * 2));
|
int insetHeight = (int)(bounds.height() / (DEFAULT_VIEW_PORT_SCALE * 2));
|
||||||
final Rect outRect = mTmpOutRect;
|
final Rect outRect = mTmpOutRect;
|
||||||
outRect.set(cX - insetWidth, cY - insetHeight, cX + insetWidth, cY + insetHeight);
|
outRect.set(cX - insetWidth, cY - insetHeight, cX + insetWidth, cY + insetHeight);
|
||||||
|
|
||||||
d.setBounds(outRect);
|
d.setBounds(outRect);*/
|
||||||
|
d.setBounds(bounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +377,7 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Canvas canvas) {
|
public void draw(Canvas canvas) {
|
||||||
if (mLayersBitmap == null) {
|
/* if (mLayersBitmap == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mLayersShader == null) {
|
if (mLayersShader == null) {
|
||||||
@@ -397,6 +398,16 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback
|
|||||||
canvas.drawPath(mMaskScaleOnly, mPaint);
|
canvas.drawPath(mMaskScaleOnly, mPaint);
|
||||||
canvas.translate(-bounds.left, -bounds.top);
|
canvas.translate(-bounds.left, -bounds.top);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
Rect bounds = getBounds();
|
||||||
|
canvas.translate(bounds.left, bounds.top);
|
||||||
|
if (mLayerState.mChildren[BACKGROUND_ID].mDrawable != null) {
|
||||||
|
mLayerState.mChildren[BACKGROUND_ID].mDrawable.draw(canvas);
|
||||||
|
}
|
||||||
|
if (mLayerState.mChildren[FOREGROUND_ID].mDrawable != null) {
|
||||||
|
mLayerState.mChildren[FOREGROUND_ID].mDrawable.draw(canvas);
|
||||||
|
}
|
||||||
|
canvas.translate(-bounds.left, -bounds.top);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user