aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/compat/ViewCompatUtils.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-05-24 12:10:16 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-24 12:10:16 +0000
commit08acd8c06a9e8fe6b2dc7e102693cf7f72e78636 (patch)
treeb58c3bcda0ff09bd5af97da49517108b50727e79 /java/src/com/android/inputmethod/compat/ViewCompatUtils.java
parent19a11ab470643687256faec1ed887ef40356a7f4 (diff)
parent630a24141eeb80063648bc1bc4678439117321d2 (diff)
downloadlatinime-08acd8c06a9e8fe6b2dc7e102693cf7f72e78636.tar.gz
latinime-08acd8c06a9e8fe6b2dc7e102693cf7f72e78636.tar.xz
latinime-08acd8c06a9e8fe6b2dc7e102693cf7f72e78636.zip
am 630a2414: Use ViewCompat support library and delete ViewCompatUtils
* commit '630a24141eeb80063648bc1bc4678439117321d2': Use ViewCompat support library and delete ViewCompatUtils
Diffstat (limited to 'java/src/com/android/inputmethod/compat/ViewCompatUtils.java')
-rw-r--r--java/src/com/android/inputmethod/compat/ViewCompatUtils.java21
1 files changed, 2 insertions, 19 deletions
diff --git a/java/src/com/android/inputmethod/compat/ViewCompatUtils.java b/java/src/com/android/inputmethod/compat/ViewCompatUtils.java
index dec739d39..767cc423d 100644
--- a/java/src/com/android/inputmethod/compat/ViewCompatUtils.java
+++ b/java/src/com/android/inputmethod/compat/ViewCompatUtils.java
@@ -24,23 +24,13 @@ import java.lang.reflect.Method;
// Currently {@link #getPaddingEnd(View)} and {@link #setPaddingRelative(View,int,int,int,int)}
// are missing from android-support-v4 static library in KitKat SDK.
public final class ViewCompatUtils {
- // Note that View.LAYOUT_DIRECTION_LTR and View.LAYOUT_DIRECTION_RTL have been introduced in
- // API level 17 (Build.VERSION_CODE.JELLY_BEAN_MR1).
- public static final int LAYOUT_DIRECTION_LTR = (Integer)CompatUtils.getFieldValue(null, 0x0,
- CompatUtils.getField(View.class, "LAYOUT_DIRECTION_LTR"));
- public static final int LAYOUT_DIRECTION_RTL = (Integer)CompatUtils.getFieldValue(null, 0x1,
- CompatUtils.getField(View.class, "LAYOUT_DIRECTION_RTL"));
-
- // Note that View.getPaddingEnd(), View.setPaddingRelative(int,int,int,int), and
- // View.getLayoutDirection() have been introduced in API level 17
- // (Build.VERSION_CODE.JELLY_BEAN_MR1).
+ // Note that View.getPaddingEnd(), View.setPaddingRelative(int,int,int,int) have been
+ // introduced in API level 17 (Build.VERSION_CODE.JELLY_BEAN_MR1).
private static final Method METHOD_getPaddingEnd = CompatUtils.getMethod(
View.class, "getPaddingEnd");
private static final Method METHOD_setPaddingRelative = CompatUtils.getMethod(
View.class, "setPaddingRelative",
Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE);
- private static final Method METHOD_getLayoutDirection = CompatUtils.getMethod(
- View.class, "getLayoutDirection");
private ViewCompatUtils() {
// This utility class is not publicly instantiable.
@@ -61,11 +51,4 @@ public final class ViewCompatUtils {
}
CompatUtils.invoke(view, null, METHOD_setPaddingRelative, start, top, end, bottom);
}
-
- public static int getLayoutDirection(final View view) {
- if (METHOD_getLayoutDirection == null) {
- return LAYOUT_DIRECTION_LTR;
- }
- return (Integer)CompatUtils.invoke(view, 0, METHOD_getLayoutDirection);
- }
}