* commit '73c3c65b1bb05754c688a76a1dbc79c0120c0915': When launched into empty recents, show drawer.
This commit is contained in:
@@ -295,6 +295,11 @@ public class DirectoryFragment extends Fragment {
|
|||||||
|
|
||||||
updateDisplayState();
|
updateDisplayState();
|
||||||
|
|
||||||
|
// When launched into empty recents, show drawer
|
||||||
|
if (mType == TYPE_RECENT_OPEN && mAdapter.isEmpty() && !state.stackTouched) {
|
||||||
|
((DocumentsActivity) context).setRootsDrawerOpen(true);
|
||||||
|
}
|
||||||
|
|
||||||
// Restore any previous instance state
|
// Restore any previous instance state
|
||||||
final SparseArray<Parcelable> container = state.dirState.remove(mStateKey);
|
final SparseArray<Parcelable> container = state.dirState.remove(mStateKey);
|
||||||
if (container != null && !getArguments().getBoolean(EXTRA_IGNORE_STATE, false)) {
|
if (container != null && !getArguments().getBoolean(EXTRA_IGNORE_STATE, false)) {
|
||||||
|
|||||||
@@ -109,6 +109,11 @@ public class RecentsCreateFragment extends Fragment {
|
|||||||
public void onLoadFinished(
|
public void onLoadFinished(
|
||||||
Loader<List<DocumentStack>> loader, List<DocumentStack> data) {
|
Loader<List<DocumentStack>> loader, List<DocumentStack> data) {
|
||||||
mAdapter.swapStacks(data);
|
mAdapter.swapStacks(data);
|
||||||
|
|
||||||
|
// When launched into empty recents, show drawer
|
||||||
|
if (mAdapter.isEmpty() && !state.stackTouched) {
|
||||||
|
((DocumentsActivity) context).setRootsDrawerOpen(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -142,9 +142,12 @@ public class RootsFragment extends Fragment {
|
|||||||
final RootInfo root = ((DocumentsActivity) getActivity()).getCurrentRoot();
|
final RootInfo root = ((DocumentsActivity) getActivity()).getCurrentRoot();
|
||||||
for (int i = 0; i < mAdapter.getCount(); i++) {
|
for (int i = 0; i < mAdapter.getCount(); i++) {
|
||||||
final Object item = mAdapter.getItem(i);
|
final Object item = mAdapter.getItem(i);
|
||||||
if (Objects.equal(item, root)) {
|
if (item instanceof RootItem) {
|
||||||
mList.setItemChecked(i, true);
|
final RootInfo testRoot = ((RootItem) item).root;
|
||||||
return;
|
if (Objects.equal(testRoot, root)) {
|
||||||
|
mList.setItemChecked(i, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user