mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Don't fade in text if icon is in hotseat
Bug: 63011217 Change-Id: Ie914fcdfd0bf36b0cf12cc54f4e93206aa1074bd
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user