use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by AOSPA.
the class MultiSelectManager_SelectionTest method testSize.
public void testSize() {
Selection other = new Selection();
for (int i = 0; i < selection.size(); i++) {
other.add(ids[i]);
}
assertEquals(selection.size(), other.size());
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by AOSPA.
the class MultiSelectManagerTest method testProvisionalSelection.
public void testProvisionalSelection() {
Selection s = mManager.getSelection();
assertSelection();
SparseBooleanArray provisional = new SparseBooleanArray();
provisional.append(1, true);
provisional.append(2, true);
s.setProvisionalSelection(getItemIds(provisional));
assertSelection(items.get(1), items.get(2));
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by AOSPA.
the class MultiSelectManagerTest method testProvisionalSelection_IntersectsExistingProvisionalSelection.
public void testProvisionalSelection_IntersectsExistingProvisionalSelection() {
Selection s = mManager.getSelection();
SparseBooleanArray provisional = new SparseBooleanArray();
provisional.append(1, true);
provisional.append(2, true);
s.setProvisionalSelection(getItemIds(provisional));
provisional.clear();
provisional.append(1, true);
s.setProvisionalSelection(getItemIds(provisional));
assertSelection(items.get(1));
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by AOSPA.
the class MultiSelectManagerTest method testProvisionalSelection_Cancel.
public void testProvisionalSelection_Cancel() {
mManager.toggleSelection(items.get(1));
mManager.toggleSelection(items.get(2));
Selection s = mManager.getSelection();
SparseBooleanArray provisional = new SparseBooleanArray();
provisional.append(3, true);
provisional.append(4, true);
s.setProvisionalSelection(getItemIds(provisional));
s.cancelProvisionalSelection();
// Original selection should remain.
assertSelection(items.get(1), items.get(2));
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by AOSPA.
the class MultiSelectManagerTest method assertSelectionSize.
private void assertSelectionSize(int expected) {
Selection selection = mManager.getSelection();
assertEquals(selection.toString(), expected, selection.size());
}
Aggregations