Update app open/close animations.

- For app open, the icon text remains where it is and only the icon moves.
- Similarly for app close, the icon text remains where it is and fades in
  with the rest of the other icons text.

- With this change, the original view is always "VISIBLE"
  (if BubbleTextView/FolderIcon) but we hide certain elements.

Added video to bug.

Bug: 137200188
Bug: 139885365
Change-Id: I3d20c5f05bc7c0b9d052d8074ac3bfc21531c83d
This commit is contained in:
Jon Miranda committed 2019-09-04 13:03:18 -07:00
1 parent 3651a3dfbe
commit dff0de4730
8 files changed
+134 -51

No files matched your search

@@ -65,6 +65,7 @@ import com.android.launcher3.dragndrop.DragView;
import com.android.launcher3.icons.DotRenderer;
import com.android.launcher3.touch.ItemClickHandler;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.views.IconLabelDotView;
import com.android.launcher3.widget.PendingAddShortcutInfo;
import java.util.ArrayList;
@@ -73,7 +74,7 @@ import java.util.List;
/**
* An icon that can appear on in the workspace representing an {@link Folder}.
*/
public class FolderIcon extends FrameLayout implements FolderListener {
public class FolderIcon extends FrameLayout implements FolderListener, IconLabelDotView {
@Thunk Launcher mLauncher;
@Thunk Folder mFolder;
@@ -107,6 +108,7 @@ public class FolderIcon extends FrameLayout implements FolderListener {
private Alarm mOpenAlarm = new Alarm();
private boolean mForceHideDot;
@ViewDebug.ExportedProperty(category = "launcher", deepExport = true)
private FolderDotInfo mDotInfo = new FolderDotInfo();
private DotRenderer mDotRenderer;
@@ -405,6 +407,20 @@ public class FolderIcon extends FrameLayout implements FolderListener {
return mPreviewLayoutRule;
}
@Override
public void setForceHideDot(boolean forceHideDot) {
if (mForceHideDot == forceHideDot) {
return;
}
mForceHideDot = forceHideDot;
if (forceHideDot) {
invalidate();
} else if (hasDot()) {
animateDotScale(0, 1);
}
}
/**
* Sets mDotScale to 1 or 0, animating if wasDotted or isDotted is false
* (the dot is being added or removed).
@@ -464,7 +480,8 @@ public class FolderIcon extends FrameLayout implements FolderListener {
mBackground.setInvalidateDelegate(this);
}
public void setBackgroundVisible(boolean visible) {
@Override
public void setIconVisible(boolean visible) {
mBackgroundIsVisible = visible;
invalidate();
}
@@ -504,7 +521,7 @@ public class FolderIcon extends FrameLayout implements FolderListener {
}
public void drawDot(Canvas canvas) {
if ((mDotInfo != null && mDotInfo.hasDot()) || mDotScale > 0) {
if (!mForceHideDot && ((mDotInfo != null && mDotInfo.hasDot()) || mDotScale > 0)) {
Rect iconBounds = mDotParams.iconBounds;
BubbleTextView.getIconBounds(this, iconBounds,
mLauncher.getWallpaperDeviceProfile().iconSizePx);