summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BubbleTextView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 7adb6a442..5e73880a8 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -16,12 +16,15 @@
package com.android.launcher3;
+import static com.android.launcher3.InvariantDeviceProfile.KEY_SHOW_DESKTOP_LABELS;
+import static com.android.launcher3.InvariantDeviceProfile.KEY_SHOW_DRAWER_LABELS;
import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
+import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Canvas;
@@ -72,7 +75,6 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
private static final int[] STATE_PRESSED = new int[] {android.R.attr.state_pressed};
-
private static final Property<BubbleTextView, Float> DOT_SCALE_PROPERTY
= new Property<BubbleTextView, Float>(Float.TYPE, "dotScale") {
@Override
@@ -134,10 +136,11 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
private boolean mIgnorePressedStateChange;
@ViewDebug.ExportedProperty(category = "launcher")
private boolean mDisableRelayout = false;
-
@ViewDebug.ExportedProperty(category = "launcher")
private final boolean mIgnorePaddingTouch;
+ private boolean mShouldShowLabel;
+
private IconLoadRequest mIconLoadRequest;
public BubbleTextView(Context context) {
@@ -157,6 +160,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
R.styleable.BubbleTextView, defStyle, 0);
mLayoutHorizontal = a.getBoolean(R.styleable.BubbleTextView_layoutHorizontal, false);
+ SharedPreferences prefs = Utilities.getPrefs(context.getApplicationContext());
+
mDisplay = a.getInteger(R.styleable.BubbleTextView_iconDisplay, DISPLAY_WORKSPACE);
final int defaultIconSize;
if (mDisplay == DISPLAY_WORKSPACE) {
@@ -164,12 +169,14 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.iconTextSizePx);
setCompoundDrawablePadding(grid.iconDrawablePaddingPx);
defaultIconSize = grid.iconSizePx;
+ mShouldShowLabel = prefs.getBoolean(KEY_SHOW_DESKTOP_LABELS, true);
mIgnorePaddingTouch = true;
} else if (mDisplay == DISPLAY_ALL_APPS) {
DeviceProfile grid = mActivity.getDeviceProfile();
setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.allAppsIconTextSizePx);
setCompoundDrawablePadding(grid.allAppsIconDrawablePaddingPx);
defaultIconSize = grid.allAppsIconSizePx;
+ mShouldShowLabel = prefs.getBoolean(KEY_SHOW_DRAWER_LABELS, true);
mIgnorePaddingTouch = true;
} else if (mDisplay == DISPLAY_FOLDER) {
DeviceProfile grid = mActivity.getDeviceProfile();
@@ -177,10 +184,12 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
setCompoundDrawablePadding(grid.folderChildDrawablePaddingPx);
defaultIconSize = grid.folderChildIconSizePx;
mIgnorePaddingTouch = true;
+ mShouldShowLabel = prefs.getBoolean(KEY_SHOW_DESKTOP_LABELS, true);
} else {
// widget_selection or shortcut_popup
defaultIconSize = mActivity.getDeviceProfile().iconSizePx;
mIgnorePaddingTouch = false;
+ mShouldShowLabel = prefs.getBoolean(KEY_SHOW_DESKTOP_LABELS, true);
}
mCenterVertically = a.getBoolean(R.styleable.BubbleTextView_centerVertically, false);
@@ -292,7 +301,9 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
mDotParams.color = IconPalette.getMutedColor(info.iconColor, 0.54f);
setIcon(iconDrawable);
- setText(info.title);
+ if (mShouldShowLabel) {
+ setText(info.title);
+ }
if (info.contentDescription != null) {
setContentDescription(info.isDisabled()
? getContext().getString(R.string.disabled_app_label, info.contentDescription)