From 0166ddf5bbb5d855cb2f5bca4c6a9f0281c14814 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 23 Oct 2014 13:59:54 -0700 Subject: Recent directories can't show file size. Don't show the toggle to the user, which can avoid crashing. Bug: 17942524 Change-Id: Iaedd61b7c69e14b57508cb9865d1e0124ca2e505 --- .../DocumentsUI/src/com/android/documentsui/DocumentsActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'packages/DocumentsUI') diff --git a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java index fef1f4a..219de38 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java @@ -574,7 +574,8 @@ public class DocumentsActivity extends Activity { // Only sort by size when visible sortSize.setVisible(mState.showSize); - final boolean searchVisible; + boolean searchVisible; + boolean fileSizeVisible = mState.action != ACTION_MANAGE; if (mState.action == ACTION_CREATE || mState.action == ACTION_OPEN_TREE) { createDir.setVisible(cwd != null && cwd.isCreateSupported()); searchVisible = false; @@ -583,6 +584,7 @@ public class DocumentsActivity extends Activity { if (cwd == null) { grid.setVisible(false); list.setVisible(false); + fileSizeVisible = false; } if (mState.action == ACTION_CREATE) { @@ -604,7 +606,7 @@ public class DocumentsActivity extends Activity { ? R.string.menu_file_size_hide : R.string.menu_file_size_show); advanced.setVisible(mState.action != ACTION_MANAGE); - fileSize.setVisible(mState.action != ACTION_MANAGE); + fileSize.setVisible(fileSizeVisible); return true; } -- cgit v1.1