diff options
author | Deepanshu Gupta <deepanshu@google.com> | 2015-03-17 14:16:42 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-03-17 14:16:42 +0000 |
commit | 9a00f1c84b7a7936a12415a08604ac8fb98ec5ea (patch) | |
tree | 93f2cf612e60109c5bc584c4b0e993cf8c40b4e9 /tools/layoutlib/bridge/src/com | |
parent | 0d756f7d5646f84753a3db5f702f4ac79bda22bf (diff) | |
parent | 79f7fce7a49e7b7cd414ff5c3fdb5cbaae45c1f1 (diff) | |
download | frameworks_base-9a00f1c84b7a7936a12415a08604ac8fb98ec5ea.zip frameworks_base-9a00f1c84b7a7936a12415a08604ac8fb98ec5ea.tar.gz frameworks_base-9a00f1c84b7a7936a12415a08604ac8fb98ec5ea.tar.bz2 |
am 79f7fce7: am 2e4d9324: Fix NoActionBar themes rendering.
* commit '79f7fce7a49e7b7cd414ff5c3fdb5cbaae45c1f1':
Fix NoActionBar themes rendering.
Diffstat (limited to 'tools/layoutlib/bridge/src/com')
3 files changed, 6 insertions, 6 deletions
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/AppCompatActionBar.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/AppCompatActionBar.java index e5023b8..f54815e 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/AppCompatActionBar.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/AppCompatActionBar.java @@ -55,7 +55,7 @@ public class AppCompatActionBar extends BridgeActionBar { View contentView = getDecorContent().findViewById(contentRootId); if (contentView != null) { assert contentView instanceof FrameLayout; - setContentRoot(((FrameLayout) contentView)); + setContentRoot((FrameLayout) contentView); } else { // Something went wrong. Create a new FrameLayout in the enclosing layout. FrameLayout contentRoot = new FrameLayout(context); @@ -104,8 +104,8 @@ public class AppCompatActionBar extends BridgeActionBar { protected void setIcon(String icon) { // Do this only if the action bar doesn't already have an icon. if (icon != null && !icon.isEmpty() && mWindowDecorActionBar != null) { - if (((Boolean) invoke(getMethod(mWindowActionBarClass, "hasIcon"), mWindowDecorActionBar) - )) { + if (invoke(getMethod(mWindowActionBarClass, "hasIcon"), mWindowDecorActionBar) + == Boolean.TRUE) { Drawable iconDrawable = getDrawable(icon, false); if (iconDrawable != null) { Method setIcon = getMethod(mWindowActionBarClass, "setIcon", Drawable.class); diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/BridgeActionBar.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/BridgeActionBar.java index b29d25f..c25db35 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/BridgeActionBar.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/BridgeActionBar.java @@ -44,6 +44,7 @@ public abstract class BridgeActionBar { private final View mDecorContent; private final ActionBarCallback mCallback; + @SuppressWarnings("NullableProblems") // Should be initialized by subclasses. @NonNull private FrameLayout mContentRoot; public BridgeActionBar(@NonNull BridgeContext context, @NonNull SessionParams params, @@ -91,7 +92,7 @@ public abstract class BridgeActionBar { */ protected abstract ResourceValue getLayoutResource(BridgeContext context); - protected void setContentRoot(FrameLayout contentRoot) { + protected void setContentRoot(@NonNull FrameLayout contentRoot) { mContentRoot = contentRoot; } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java index b6b63b1..fc4f9f1 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java @@ -1117,8 +1117,7 @@ public class RenderSessionImpl extends RenderAction<SessionParams> { } } else { // action bar overrides title bar so only look for this one if action bar is hidden - boolean windowNoTitle = getBooleanThemeValue(resources, - "windowNoTitle", false, !isThemeAppCompat(resources)); + boolean windowNoTitle = getBooleanThemeValue(resources, "windowNoTitle", false, true); if (!windowNoTitle) { |