Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7dd2325b authored by Ben Kwa's avatar Ben Kwa Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'directoryfragment-stable-ids'

* changes:
  Wrap up the stable ID refactor.
  Re-enable sorting in the DirectoryFragment.
  Fix file deletion after the move to Model IDs.
  Transition selection to use Model IDs.
  Switch DirectoryFragment code to use model IDs.
parents df1809e0 936a7fc6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public abstract class BaseActivity extends Activity {
    private int mLayoutId;
    private DirectoryContainerView mDirectoryContainer;

    public abstract void onDocumentPicked(DocumentInfo doc, @Nullable DocumentContext siblings);
    public abstract void onDocumentPicked(DocumentInfo doc, @Nullable SiblingProvider siblings);
    public abstract void onDocumentsPicked(List<DocumentInfo> docs);

    abstract void onTaskFinished(Uri... uris);
@@ -826,7 +826,7 @@ public abstract class BaseActivity extends Activity {
     * Interface providing access to current view of documents
     * even when all documents are not homed to the same parent.
     */
    public interface DocumentContext {
    public interface SiblingProvider {
        /**
         * Returns the cursor for the selected document. The cursor can be used to retrieve
         * details about a document and its siblings.
+0 −3
Original line number Diff line number Diff line
@@ -156,9 +156,6 @@ public class DirectoryLoader extends AsyncTaskLoader<DirectoryResult> {
            if (mType == DirectoryFragment.TYPE_SEARCH) {
                // Filter directories out of search results, for now
                cursor = new FilteringCursorWrapper(cursor, null, SEARCH_REJECT_MIMES);
            } else {
                // Normal directories should have sorting applied
                cursor = new SortingCursorWrapper(cursor, result.sortOrder);
            }

            result.client = client;
+2 −3
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@ package com.android.documentsui;
import static com.android.documentsui.State.ACTION_CREATE;
import static com.android.documentsui.State.ACTION_GET_CONTENT;
import static com.android.documentsui.State.ACTION_OPEN;
import static com.android.documentsui.State.ACTION_PICK_COPY_DESTINATION;
import static com.android.documentsui.State.ACTION_OPEN_TREE;
import static com.android.documentsui.State.ACTION_PICK_COPY_DESTINATION;
import static com.android.documentsui.dirlist.DirectoryFragment.ANIM_NONE;

import android.app.Activity;
@@ -31,7 +31,6 @@ import android.content.ComponentName;
import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
@@ -419,7 +418,7 @@ public class DocumentsActivity extends BaseActivity {
    }

    @Override
    public void onDocumentPicked(DocumentInfo doc, DocumentContext context) {
    public void onDocumentPicked(DocumentInfo doc, SiblingProvider siblings) {
        final FragmentManager fm = getFragmentManager();
        if (doc.isContainer()) {
            openContainerDocument(doc);
+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ public class DownloadsActivity extends BaseActivity {
    }

    @Override
    public void onDocumentPicked(DocumentInfo doc, DocumentContext context) {
    public void onDocumentPicked(DocumentInfo doc, SiblingProvider siblings) {
        final FragmentManager fm = getFragmentManager();
        if (doc.isContainer()) {
            openContainerDocument(doc);
+2 −2
Original line number Diff line number Diff line
@@ -323,7 +323,7 @@ public class FilesActivity extends BaseActivity {
    }

    @Override
    public void onDocumentPicked(DocumentInfo doc, @Nullable DocumentContext siblings) {
    public void onDocumentPicked(DocumentInfo doc, @Nullable SiblingProvider siblings) {
        if (doc.isContainer()) {
            openContainerDocument(doc);
        } else {
@@ -334,7 +334,7 @@ public class FilesActivity extends BaseActivity {
    /**
     * Launches an intent to view the specified document.
     */
    private void openDocument(DocumentInfo doc, @Nullable DocumentContext siblings) {
    private void openDocument(DocumentInfo doc, @Nullable SiblingProvider siblings) {
        Intent intent = null;
        if (siblings != null) {
            QuickViewIntentBuilder builder = new QuickViewIntentBuilder(
Loading