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

Commit 050f98da authored by Garfield, Tan's avatar Garfield, Tan Committed by android-build-merger
Browse files

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

am: 6e685dc3

* commit '6e685dc3':
  DO NOT MERGE: Disable drag n' drop in DocumentsActivity.

Change-Id: I9e4424bfbffc46cd1880241b6961c0f0ca75aab4
parents 9c55bda2 6e685dc3
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) {