summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BubbleTextView.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-01-08 16:59:04 -0800
committerSunny Goyal <sunnygoyal@google.com>2015-01-16 17:40:41 -0800
commit71b5c0b988a64b3a0613ded5403749bc537ee8a5 (patch)
treedec5e13b1ef53a7005a9776387fc0a4c1895c39c /src/com/android/launcher3/BubbleTextView.java
parent08f7261d11a53ae4b330ad4fa897b8519de3d750 (diff)
downloadandroid_packages_apps_Trebuchet-71b5c0b988a64b3a0613ded5403749bc537ee8a5.tar.gz
android_packages_apps_Trebuchet-71b5c0b988a64b3a0613ded5403749bc537ee8a5.tar.bz2
android_packages_apps_Trebuchet-71b5c0b988a64b3a0613ded5403749bc537ee8a5.zip
Adding accessibility controls
> Adding 'Remove' option to workspace items > Adding 'Add to workspace' to all apps and widget list items, which adds the item to the first available space, giving preference to the current workspace screen > Adding 'App info' and 'Uninstall' options to appropriate items Bug: 18482913 Change-Id: Ifab7423af2d9ba502b5a2771b37bb5436b3df937
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 07f3045a5..f9255e6bd 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -49,7 +49,15 @@ public class BubbleTextView extends TextView {
private static final int SHADOW_SMALL_COLOUR = 0xCC000000;
static final float PADDING_V = 3.0f;
- private HolographicOutlineHelper mOutlineHelper;
+
+ private final Drawable mBackground;
+ private final CheckLongPressHelper mLongPressHelper;
+ private final HolographicOutlineHelper mOutlineHelper;
+
+ // TODO: Remove custom background handling code, as no instance of BubbleTextView use any
+ // background.
+ private boolean mBackgroundSizeChanged;
+
private Bitmap mPressedBackground;
private float mSlop;
@@ -58,14 +66,8 @@ public class BubbleTextView extends TextView {
private final boolean mCustomShadowsEnabled;
private boolean mIsTextVisible;
- // TODO: Remove custom background handling code, as no instance of BubbleTextView use any
- // background.
- private boolean mBackgroundSizeChanged;
- private final Drawable mBackground;
-
private boolean mStayPressed;
private boolean mIgnorePressedStateChange;
- private CheckLongPressHelper mLongPressHelper;
public BubbleTextView(Context context) {
this(context, null, 0);
@@ -90,7 +92,14 @@ public class BubbleTextView extends TextView {
} else {
mBackground = null;
}
- init();
+ mLongPressHelper = new CheckLongPressHelper(this);
+
+ mOutlineHelper = HolographicOutlineHelper.obtain(getContext());
+ if (mCustomShadowsEnabled) {
+ setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR);
+ }
+
+ setAccessibilityDelegate(LauncherAppState.getInstance().getAccessibilityDelegate());
}
public void onFinishInflate() {
@@ -102,15 +111,6 @@ public class BubbleTextView extends TextView {
setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.iconTextSizePx);
}
- private void init() {
- mLongPressHelper = new CheckLongPressHelper(this);
-
- mOutlineHelper = HolographicOutlineHelper.obtain(getContext());
- if (mCustomShadowsEnabled) {
- setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR);
- }
- }
-
public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache,
boolean setDefaultPadding) {
applyFromShortcutInfo(info, iconCache, setDefaultPadding, false);
@@ -328,7 +328,7 @@ public class BubbleTextView extends TextView {
Drawable top = getCompoundDrawables()[1];
if (top instanceof PreloadIconDrawable) {
- ((PreloadIconDrawable) top).applyTheme(getPreloaderTheme());
+ ((PreloadIconDrawable) top).applyPreloaderTheme(getPreloaderTheme());
}
mSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
}