summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2015-08-26 05:57:48 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-26 05:57:48 +0000
commit5078ad325b0da36fe798df1df428d12732548217 (patch)
treefdc227717a1a990479d2e3853bbf270ae47a4a1d
parent4a2137639aba761dcf289f1e2cc2e48dd42e7a3f (diff)
parent6b1b651fedc421265d328f1b74512e62ac8a2e13 (diff)
downloadframeworks_base-5078ad325b0da36fe798df1df428d12732548217.zip
frameworks_base-5078ad325b0da36fe798df1df428d12732548217.tar.gz
frameworks_base-5078ad325b0da36fe798df1df428d12732548217.tar.bz2
am 6b1b651f: Fix imports. [DO NOT MERGE]
* commit '6b1b651fedc421265d328f1b74512e62ac8a2e13': Fix imports. [DO NOT MERGE]
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/DesignLibUtil.java9
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/RecyclerViewUtil.java13
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Layout.java13
3 files changed, 12 insertions, 23 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/DesignLibUtil.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/DesignLibUtil.java
index 0426907..aa873a6 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/DesignLibUtil.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/DesignLibUtil.java
@@ -18,14 +18,12 @@ package com.android.layoutlib.bridge.android.support;
import com.android.ide.common.rendering.api.LayoutLog;
import com.android.layoutlib.bridge.Bridge;
+import com.android.layoutlib.bridge.util.ReflectionUtils.ReflectionException;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.view.View;
-import java.lang.reflect.Method;
-
-import static com.android.layoutlib.bridge.util.ReflectionUtils.ReflectionException;
import static com.android.layoutlib.bridge.util.ReflectionUtils.getMethod;
import static com.android.layoutlib.bridge.util.ReflectionUtils.invoke;
@@ -53,10 +51,7 @@ public class DesignLibUtil {
return;
}
try {
- Method setTitle = getMethod(view.getClass(), "setTitle", CharSequence.class);
- if (setTitle != null) {
- invoke(setTitle, view, title);
- }
+ invoke(getMethod(view.getClass(), "setTitle", CharSequence.class), view, title);
} catch (ReflectionException e) {
Bridge.getLog().warning(LayoutLog.TAG_INFO,
"Error occurred while trying to set title.", e);
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/RecyclerViewUtil.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/RecyclerViewUtil.java
index d14c80b..d432120 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/RecyclerViewUtil.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/RecyclerViewUtil.java
@@ -21,16 +21,13 @@ import com.android.ide.common.rendering.api.LayoutlibCallback;
import com.android.layoutlib.bridge.Bridge;
import com.android.layoutlib.bridge.android.BridgeContext;
import com.android.layoutlib.bridge.android.RenderParamsFlags;
-import com.android.layoutlib.bridge.util.ReflectionUtils;
+import com.android.layoutlib.bridge.util.ReflectionUtils.ReflectionException;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.view.View;
-import java.lang.reflect.Method;
-
-import static com.android.layoutlib.bridge.util.ReflectionUtils.ReflectionException;
import static com.android.layoutlib.bridge.util.ReflectionUtils.getCause;
import static com.android.layoutlib.bridge.util.ReflectionUtils.getMethod;
import static com.android.layoutlib.bridge.util.ReflectionUtils.invoke;
@@ -98,8 +95,7 @@ public class RecyclerViewUtil {
@Nullable
private static Object getLayoutManager(View recyclerView) throws ReflectionException {
- Method getLayoutManager = getMethod(recyclerView.getClass(), "getLayoutManager");
- return getLayoutManager != null ? invoke(getLayoutManager, recyclerView) : null;
+ return invoke(getMethod(recyclerView.getClass(), "getLayoutManager"), recyclerView);
}
@Nullable
@@ -127,10 +123,7 @@ public class RecyclerViewUtil {
private static void setProperty(@NonNull Object object, @NonNull Class<?> propertyClass,
@Nullable Object propertyValue, @NonNull String propertySetter)
throws ReflectionException {
- Method setter = getMethod(object.getClass(), propertySetter, propertyClass);
- if (setter != null) {
- invoke(setter, object, propertyValue);
- }
+ invoke(getMethod(object.getClass(), propertySetter, propertyClass), object, propertyValue);
}
/**
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Layout.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Layout.java
index d1c9f21..8c7ea8a 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Layout.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/Layout.java
@@ -45,6 +45,7 @@ import android.widget.RelativeLayout;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.widget.LinearLayout.VERTICAL;
+import static com.android.layoutlib.bridge.impl.ResourceHelper.getBooleanThemeValue;
/**
* The Layout used to create the system decor.
@@ -325,7 +326,7 @@ class Layout extends RelativeLayout {
mParams = params;
mContext = context;
mResources = mParams.getResources();
- mWindowIsFloating = ResourceHelper.getBooleanThemeValue(mResources, ATTR_WINDOW_FLOATING, true, true);
+ mWindowIsFloating = getBooleanThemeValue(mResources, ATTR_WINDOW_FLOATING, true, true);
findBackground();
findStatusBar();
@@ -342,11 +343,11 @@ class Layout extends RelativeLayout {
private void findStatusBar() {
boolean windowFullScreen =
- ResourceHelper.getBooleanThemeValue(mResources, ATTR_WINDOW_FULL_SCREEN, true, false);
+ getBooleanThemeValue(mResources, ATTR_WINDOW_FULL_SCREEN, true, false);
if (!windowFullScreen && !mWindowIsFloating) {
mStatusBarSize =
getDimension(ATTR_STATUS_BAR_HEIGHT, true, DEFAULT_STATUS_BAR_HEIGHT);
- mTranslucentStatus = ResourceHelper.getBooleanThemeValue(mResources,
+ mTranslucentStatus = getBooleanThemeValue(mResources,
ATTR_WINDOW_TRANSLUCENT_STATUS, true, false);
}
}
@@ -356,14 +357,14 @@ class Layout extends RelativeLayout {
return;
}
// Check if an actionbar is needed
- boolean windowActionBar = ResourceHelper.getBooleanThemeValue(mResources, ATTR_WINDOW_ACTION_BAR,
+ boolean windowActionBar = getBooleanThemeValue(mResources, ATTR_WINDOW_ACTION_BAR,
!isThemeAppCompat(), true);
if (windowActionBar) {
mActionBarSize = getDimension(ATTR_ACTION_BAR_SIZE, true, DEFAULT_TITLE_BAR_HEIGHT);
} else {
// Maybe the gingerbread era title bar is needed
boolean windowNoTitle =
- ResourceHelper.getBooleanThemeValue(mResources, ATTR_WINDOW_NO_TITLE, true, false);
+ getBooleanThemeValue(mResources, ATTR_WINDOW_NO_TITLE, true, false);
if (!windowNoTitle) {
mTitleBarSize =
getDimension(ATTR_WINDOW_TITLE_SIZE, true, DEFAULT_TITLE_BAR_HEIGHT);
@@ -391,7 +392,7 @@ class Layout extends RelativeLayout {
mNavBarOrientation = barOnBottom ? LinearLayout.HORIZONTAL : VERTICAL;
mNavBarSize = getDimension(barOnBottom ? ATTR_NAV_BAR_HEIGHT : ATTR_NAV_BAR_WIDTH,
true, DEFAULT_NAV_BAR_SIZE);
- mTranslucentNav = ResourceHelper.getBooleanThemeValue(mResources,
+ mTranslucentNav = getBooleanThemeValue(mResources,
ATTR_WINDOW_TRANSLUCENT_NAV, true, false);
}
}