am 79f7fce7: am 2e4d9324: Fix NoActionBar themes rendering.

* commit '79f7fce7a49e7b7cd414ff5c3fdb5cbaae45c1f1':
  Fix NoActionBar themes rendering.
This commit is contained in:
Deepanshu Gupta
2015-03-17 14:16:42 +00:00
committed by Android Git Automerger
3 changed files with 6 additions and 6 deletions

View File

@@ -55,7 +55,7 @@ public class AppCompatActionBar extends BridgeActionBar {
View contentView = getDecorContent().findViewById(contentRootId); View contentView = getDecorContent().findViewById(contentRootId);
if (contentView != null) { if (contentView != null) {
assert contentView instanceof FrameLayout; assert contentView instanceof FrameLayout;
setContentRoot(((FrameLayout) contentView)); setContentRoot((FrameLayout) contentView);
} else { } else {
// Something went wrong. Create a new FrameLayout in the enclosing layout. // Something went wrong. Create a new FrameLayout in the enclosing layout.
FrameLayout contentRoot = new FrameLayout(context); FrameLayout contentRoot = new FrameLayout(context);
@@ -104,8 +104,8 @@ public class AppCompatActionBar extends BridgeActionBar {
protected void setIcon(String icon) { protected void setIcon(String icon) {
// Do this only if the action bar doesn't already have an icon. // Do this only if the action bar doesn't already have an icon.
if (icon != null && !icon.isEmpty() && mWindowDecorActionBar != null) { 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); Drawable iconDrawable = getDrawable(icon, false);
if (iconDrawable != null) { if (iconDrawable != null) {
Method setIcon = getMethod(mWindowActionBarClass, "setIcon", Drawable.class); Method setIcon = getMethod(mWindowActionBarClass, "setIcon", Drawable.class);

View File

@@ -44,6 +44,7 @@ public abstract class BridgeActionBar {
private final View mDecorContent; private final View mDecorContent;
private final ActionBarCallback mCallback; private final ActionBarCallback mCallback;
@SuppressWarnings("NullableProblems") // Should be initialized by subclasses.
@NonNull private FrameLayout mContentRoot; @NonNull private FrameLayout mContentRoot;
public BridgeActionBar(@NonNull BridgeContext context, @NonNull SessionParams params, public BridgeActionBar(@NonNull BridgeContext context, @NonNull SessionParams params,
@@ -91,7 +92,7 @@ public abstract class BridgeActionBar {
*/ */
protected abstract ResourceValue getLayoutResource(BridgeContext context); protected abstract ResourceValue getLayoutResource(BridgeContext context);
protected void setContentRoot(FrameLayout contentRoot) { protected void setContentRoot(@NonNull FrameLayout contentRoot) {
mContentRoot = contentRoot; mContentRoot = contentRoot;
} }

View File

@@ -1117,8 +1117,7 @@ public class RenderSessionImpl extends RenderAction<SessionParams> {
} }
} else { } else {
// action bar overrides title bar so only look for this one if action bar is hidden // action bar overrides title bar so only look for this one if action bar is hidden
boolean windowNoTitle = getBooleanThemeValue(resources, boolean windowNoTitle = getBooleanThemeValue(resources, "windowNoTitle", false, true);
"windowNoTitle", false, !isThemeAppCompat(resources));
if (!windowNoTitle) { if (!windowNoTitle) {