diff options
author | Tomasz Mikolajewski <mtomasz@google.com> | 2015-06-18 00:23:57 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-06-18 00:23:57 +0000 |
commit | 327dbb57c36026843ce0e8b8f1b98998b7cebec8 (patch) | |
tree | 3ce061f4b692db73414314c15d9f6c1523637811 /packages/DocumentsUI | |
parent | 353397d874b96098d0ce458afa5d14264870df40 (diff) | |
parent | 41ce003934c228f68e82645062665e0d2c443781 (diff) | |
download | frameworks_base-327dbb57c36026843ce0e8b8f1b98998b7cebec8.zip frameworks_base-327dbb57c36026843ce0e8b8f1b98998b7cebec8.tar.gz frameworks_base-327dbb57c36026843ce0e8b8f1b98998b7cebec8.tar.bz2 |
am 41ce0039: Merge "Remove the action bar icon when there is no drawer enabled." into mnc-dev
* commit '41ce003934c228f68e82645062665e0d2c443781':
Remove the action bar icon when there is no drawer enabled.
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 4211406..fe148da 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java @@ -408,15 +408,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() { @@ -425,6 +418,10 @@ public class DocumentsActivity extends BaseActivity { setRootsDrawerOpen(true); } }); + } else { + mToolbar.setNavigationIcon(null); + mToolbar.setNavigationContentDescription(R.string.drawer_open); + mToolbar.setNavigationOnClickListener(null); } if (mSearchManager.isExpanded()) { @@ -433,7 +430,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 { |