summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BubbleTextView.java
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-07-20 15:21:04 -0700
committerTony Wickham <twickham@google.com>2016-07-20 17:28:34 -0700
commit377ed3f63ec517ed1ec1957dc1122f96f616fe65 (patch)
tree2af2069e1660868fcfcae7ee1835e13a252eb358 /src/com/android/launcher3/BubbleTextView.java
parent2eeae10e984993af563b4d207deac855ca7d8620 (diff)
downloadandroid_packages_apps_Trebuchet-377ed3f63ec517ed1ec1957dc1122f96f616fe65.tar.gz
android_packages_apps_Trebuchet-377ed3f63ec517ed1ec1957dc1122f96f616fe65.tar.bz2
android_packages_apps_Trebuchet-377ed3f63ec517ed1ec1957dc1122f96f616fe65.zip
Add drag handle to shortcuts.
Also use short text if long text is ellipsized. Bug: 30212144 Bug: 28980830 Change-Id: I213766bca0561d284d1da883ca37b0a42d886129
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 00ec4c2ff..c0c6673ee 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -526,19 +526,23 @@ public class BubbleTextView extends TextView
* Sets the icon for this view based on the layout direction.
*/
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
- public void setIcon(Drawable icon) {
+ private void setIcon(Drawable icon) {
mIcon = icon;
if (mIconSize != -1) {
mIcon.setBounds(0, 0, mIconSize, mIconSize);
}
+ applyCompoundDrawables(mIcon);
+ }
+
+ protected void applyCompoundDrawables(Drawable icon) {
if (mLayoutHorizontal) {
if (Utilities.ATLEAST_JB_MR1) {
- setCompoundDrawablesRelative(mIcon, null, null, null);
+ setCompoundDrawablesRelative(icon, null, null, null);
} else {
- setCompoundDrawables(mIcon, null, null, null);
+ setCompoundDrawables(icon, null, null, null);
}
} else {
- setCompoundDrawables(null, mIcon, null, null);
+ setCompoundDrawables(null, icon, null, null);
}
}