Update icon badges to match spec

- Size defined as percentage of app icon size
- Width changes when there are 2 or 3 digits (round rect)
- Offset slightly away from the app icon
  - Had to move drawing to BubbleTextView instead of
    FastBitmapDrawable
- Hide badge when dragging and while popup is open
- Tweaks for some color/text parameters

Bug: 35744066
Change-Id: Ibb15ca634abaa0729aea637c904c4c6889a58c7c
This commit is contained in:
Tony Wickham
2017-02-24 08:59:36 -08:00
parent 343a77e609
commit 1237df0a7c
10 changed files with 177 additions and 102 deletions

View File

@@ -2247,16 +2247,12 @@ public class Workspace extends PagedView
Point dragVisualizeOffset = null;
Rect dragRect = null;
if (child instanceof BubbleTextView) {
int iconSize = grid.iconSizePx;
int top = child.getPaddingTop();
int left = (b.getWidth() - iconSize) / 2;
int right = left + iconSize;
int bottom = top + iconSize;
dragLayerY += top;
// Note: The drag region is used to calculate drag layer offsets, but the
dragRect = new Rect();
((BubbleTextView) child).getIconBounds(dragRect);
dragLayerY += dragRect.top;
// Note: The dragRect is used to calculate drag layer offsets, but the
// dragVisualizeOffset in addition to the dragRect (the size) to position the outline.
dragVisualizeOffset = new Point(- halfPadding, halfPadding);
dragRect = new Rect(left, top, right, bottom);
} else if (child instanceof FolderIcon) {
int previewSize = grid.folderIconSizePx;
dragVisualizeOffset = new Point(- halfPadding, halfPadding - child.getPaddingTop());