Loading packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java +6 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.documentsui; import java.util.ArrayList; import java.util.HashMap; import java.util.List; Loading Loading @@ -95,6 +96,9 @@ abstract class BaseActivity extends Activity { /** Instance state for every shown directory */ public HashMap<String, SparseArray<Parcelable>> dirState = Maps.newHashMap(); /** Currently copying file */ public List<DocumentInfo> selectedDocumentsForCopy = new ArrayList<DocumentInfo>(); public static final int ACTION_OPEN = 1; public static final int ACTION_CREATE = 2; public static final int ACTION_GET_CONTENT = 3; Loading Loading @@ -134,6 +138,7 @@ abstract class BaseActivity extends Activity { DurableUtils.writeToParcel(out, stack); out.writeString(currentSearch); out.writeMap(dirState); out.writeList(selectedDocumentsForCopy); } public static final Creator<State> CREATOR = new Creator<State>() { Loading @@ -154,6 +159,7 @@ abstract class BaseActivity extends Activity { DurableUtils.readFromParcel(in, state.stack); state.currentSearch = in.readString(); in.readMap(state.dirState, null); in.readList(state.selectedDocumentsForCopy, null); return state; } Loading packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java +2 −4 Original line number Diff line number Diff line Loading @@ -100,8 +100,6 @@ public class DirectoryFragment extends Fragment { private AbsListView mCurrentView; private List<DocumentInfo> mSelectedDocumentsForCopy; public static final int TYPE_NORMAL = 1; public static final int TYPE_SEARCH = 2; public static final int TYPE_RECENT_OPEN = 3; Loading Loading @@ -357,7 +355,7 @@ public class DirectoryFragment extends Fragment { return; } final List<DocumentInfo> docs = mSelectedDocumentsForCopy; final List<DocumentInfo> docs = getDisplayState(this).selectedDocumentsForCopy; final Intent copyIntent = new Intent(context, CopyService.class); copyIntent.putParcelableArrayListExtra(CopyService.EXTRA_SRC_LIST, new ArrayList<DocumentInfo>(docs)); copyIntent.putExtra(CopyService.EXTRA_STACK, data.getParcelableExtra(CopyService.EXTRA_STACK)); Loading Loading @@ -674,7 +672,7 @@ public class DirectoryFragment extends Fragment { } private void onCopyDocuments(List<DocumentInfo> docs) { mSelectedDocumentsForCopy = docs; getDisplayState(this).selectedDocumentsForCopy = docs; // Pop up a dialog to pick a destination. This is inadequate but works for now. // TODO: Implement a picker that is to spec. Loading Loading
packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java +6 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.documentsui; import java.util.ArrayList; import java.util.HashMap; import java.util.List; Loading Loading @@ -95,6 +96,9 @@ abstract class BaseActivity extends Activity { /** Instance state for every shown directory */ public HashMap<String, SparseArray<Parcelable>> dirState = Maps.newHashMap(); /** Currently copying file */ public List<DocumentInfo> selectedDocumentsForCopy = new ArrayList<DocumentInfo>(); public static final int ACTION_OPEN = 1; public static final int ACTION_CREATE = 2; public static final int ACTION_GET_CONTENT = 3; Loading Loading @@ -134,6 +138,7 @@ abstract class BaseActivity extends Activity { DurableUtils.writeToParcel(out, stack); out.writeString(currentSearch); out.writeMap(dirState); out.writeList(selectedDocumentsForCopy); } public static final Creator<State> CREATOR = new Creator<State>() { Loading @@ -154,6 +159,7 @@ abstract class BaseActivity extends Activity { DurableUtils.readFromParcel(in, state.stack); state.currentSearch = in.readString(); in.readMap(state.dirState, null); in.readList(state.selectedDocumentsForCopy, null); return state; } Loading
packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java +2 −4 Original line number Diff line number Diff line Loading @@ -100,8 +100,6 @@ public class DirectoryFragment extends Fragment { private AbsListView mCurrentView; private List<DocumentInfo> mSelectedDocumentsForCopy; public static final int TYPE_NORMAL = 1; public static final int TYPE_SEARCH = 2; public static final int TYPE_RECENT_OPEN = 3; Loading Loading @@ -357,7 +355,7 @@ public class DirectoryFragment extends Fragment { return; } final List<DocumentInfo> docs = mSelectedDocumentsForCopy; final List<DocumentInfo> docs = getDisplayState(this).selectedDocumentsForCopy; final Intent copyIntent = new Intent(context, CopyService.class); copyIntent.putParcelableArrayListExtra(CopyService.EXTRA_SRC_LIST, new ArrayList<DocumentInfo>(docs)); copyIntent.putExtra(CopyService.EXTRA_STACK, data.getParcelableExtra(CopyService.EXTRA_STACK)); Loading Loading @@ -674,7 +672,7 @@ public class DirectoryFragment extends Fragment { } private void onCopyDocuments(List<DocumentInfo> docs) { mSelectedDocumentsForCopy = docs; getDisplayState(this).selectedDocumentsForCopy = docs; // Pop up a dialog to pick a destination. This is inadequate but works for now. // TODO: Implement a picker that is to spec. Loading