diff --git a/java/res/drawable-hdpi/unbundled_check_01.png b/java/res/drawable-hdpi/unbundled_check_01.png index 8234399d5..42cce2f0f 100644 Binary files a/java/res/drawable-hdpi/unbundled_check_01.png and b/java/res/drawable-hdpi/unbundled_check_01.png differ diff --git a/java/res/drawable-hdpi/unbundled_check_02.png b/java/res/drawable-hdpi/unbundled_check_02.png index 6ccd07b55..dcd120eac 100644 Binary files a/java/res/drawable-hdpi/unbundled_check_02.png and b/java/res/drawable-hdpi/unbundled_check_02.png differ diff --git a/java/res/drawable-hdpi/unbundled_earth_01.png b/java/res/drawable-hdpi/unbundled_earth_01.png index 3d22f3bfc..4a0f087ed 100644 Binary files a/java/res/drawable-hdpi/unbundled_earth_01.png and b/java/res/drawable-hdpi/unbundled_earth_01.png differ diff --git a/java/res/drawable-hdpi/unbundled_earth_02.png b/java/res/drawable-hdpi/unbundled_earth_02.png index 1998aea56..f4bd421f2 100644 Binary files a/java/res/drawable-hdpi/unbundled_earth_02.png and b/java/res/drawable-hdpi/unbundled_earth_02.png differ diff --git a/java/res/drawable-hdpi/unbundled_key_01.png b/java/res/drawable-hdpi/unbundled_key_01.png index 84591ecb7..87c9e2c9b 100644 Binary files a/java/res/drawable-hdpi/unbundled_key_01.png and b/java/res/drawable-hdpi/unbundled_key_01.png differ diff --git a/java/res/drawable-hdpi/unbundled_key_02.png b/java/res/drawable-hdpi/unbundled_key_02.png index f366e524c..0747384b4 100644 Binary files a/java/res/drawable-hdpi/unbundled_key_02.png and b/java/res/drawable-hdpi/unbundled_key_02.png differ diff --git a/java/res/drawable-hdpi/unbundled_select_01.png b/java/res/drawable-hdpi/unbundled_select_01.png index 3887fe491..bb3de2f35 100644 Binary files a/java/res/drawable-hdpi/unbundled_select_01.png and b/java/res/drawable-hdpi/unbundled_select_01.png differ diff --git a/java/res/drawable-hdpi/unbundled_select_02.png b/java/res/drawable-hdpi/unbundled_select_02.png index 6a99b6b09..e56fdab97 100644 Binary files a/java/res/drawable-hdpi/unbundled_select_02.png and b/java/res/drawable-hdpi/unbundled_select_02.png differ diff --git a/java/res/drawable-mdpi/unbundled_check_01.png b/java/res/drawable-mdpi/unbundled_check_01.png new file mode 100644 index 000000000..d0d02a368 Binary files /dev/null and b/java/res/drawable-mdpi/unbundled_check_01.png differ diff --git a/java/res/drawable-mdpi/unbundled_check_02.png b/java/res/drawable-mdpi/unbundled_check_02.png new file mode 100644 index 000000000..d34fa2297 Binary files /dev/null and b/java/res/drawable-mdpi/unbundled_check_02.png differ diff --git a/java/res/drawable-mdpi/unbundled_earth_01.png b/java/res/drawable-mdpi/unbundled_earth_01.png new file mode 100644 index 000000000..ba60181ac Binary files /dev/null and b/java/res/drawable-mdpi/unbundled_earth_01.png differ diff --git a/java/res/drawable-mdpi/unbundled_earth_02.png b/java/res/drawable-mdpi/unbundled_earth_02.png new file mode 100644 index 000000000..9c5263864 Binary files /dev/null and b/java/res/drawable-mdpi/unbundled_earth_02.png differ diff --git a/java/res/drawable-mdpi/unbundled_key_01.png b/java/res/drawable-mdpi/unbundled_key_01.png new file mode 100644 index 000000000..8cd72dbd5 Binary files /dev/null and b/java/res/drawable-mdpi/unbundled_key_01.png differ diff --git a/java/res/drawable-mdpi/unbundled_key_02.png b/java/res/drawable-mdpi/unbundled_key_02.png new file mode 100644 index 000000000..4ef6e0cb7 Binary files /dev/null and b/java/res/drawable-mdpi/unbundled_key_02.png differ diff --git a/java/res/drawable-mdpi/unbundled_select_01.png b/java/res/drawable-mdpi/unbundled_select_01.png new file mode 100644 index 000000000..9ab008a46 Binary files /dev/null and b/java/res/drawable-mdpi/unbundled_select_01.png differ diff --git a/java/res/drawable-mdpi/unbundled_select_02.png b/java/res/drawable-mdpi/unbundled_select_02.png new file mode 100644 index 000000000..8af807b2d Binary files /dev/null and b/java/res/drawable-mdpi/unbundled_select_02.png differ diff --git a/java/res/drawable-xhdpi/unbundled_check_01.png b/java/res/drawable-xhdpi/unbundled_check_01.png new file mode 100644 index 000000000..1300a7f5b Binary files /dev/null and b/java/res/drawable-xhdpi/unbundled_check_01.png differ diff --git a/java/res/drawable-xhdpi/unbundled_check_02.png b/java/res/drawable-xhdpi/unbundled_check_02.png new file mode 100644 index 000000000..715188656 Binary files /dev/null and b/java/res/drawable-xhdpi/unbundled_check_02.png differ diff --git a/java/res/drawable-xhdpi/unbundled_earth_01.png b/java/res/drawable-xhdpi/unbundled_earth_01.png new file mode 100644 index 000000000..24b663488 Binary files /dev/null and b/java/res/drawable-xhdpi/unbundled_earth_01.png differ diff --git a/java/res/drawable-xhdpi/unbundled_earth_02.png b/java/res/drawable-xhdpi/unbundled_earth_02.png new file mode 100644 index 000000000..59aa031b0 Binary files /dev/null and b/java/res/drawable-xhdpi/unbundled_earth_02.png differ diff --git a/java/res/drawable-xhdpi/unbundled_key_01.png b/java/res/drawable-xhdpi/unbundled_key_01.png new file mode 100644 index 000000000..c8b117b44 Binary files /dev/null and b/java/res/drawable-xhdpi/unbundled_key_01.png differ diff --git a/java/res/drawable-xhdpi/unbundled_key_02.png b/java/res/drawable-xhdpi/unbundled_key_02.png new file mode 100644 index 000000000..dc2da5632 Binary files /dev/null and b/java/res/drawable-xhdpi/unbundled_key_02.png differ diff --git a/java/res/drawable-xhdpi/unbundled_select_01.png b/java/res/drawable-xhdpi/unbundled_select_01.png new file mode 100644 index 000000000..baf1e55b5 Binary files /dev/null and b/java/res/drawable-xhdpi/unbundled_select_01.png differ diff --git a/java/res/drawable-xhdpi/unbundled_select_02.png b/java/res/drawable-xhdpi/unbundled_select_02.png new file mode 100644 index 000000000..ad1058e0c Binary files /dev/null and b/java/res/drawable-xhdpi/unbundled_select_02.png differ diff --git a/java/src/com/android/inputmethod/compat/TextViewCompatUtils.java b/java/src/com/android/inputmethod/compat/TextViewCompatUtils.java index d4f1ea830..f8e1902c0 100644 --- a/java/src/com/android/inputmethod/compat/TextViewCompatUtils.java +++ b/java/src/com/android/inputmethod/compat/TextViewCompatUtils.java @@ -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); } } diff --git a/java/src/com/android/inputmethod/latin/setup/SetupActivity.java b/java/src/com/android/inputmethod/latin/setup/SetupActivity.java index 099169aa9..e333e4d4f 100644 --- a/java/src/com/android/inputmethod/latin/setup/SetupActivity.java +++ b/java/src/com/android/inputmethod/latin/setup/SetupActivity.java @@ -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); } }