diff options
| author | 2015-03-17 14:53:10 +0000 | |
|---|---|---|
| committer | 2015-03-17 14:53:10 +0000 | |
| commit | a0c3191b74d1119999d94c71de8d916e128ea009 (patch) | |
| tree | 70af894dcee57e9088508da24620d9a801be250f | |
| parent | 6f6f825ebbea34255c69c0a6480f128348ec9bb6 (diff) | |
| parent | 0f8c9d1df28ed10b1c9013ddd315b306868e349d (diff) | |
am 0f8c9d1d: am a5be9a7d: am 38467b5f: am 9a00f1c8: am 79f7fce7: am 2e4d9324: Fix NoActionBar themes rendering.
* commit '0f8c9d1df28ed10b1c9013ddd315b306868e349d':
Fix NoActionBar themes rendering.
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 e5023b873e23..f54815e544c4 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 b29d25f78d65..c25db358bf1d 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 c9aa40010665..7c11284d3a84 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 @@ -1128,8 +1128,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) { |