Search in sources :

Example 41 with Selection

use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by DirtyUnicorns.

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());
}
Also used : Selection(com.android.documentsui.dirlist.MultiSelectManager.Selection)

Example 42 with Selection

use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by DirtyUnicorns.

the class MultiSelectManager_SelectionTest method testIntersection_empty0.

public void testIntersection_empty0() {
    Selection testSelection = new Selection();
    testSelection.intersect(new HashSet<String>());
    assertTrue(testSelection.isEmpty());
}
Also used : Selection(com.android.documentsui.dirlist.MultiSelectManager.Selection)

Example 43 with Selection

use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by DirtyUnicorns.

the class DirectoryFragment method create.

public static void create(FragmentManager fm, int type, RootInfo root, DocumentInfo doc, String query, int anim) {
    final Bundle args = new Bundle();
    args.putInt(Shared.EXTRA_TYPE, type);
    args.putParcelable(Shared.EXTRA_ROOT, root);
    args.putParcelable(Shared.EXTRA_DOC, doc);
    args.putString(Shared.EXTRA_QUERY, query);
    args.putParcelable(Shared.EXTRA_SELECTION, new Selection());
    final FragmentTransaction ft = fm.beginTransaction();
    AnimationView.setupAnimations(ft, anim, args);
    final DirectoryFragment fragment = new DirectoryFragment();
    fragment.setArguments(args);
    ft.replace(getFragmentId(), fragment);
    ft.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.app.FragmentTransaction) Bundle(android.os.Bundle) Selection(com.android.documentsui.dirlist.MultiSelectManager.Selection)

Example 44 with Selection

use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by DirtyUnicorns.

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();
    }
}
Also used : Selection(com.android.documentsui.dirlist.MultiSelectManager.Selection)

Example 45 with Selection

use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by AOSPA.

the class ModelTest method positionToSelection.

private Selection positionToSelection(int... positions) {
    String[] ids = model.getModelIds();
    Selection s = new Selection();
    // Construct a selection of the given positions.
    for (int p : positions) {
        s.add(ids[p]);
    }
    return s;
}
Also used : Selection(com.android.documentsui.dirlist.MultiSelectManager.Selection)

Aggregations

Selection (com.android.documentsui.dirlist.MultiSelectManager.Selection)110 SparseBooleanArray (android.util.SparseBooleanArray)30 Bundle (android.os.Bundle)10 ActivityManager (android.app.ActivityManager)5 FragmentTransaction (android.app.FragmentTransaction)5 Context (android.content.Context)5 Point (android.graphics.Point)5 AccessibilityNodeInfoCompat (android.support.v4.view.accessibility.AccessibilityNodeInfoCompat)5 GridLayoutManager (android.support.v7.widget.GridLayoutManager)5 SpanSizeLookup (android.support.v7.widget.GridLayoutManager.SpanSizeLookup)5 RecyclerView (android.support.v7.widget.RecyclerView)5 Recycler (android.support.v7.widget.RecyclerView.Recycler)5 ViewHolder (android.support.v7.widget.RecyclerView.ViewHolder)5 View (android.view.View)5 ImageView (android.widget.ImageView)5 TextView (android.widget.TextView)5 DocumentClipper (com.android.documentsui.DocumentClipper)5 State (com.android.documentsui.State)5