Merge "Update setup wizard icons"
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 697 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 763 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 985 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1013 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1017 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 597 B |
After Width: | Height: | Size: 634 B |
After Width: | Height: | Size: 965 B |
After Width: | Height: | Size: 957 B |
After Width: | Height: | Size: 709 B |
After Width: | Height: | Size: 709 B |
After Width: | Height: | Size: 685 B |
After Width: | Height: | Size: 849 B |
After Width: | Height: | Size: 876 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
|
@ -22,23 +22,23 @@ import android.widget.TextView;
|
|||
import java.lang.reflect.Method;
|
||||
|
||||
public final class TextViewCompatUtils {
|
||||
// Note that TextView.setCompoundDrawablesRelative(Drawable,Drawable,Drawable,Drawable) has
|
||||
// been introduced in API level 17 (Build.VERSION_CODE.JELLY_BEAN_MR1).
|
||||
private static final Method METHOD_setCompoundDrawablesRelative = CompatUtils.getMethod(
|
||||
TextView.class, "setCompoundDrawablesRelative",
|
||||
// Note that TextView.setCompoundDrawablesRelativeWithIntrinsicBounds(Drawable,Drawable,
|
||||
// Drawable,Drawable) has been introduced in API level 17 (Build.VERSION_CODE.JELLY_BEAN_MR1).
|
||||
private static final Method METHOD_setCompoundDrawablesRelativeWithIntrinsicBounds =
|
||||
CompatUtils.getMethod(TextView.class, "setCompoundDrawablesRelativeWithIntrinsicBounds",
|
||||
Drawable.class, Drawable.class, Drawable.class, Drawable.class);
|
||||
|
||||
private TextViewCompatUtils() {
|
||||
// This utility class is not publicly instantiable.
|
||||
}
|
||||
|
||||
public static void setCompoundDrawablesRelative(final TextView textView, final Drawable start,
|
||||
final Drawable top, final Drawable end, final Drawable bottom) {
|
||||
if (METHOD_setCompoundDrawablesRelative == null) {
|
||||
textView.setCompoundDrawables(start, top, end, bottom);
|
||||
public static void setCompoundDrawablesRelativeWithIntrinsicBounds(final TextView textView,
|
||||
final Drawable start, final Drawable top, final Drawable end, final Drawable bottom) {
|
||||
if (METHOD_setCompoundDrawablesRelativeWithIntrinsicBounds == null) {
|
||||
textView.setCompoundDrawablesWithIntrinsicBounds(start, top, end, bottom);
|
||||
return;
|
||||
}
|
||||
CompatUtils.invoke(textView, null, METHOD_setCompoundDrawablesRelative,
|
||||
CompatUtils.invoke(textView, null, METHOD_setCompoundDrawablesRelativeWithIntrinsicBounds,
|
||||
start, top, end, bottom);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -313,10 +313,8 @@ public final class SetupActivity extends Activity {
|
|||
final int paddingEnd = ViewCompatUtils.getPaddingEnd(mActionLabel);
|
||||
ViewCompatUtils.setPaddingRelative(mActionLabel, paddingEnd, 0, paddingEnd, 0);
|
||||
} else {
|
||||
final Drawable icon = res.getDrawable(actionIcon);
|
||||
icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight());
|
||||
TextViewCompatUtils.setCompoundDrawablesRelative(
|
||||
mActionLabel, icon, null, null, null);
|
||||
TextViewCompatUtils.setCompoundDrawablesRelativeWithIntrinsicBounds(
|
||||
mActionLabel, res.getDrawable(actionIcon), null, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|