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:21:32 +0900
committerTadashi G. Takaoka <takaoka@google.com>2014-05-24 12:26:30 +0900
commit630a24141eeb80063648bc1bc4678439117321d2 (patch)
treeb58c3bcda0ff09bd5af97da49517108b50727e79 /java/src/com/android/inputmethod/compat/ViewCompatUtils.java
parentfdb889cb43444a171bf71c2deaf00033b8a14949 (diff)
downloadlatinime-630a24141eeb80063648bc1bc4678439117321d2.tar.gz
latinime-630a24141eeb80063648bc1bc4678439117321d2.tar.xz
latinime-630a24141eeb80063648bc1bc4678439117321d2.zip
Use ViewCompat support library and delete ViewCompatUtils
Change-Id: I57d60cacd86e83894294c3f64402aba8c1829872
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);
- }
}