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

Commit 63aed6ad authored by Garfield, Tan's avatar Garfield, Tan
Browse files

DO NOT MERGE: Disable drag n' drop in DocumentsActivity.

Bug: 28318396
Change-Id: If27bc093b873af5395f69d9139d3fd96e50c0a7b
parent 4c6cd2b8
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) {