Fix app to folder icon animation.

- Needed to account for the preview bounds (similar to BubbleTextView icon
  bounds)
- Also needed to update the bitmap shift amount so that it is re-centered
- Moved ShiftedBitmapDrawable to its own class in graphics package

Bug: 123900446
Change-Id: Ifa9e3f688e55d017cf86a0285f5cdb1b014f01e6
This commit is contained in:
Jon Miranda committed 2019-03-05 12:23:28 -08:00
1 parent 34691cffe3
commit 69b35e0195
6 files changed
+104 -40

No files matched your search

@@ -33,6 +33,7 @@ import android.graphics.Path;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.RadialGradient;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.Shader;
import android.util.Property;
@@ -154,6 +155,14 @@ public class PreviewBackground {
invalidate();
}
void getBounds(Rect outBounds) {
int top = basePreviewOffsetY;
int left = basePreviewOffsetX;
int right = left + previewSize;
int bottom = top + previewSize;
outBounds.set(left, top, right, bottom);
}
int getRadius() {
return previewSize / 2;
}