use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by crdroidandroid.
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 DirectoryFragment method copySelectedToClipboard.
public void copySelectedToClipboard() {
Metrics.logUserAction(getContext(), Metrics.USER_ACTION_COPY_CLIPBOARD);
Selection selection = mSelectionManager.getSelection(new Selection());
if (!selection.isEmpty()) {
copySelectionToClipboard(selection);
mSelectionManager.clearSelection();
}
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by AOSPA.
the class MultiSelectManager_SelectionTest method testIntersection_exclusive.
public void testIntersection_exclusive() {
String[] ids0 = new String[] { "foo", "bar", "baz" };
String[] ids1 = new String[] { "0", "1", "2" };
Selection testSelection = new Selection();
testSelection.add(ids0[0]);
testSelection.add(ids0[1]);
testSelection.add(ids0[2]);
Set<String> set = Sets.newHashSet(ids1);
testSelection.intersect(set);
assertTrue(testSelection.isEmpty());
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by AOSPA.
the class MultiSelectManager_SelectionTest method testIntersection_empty0.
public void testIntersection_empty0() {
Selection testSelection = new Selection();
testSelection.intersect(new HashSet<String>());
assertTrue(testSelection.isEmpty());
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by AOSPA.
the class MultiSelectManager_SelectionTest method testIntersection_all.
public void testIntersection_all() {
String[] ids0 = new String[] { "foo", "bar", "baz" };
String[] ids1 = new String[] { "0", "baz", "1", "foo", "2", "bar" };
Selection testSelection = new Selection();
testSelection.add(ids0[0]);
testSelection.add(ids0[1]);
testSelection.add(ids0[2]);
Selection control = new Selection();
control.copyFrom(testSelection);
testSelection.intersect(Sets.newHashSet(ids1));
assertTrue(testSelection.equals(control));
}
Aggregations