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

Commit 6e685dc3 authored by Garfield Tan's avatar Garfield Tan Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE: Disable drag n' drop in DocumentsActivity." into nyc-dev

parents 1a83df8b 360a1964
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1174,9 +1174,11 @@ public class DirectoryFragment extends Fragment
            view.setOnDragListener(mOnDragListener);
        }

        if (mTuner.allowDragNDrop()) {
            // Make all items draggable.
            view.setOnLongClickListener(onLongClickListener);
        }
    }

    private View.OnDragListener mOnDragListener = new View.OnDragListener() {
        @Override
+15 −0
Original line number Diff line number Diff line
@@ -81,6 +81,11 @@ public abstract class FragmentTuner {
     */
    abstract boolean enableManagedMode();

    /**
     * Whether drag n' drop is allowed in this context
     */
    abstract boolean allowDragNDrop();

    /**
     * Provides support for Platform specific specializations of DirectoryFragment.
     */
@@ -191,6 +196,11 @@ public abstract class FragmentTuner {
        public boolean enableManagedMode() {
            return false;
        }

        @Override
        public boolean allowDragNDrop() {
            return false;
        }
    }

    /**
@@ -255,6 +265,11 @@ public abstract class FragmentTuner {
                    && mState.stack.root.isDownloads()
                    && mState.stack.size() == 1;
        }

        @Override
        public boolean allowDragNDrop() {
            return true;
        }
    }

    private static boolean isDirectory(String mimeType) {