diff options
author | Tony <twickham@google.com> | 2017-06-27 22:38:33 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2017-06-28 13:47:18 -0700 |
commit | 7308cde2cac46dec0dfd09144feb4475ad6d4893 (patch) | |
tree | db581a28bb913f5b73b2cc901aca030305b810ae /src/com/android/launcher3 | |
parent | aa2272f81cc4a62f847db777efda7959cc2b9979 (diff) | |
download | android_packages_apps_Trebuchet-7308cde2cac46dec0dfd09144feb4475ad6d4893.tar.gz android_packages_apps_Trebuchet-7308cde2cac46dec0dfd09144feb4475ad6d4893.tar.bz2 android_packages_apps_Trebuchet-7308cde2cac46dec0dfd09144feb4475ad6d4893.zip |
Don't fade in text if icon is in hotseat
Bug: 63011217
Change-Id: Ie914fcdfd0bf36b0cf12cc54f4e93206aa1074bd
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 11 | ||||
-rw-r--r-- | src/com/android/launcher3/CellLayout.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/popup/PopupContainerWithArrow.java | 5 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 6f2c89779..aeb82b376 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -44,6 +44,7 @@ import com.android.launcher3.IconCache.IconLoadRequest; import com.android.launcher3.IconCache.ItemInfoUpdateReceiver; import com.android.launcher3.badge.BadgeInfo; import com.android.launcher3.badge.BadgeRenderer; +import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.folder.FolderIconPreviewVerifier; import com.android.launcher3.graphics.DrawableFactory; import com.android.launcher3.graphics.HolographicOutlineHelper; @@ -438,6 +439,13 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver { super.setTextColor(colors); } + public boolean shouldTextBeVisible() { + // Text should be visible everywhere but the hotseat. + Object tag = getParent() instanceof FolderIcon ? ((View) getParent()).getTag() : getTag(); + ItemInfo info = tag instanceof ItemInfo ? (ItemInfo) tag : null; + return info == null || info.container != LauncherSettings.Favorites.CONTAINER_HOTSEAT; + } + public void setTextVisibility(boolean visible) { if (visible) { super.setTextColor(mTextColor); @@ -459,7 +467,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver { * @param fadeIn Whether the text should fade in or fade out. */ public ObjectAnimator createTextAlphaAnimator(boolean fadeIn) { - return ObjectAnimator.ofInt(this, TEXT_ALPHA_PROPERTY, fadeIn ? Color.alpha(mTextColor) : 0); + int toAlpha = shouldTextBeVisible() && fadeIn ? Color.alpha(mTextColor) : 0; + return ObjectAnimator.ofInt(this, TEXT_ALPHA_PROPERTY, toAlpha); } @Override diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index d99a30ae7..42b64ea83 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -606,7 +606,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { // Hotseat icons - remove text if (child instanceof BubbleTextView) { BubbleTextView bubbleChild = (BubbleTextView) child; - bubbleChild.setTextVisibility(mContainerType != HOTSEAT); + bubbleChild.setTextVisibility(bubbleChild.shouldTextBeVisible()); } child.setScaleX(mChildScale); diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index 425a08d96..81076259d 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -53,7 +53,6 @@ import com.android.launcher3.ItemInfo; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAnimUtils; import com.android.launcher3.LauncherModel; -import com.android.launcher3.LauncherSettings; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.accessibility.LauncherAccessibilityDelegate; @@ -907,9 +906,7 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra } mIsOpen = false; mDeferContainerRemoval = false; - boolean isInHotseat = ((ItemInfo) mOriginalIcon.getTag()).container - == LauncherSettings.Favorites.CONTAINER_HOTSEAT; - mOriginalIcon.setTextVisibility(!isInHotseat); + mOriginalIcon.setTextVisibility(mOriginalIcon.shouldTextBeVisible()); mOriginalIcon.forceHideBadge(false); mLauncher.getDragController().removeDragListener(this); mLauncher.getDragLayer().removeView(this); |