Loading src/com/android/documentsui/selection/SelectionManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,8 @@ public final class SelectionManager { // Update the selection to remove any disappeared IDs. mSelection.cancelProvisionalSelection(); mSelection.intersect(mModelIds); notifyDataChanged(); } @Override Loading Loading @@ -423,6 +425,19 @@ public final class SelectionManager { return mCanSetState.test(id, nextState); } private void notifyDataChanged() { int lastListener = mItemCallbacks.size() - 1; for (String id : mSelection) { if (!canSetState(id, true)) { attemptDeselect(id); } else { for (int i = lastListener; i >= 0; i--) { mItemCallbacks.get(i).onItemStateChanged(id, true); } } } } /** * Notifies registered listeners when the selection status of a single item * (identified by {@code position}) changes. Loading src/com/android/documentsui/selection/SelectionMetadata.java +9 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,15 @@ public class SelectionMetadata mDocFinder = docFinder; } public void reset(){ mFileCount = 0; mDirectoryCount = 0; mPartialCount = 0; mWritableDirectoryCount = 0; mNoDeleteCount = 0; mNoRenameCount = 0; } @Override public void onItemStateChanged(String modelId, boolean selected) { final Cursor cursor = mDocFinder.apply(modelId); Loading Loading
src/com/android/documentsui/selection/SelectionManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,8 @@ public final class SelectionManager { // Update the selection to remove any disappeared IDs. mSelection.cancelProvisionalSelection(); mSelection.intersect(mModelIds); notifyDataChanged(); } @Override Loading Loading @@ -423,6 +425,19 @@ public final class SelectionManager { return mCanSetState.test(id, nextState); } private void notifyDataChanged() { int lastListener = mItemCallbacks.size() - 1; for (String id : mSelection) { if (!canSetState(id, true)) { attemptDeselect(id); } else { for (int i = lastListener; i >= 0; i--) { mItemCallbacks.get(i).onItemStateChanged(id, true); } } } } /** * Notifies registered listeners when the selection status of a single item * (identified by {@code position}) changes. Loading
src/com/android/documentsui/selection/SelectionMetadata.java +9 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,15 @@ public class SelectionMetadata mDocFinder = docFinder; } public void reset(){ mFileCount = 0; mDirectoryCount = 0; mPartialCount = 0; mWritableDirectoryCount = 0; mNoDeleteCount = 0; mNoRenameCount = 0; } @Override public void onItemStateChanged(String modelId, boolean selected) { final Cursor cursor = mDocFinder.apply(modelId); Loading