Scale Launcher folders on hover.
Bug: 243191650 Test: PreviewBackgroundTest Flag: ENABLE_CURSOR_HOVER_STATES Change-Id: I8035501203af5c2d97b62cc79e576303e57f8b99
This commit is contained in:
1 parent
2474a8c1fb
commit
cc0d8919ee
3 files changed
+388
-34
No files matched your search
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.launcher3.folder;
|
||||
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES;
|
||||
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR;
|
||||
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.MAX_NUM_ITEMS_IN_PREVIEW;
|
||||
import static com.android.launcher3.folder.PreviewItemManager.INITIAL_ITEM_ANIMATION_DURATION;
|
||||
@@ -627,7 +628,7 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel
|
||||
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.scale = Math.max(0, mDotScale - mBackground.getAcceptScaleProgress());
|
||||
mDotParams.dotColor = mBackground.getDotColor();
|
||||
mDotRenderer.draw(canvas, mDotParams);
|
||||
}
|
||||
@@ -801,6 +802,14 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHoverChanged(boolean hovered) {
|
||||
super.onHoverChanged(hovered);
|
||||
if (ENABLE_CURSOR_HOVER_STATES.get()) {
|
||||
mBackground.setHovered(hovered);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface that provides callbacks to a parent ViewGroup that hosts this FolderIcon.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user