diff options
author | Tony Wickham <twickham@google.com> | 2019-05-03 11:27:32 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-05-06 10:42:55 -0700 |
commit | e1cb93f95744e5d2be5c48fc5bd3025f1453006b (patch) | |
tree | 184bdee68538b2167d2faedd66d8ef42b1779226 /src/com/android/launcher3/folder/FolderIcon.java | |
parent | 227b6e021cef474de05f7dfbd4e641bf860ac011 (diff) | |
download | android_packages_apps_Trebuchet-e1cb93f95744e5d2be5c48fc5bd3025f1453006b.tar.gz android_packages_apps_Trebuchet-e1cb93f95744e5d2be5c48fc5bd3025f1453006b.tar.bz2 android_packages_apps_Trebuchet-e1cb93f95744e5d2be5c48fc5bd3025f1453006b.zip |
Always place notification dots directly on adaptive icon path
- Calculate point on icon path nearest to top right corner, and
use that as center for the dot
- Cleanup code related to dot offset
Test:
Set each style (different icon shape) and verify dot is in correct
placement for each of:
- Folders
- Icons in folders
- Icons in all apps
- Icons on workspace
Bug: 124414511
Change-Id: I036ed3677e8af222f00d4fad4a36a7e4d9b49ad9
Diffstat (limited to 'src/com/android/launcher3/folder/FolderIcon.java')
-rw-r--r-- | src/com/android/launcher3/folder/FolderIcon.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index 6fa9ba9ae..8d9c52065 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -36,6 +36,8 @@ import android.view.ViewDebug; import android.view.ViewGroup; import android.widget.FrameLayout; +import androidx.annotation.NonNull; + import com.android.launcher3.Alarm; import com.android.launcher3.AppInfo; import com.android.launcher3.BubbleTextView; @@ -50,11 +52,11 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherSettings; import com.android.launcher3.OnAlarmListener; import com.android.launcher3.R; -import com.android.launcher3.WorkspaceItemInfo; import com.android.launcher3.SimpleOnStylusPressListener; import com.android.launcher3.StylusEventHelper; import com.android.launcher3.Utilities; import com.android.launcher3.Workspace; +import com.android.launcher3.WorkspaceItemInfo; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.dot.FolderDotInfo; import com.android.launcher3.dragndrop.BaseItemDragListener; @@ -68,8 +70,6 @@ import com.android.launcher3.widget.PendingAddShortcutInfo; import java.util.ArrayList; import java.util.List; -import androidx.annotation.NonNull; - /** * An icon that can appear on in the workspace representing an {@link Folder}. */ @@ -510,10 +510,11 @@ public class FolderIcon extends FrameLayout implements FolderListener { Rect iconBounds = mDotParams.iconBounds; BubbleTextView.getIconBounds(this, iconBounds, mLauncher.getWallpaperDeviceProfile().iconSizePx); + float iconScale = (float) mBackground.previewSize / iconBounds.width(); + Utilities.scaleRectAboutCenter(iconBounds, iconScale); // If we are animating to the accepting state, animate the dot out. mDotParams.scale = Math.max(0, mDotScale - mBackground.getScaleProgress()); - mDotParams.spaceForOffset.set(getWidth() - iconBounds.right, iconBounds.top); mDotParams.color = mBackground.getDotColor(); mDotRenderer.draw(canvas, mDotParams); } |