summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BubbleTextView.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-05-14 00:07:08 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-05-14 12:28:07 -0700
commit7066003b2032a49ae5e59dab9b706259bdeb7e6e (patch)
tree3e3720740c905cf22dc1c96e6123c1bb7bec60e5 /src/com/android/launcher3/BubbleTextView.java
parent5a92b2356f1c5f79207c4e9bd47d7b0b5bcf6f78 (diff)
downloadandroid_packages_apps_Trebuchet-7066003b2032a49ae5e59dab9b706259bdeb7e6e.tar.gz
android_packages_apps_Trebuchet-7066003b2032a49ae5e59dab9b706259bdeb7e6e.tar.bz2
android_packages_apps_Trebuchet-7066003b2032a49ae5e59dab9b706259bdeb7e6e.zip
Various lint error fixes.
> Fixing some RTL errors by specifying both marginStart and marginLeft > Moving all layout direction checks to Utilities > Explicitely adding @TargetApi before every method Change-Id: Ibe9c52b93b5a6adeadb27ace2b312770fd732ea0
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index d32c91919..bbcd893f2 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -16,6 +16,7 @@
package com.android.launcher3;
+import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
@@ -25,6 +26,7 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
+import android.os.Build;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.util.TypedValue;
@@ -444,15 +446,20 @@ public class BubbleTextView extends TextView {
/**
* Sets the icon for this view based on the layout direction.
*/
+ @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
private Drawable setIcon(Drawable icon, int iconSize) {
mIcon = icon;
if (iconSize != -1) {
mIcon.setBounds(0, 0, iconSize, iconSize);
}
if (mLayoutHorizontal) {
- setCompoundDrawablesRelative(mIcon, null, null, null);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ setCompoundDrawablesRelative(mIcon, null, null, null);
+ } else {
+ setCompoundDrawables(mIcon, null, null, null);
+ }
} else {
- setCompoundDrawablesRelative(null, mIcon, null, null);
+ setCompoundDrawables(null, mIcon, null, null);
}
return icon;
}