diff --git a/java/res/drawable-hdpi/unbundled_check_01.png b/java/res/drawable-hdpi/unbundled_check_01.png index 8234399d5e1dfa73e288fe06409a72e0243e189d..42cce2f0fa85def3429e61e2ea329ba9d264ec8c 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 6ccd07b55ad19f25b39d4972d4e33f1557427c59..dcd120eaccd87ed655e57670d58f5b7ad1758284 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 3d22f3bfcd5d9787edc863d42e01c20a9106b7ca..4a0f087edcd4ec1d34d9da0256351fda5d76d0aa 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 1998aea56268200d6c5e590a122be8f0edb59bc6..f4bd421f267e806b19971eee44dc43b17baec2fc 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 84591ecb7fa4d61437d9ebee130ab06999aa327a..87c9e2c9b8de0b2f1ac2dd88fb45e200e66abf82 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 f366e524c835c2b71d31350c766215724db7276a..0747384b4d04df3640ff75761234fb01cfa1388c 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 3887fe4916032058573d6e9ccfcb869f3e8e09ca..bb3de2f35c88edc968dab5eda2efb3c5afd274cd 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 6a99b6b095fe83006af3911c35342417b6d3815b..e56fdab977d3628111693ac5e5f8fa37aa1f16b6 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 0000000000000000000000000000000000000000..d0d02a3683233effbc67a25d9feaf30c1bb357fc 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 0000000000000000000000000000000000000000..d34fa2297ea2468f79f6968f27a8aaa6cc4980af 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 0000000000000000000000000000000000000000..ba60181ac1fe2e42f6cb2d8954d960aa8980d300 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 0000000000000000000000000000000000000000..9c5263864cdfa3e7adb2b67818da5f924133cf21 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 0000000000000000000000000000000000000000..8cd72dbd535e118cf29c74f00179ca870251305a 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 0000000000000000000000000000000000000000..4ef6e0cb78e08be2790746e3e9ac74d26caadbef 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 0000000000000000000000000000000000000000..9ab008a461084d65bc74a4b7099846f6f405bd2b 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 0000000000000000000000000000000000000000..8af807b2da8e3a7075d3f13834b80cc28d06bb21 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 0000000000000000000000000000000000000000..1300a7f5b5b9a3b02aeb5f24a5ac0fb8563ed58f 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 0000000000000000000000000000000000000000..715188656c77e49de9f33f4870ed03afe7cf9537 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 0000000000000000000000000000000000000000..24b6634887d4a322aa63fa51b61932d869d3d36b 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 0000000000000000000000000000000000000000..59aa031b0e79a39de0032e1090bb3c2f26418a26 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 0000000000000000000000000000000000000000..c8b117b44ddf789460113f3f8a0651d556af4ac5 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 0000000000000000000000000000000000000000..dc2da5632049b845c73679c73657f5231f93b0b6 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 0000000000000000000000000000000000000000..baf1e55b53560ff8f79aadea44fd2cf4d7ce49d2 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 0000000000000000000000000000000000000000..ad1058e0ca78b479b8a4e12180b79b0f79550257 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 d4f1ea83013bf92819d4e2c916d1f0074cd7f3f0..f8e1902c0e7e281a0013bd31a3d29b388314e763 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 099169aa933ad7e0a44223390d63238741b1e693..e333e4d4fd740cb0630d14297defc063e33c208a 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); } }