From e4a252a16b106ac74ae443d7567501cbd4f43813 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Sun, 18 Jun 2017 17:43:16 -0700 Subject: Fade folder icon text when opening/closing. Bug: 62065293 Bug: 35064148 Change-Id: I9c54c6d222216fa079c76a069f0ec8dd966d5bfb --- src/com/android/launcher3/folder/Folder.java | 4 +++- src/com/android/launcher3/folder/FolderAnimationManager.java | 1 + src/com/android/launcher3/folder/FolderIcon.java | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/com/android') diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 9e3055036..5dbb8421a 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -60,7 +60,6 @@ import com.android.launcher3.LauncherSettings; import com.android.launcher3.LogDecelerateInterpolator; import com.android.launcher3.OnAlarmListener; import com.android.launcher3.PagedView; -import com.android.launcher3.PendingAddItemInfo; import com.android.launcher3.R; import com.android.launcher3.ShortcutInfo; import com.android.launcher3.UninstallDropTarget.DropTargetSource; @@ -634,7 +633,9 @@ public class Folder extends AbstractFloatingView implements DragSource, View.OnC @Override public void onAnimationStart(Animator animation) { if (FeatureFlags.LAUNCHER3_NEW_FOLDER_ANIMATION) { + mFolderIcon.setBackgroundVisible(false); mFolderIcon.drawLeaveBehindIfExists(); + } else { mFolderIcon.setVisibility(INVISIBLE); } @@ -787,6 +788,7 @@ public class Folder extends AbstractFloatingView implements DragSource, View.OnC mDragController.removeDropTarget(this); clearFocus(); if (mFolderIcon != null) { + mFolderIcon.setBackgroundVisible(true); mFolderIcon.setVisibility(View.VISIBLE); if (wasAnimated) { mFolderIcon.mBackground.animateBackgroundStroke(); diff --git a/src/com/android/launcher3/folder/FolderAnimationManager.java b/src/com/android/launcher3/folder/FolderAnimationManager.java index bee0bd418..bb2d1a2f5 100644 --- a/src/com/android/launcher3/folder/FolderAnimationManager.java +++ b/src/com/android/launcher3/folder/FolderAnimationManager.java @@ -208,6 +208,7 @@ public class FolderAnimationManager { play(a, getAnimator(mFolder, SCALE_PROPERTY, initialScale, finalScale)); play(a, getAnimator(items, ITEMS_TEXT_COLOR_PROPERTY, Color.TRANSPARENT, finalTextColor)); play(a, getAnimator(mFolderBackground, "color", initialColor, finalColor)); + play(a, mFolderIcon.mFolderName.createTextAlphaAnimator(!mIsOpening)); play(a, new RoundedRectRevealOutlineProvider(initialRadius, finalRadius, startRect, endRect).createRevealAnimator(mFolder, !mIsOpening)); diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index 82a0733ce..aaa19afa5 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -120,6 +120,7 @@ public class FolderIcon extends FrameLayout implements FolderListener { private int mPrevTopPadding = -1; PreviewBackground mBackground = new PreviewBackground(); + private boolean mBackgroundIsVisible = true; private PreviewLayoutRule mPreviewLayoutRule; @@ -883,10 +884,17 @@ public class FolderIcon extends FrameLayout implements FolderListener { mBackground.setInvalidateDelegate(this); } + public void setBackgroundVisible(boolean visible) { + mBackgroundIsVisible = visible; + invalidate(); + } + @Override protected void dispatchDraw(Canvas canvas) { super.dispatchDraw(canvas); + if (!mBackgroundIsVisible) return; + if (mReferenceDrawable != null) { computePreviewDrawingParams(mReferenceDrawable); } -- cgit v1.2.3