Don't wipe out explicit Toolbar nav icon when calling setSupportActionBar
Bug: 18440924 Change-Id: I7221532d003fd0208cf91a5ffd9be24a7695bd3d
This commit is contained in:
@ -97,6 +97,7 @@ public class ToolbarWidgetWrapper implements DecorToolbar {
|
||||
mTitle = toolbar.getTitle();
|
||||
mSubtitle = toolbar.getSubtitle();
|
||||
mTitleSet = mTitle != null;
|
||||
mNavIcon = mToolbar.getNavigationIcon();
|
||||
final TypedArray a = toolbar.getContext().obtainStyledAttributes(null,
|
||||
R.styleable.ActionBar, R.attr.actionBarStyle, 0);
|
||||
mDefaultNavigationIcon = a.getDrawable(R.styleable.ActionBar_homeAsUpIndicator);
|
||||
@ -120,7 +121,7 @@ public class ToolbarWidgetWrapper implements DecorToolbar {
|
||||
if (icon != null) {
|
||||
setIcon(icon);
|
||||
}
|
||||
if (mDefaultNavigationIcon != null) {
|
||||
if (mNavIcon == null && mDefaultNavigationIcon != null) {
|
||||
setNavigationIcon(mDefaultNavigationIcon);
|
||||
}
|
||||
setDisplayOptions(a.getInt(R.styleable.ActionBar_displayOptions, 0));
|
||||
|
Reference in New Issue
Block a user