diff options
author | Tomasz Mikolajewski <mtomasz@google.com> | 2015-06-12 15:32:30 -0700 |
---|---|---|
committer | Tomasz Mikolajewski <mtomasz@google.com> | 2015-06-12 15:33:45 -0700 |
commit | 536ac48aa9268539913c210267679ded906057ca (patch) | |
tree | 802f694b79c52778da0c0850ac204a8dfc14d12d /packages/DocumentsUI | |
parent | 09425e506948648a469e2ed0b244fc65c85fafc0 (diff) | |
download | frameworks_base-536ac48aa9268539913c210267679ded906057ca.zip frameworks_base-536ac48aa9268539913c210267679ded906057ca.tar.gz frameworks_base-536ac48aa9268539913c210267679ded906057ca.tar.bz2 |
Remove the action bar icon when there is no drawer enabled.
Keep the hamburger menu though if the drawer is visible and unlocked.
TEST=Tested manually on both tablet and phone form factors.
BUG=18685509
Change-Id: Ie6f8d7064da99d2dc34315ccb92ab4db6ee321b6
Diffstat (limited to 'packages/DocumentsUI')
-rw-r--r-- | packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java index 69ae34e..bd12f74 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java @@ -402,15 +402,8 @@ public class DocumentsActivity extends BaseActivity { } } - final RootInfo root = getCurrentRoot(); - final boolean showRootIcon = mShowAsDialog - || (mState.action == ACTION_MANAGE || mState.action == ACTION_BROWSE); - if (showRootIcon) { - mToolbar.setNavigationIcon( - root != null ? root.loadToolbarIcon(mToolbar.getContext()) : null); - mToolbar.setNavigationContentDescription(R.string.drawer_open); - mToolbar.setNavigationOnClickListener(null); - } else { + if (!mShowAsDialog && mDrawerLayout.getDrawerLockMode(mRootsDrawer) == + DrawerLayout.LOCK_MODE_UNLOCKED) { mToolbar.setNavigationIcon(R.drawable.ic_hamburger); mToolbar.setNavigationContentDescription(R.string.drawer_open); mToolbar.setNavigationOnClickListener(new View.OnClickListener() { @@ -419,6 +412,10 @@ public class DocumentsActivity extends BaseActivity { setRootsDrawerOpen(true); } }); + } else { + mToolbar.setNavigationIcon(null); + mToolbar.setNavigationContentDescription(R.string.drawer_open); + mToolbar.setNavigationOnClickListener(null); } if (mSearchManager.isExpanded()) { @@ -427,7 +424,7 @@ public class DocumentsActivity extends BaseActivity { mToolbarStack.setAdapter(null); } else { if (mState.stack.size() <= 1) { - mToolbar.setTitle(root.title); + mToolbar.setTitle(getCurrentRoot().title); mToolbarStack.setVisibility(View.GONE); mToolbarStack.setAdapter(null); } else { |