diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2013-09-10 21:23:08 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-10 21:23:08 -0700 |
| commit | a45580793c89c44e2e0ffff9f4cce6e9b95be02a (patch) | |
| tree | 7fb5eb866abb038eac55f9710ea5efc7374a7bb1 /packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java | |
| parent | 78d00050272d796cc77557b9b715604d1c566c01 (diff) | |
| parent | a339f2e5bbcfa94e9ba2cee9734a699816f3a413 (diff) | |
| download | frameworks_base-a45580793c89c44e2e0ffff9f4cce6e9b95be02a.zip frameworks_base-a45580793c89c44e2e0ffff9f4cce6e9b95be02a.tar.gz frameworks_base-a45580793c89c44e2e0ffff9f4cce6e9b95be02a.tar.bz2 | |
am a339f2e5: am 1434a407: Merge "More tweaks to match UX spec." into klp-dev
* commit 'a339f2e5bbcfa94e9ba2cee9734a699816f3a413':
More tweaks to match UX spec.
Diffstat (limited to 'packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java')
| -rw-r--r-- | packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java index 13a84f4..ba5a511 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java @@ -100,6 +100,7 @@ public class DirectoryFragment extends Fragment { private int mLastMode = MODE_UNKNOWN; private int mLastSortOrder = SORT_ORDER_UNKNOWN; + private boolean mLastShowSize = false; private Point mThumbSize; @@ -297,8 +298,9 @@ public class DirectoryFragment extends Fragment { mFilter = new MimePredicate(state.acceptMimes); - if (mLastMode == state.derivedMode) return; + if (mLastMode == state.derivedMode && mLastShowSize == state.showSize) return; mLastMode = state.derivedMode; + mLastShowSize = state.showSize; mListView.setVisibility(state.derivedMode == MODE_LIST ? View.VISIBLE : View.GONE); mGridView.setVisibility(state.derivedMode == MODE_GRID ? View.VISIBLE : View.GONE); @@ -525,7 +527,7 @@ public class DirectoryFragment extends Fragment { } } - private static class LoadingFooter extends Footer { + private class LoadingFooter extends Footer { public LoadingFooter() { super(1); } @@ -533,10 +535,19 @@ public class DirectoryFragment extends Fragment { @Override public View getView(View convertView, ViewGroup parent) { final Context context = parent.getContext(); + final State state = getDisplayState(DirectoryFragment.this); + if (convertView == null) { final LayoutInflater inflater = LayoutInflater.from(context); - convertView = inflater.inflate(R.layout.item_loading, parent, false); + if (state.derivedMode == MODE_LIST) { + convertView = inflater.inflate(R.layout.item_loading_list, parent, false); + } else if (state.derivedMode == MODE_GRID) { + convertView = inflater.inflate(R.layout.item_loading_grid, parent, false); + } else { + throw new IllegalStateException(); + } } + return convertView; } } |
