Merge "DO NOT MERGE: Disable drag n' drop in DocumentsActivity." into nyc-dev
This commit is contained in:
@@ -1174,8 +1174,10 @@ public class DirectoryFragment extends Fragment
|
||||
view.setOnDragListener(mOnDragListener);
|
||||
}
|
||||
|
||||
// Make all items draggable.
|
||||
view.setOnLongClickListener(onLongClickListener);
|
||||
if (mTuner.allowDragNDrop()) {
|
||||
// Make all items draggable.
|
||||
view.setOnLongClickListener(onLongClickListener);
|
||||
}
|
||||
}
|
||||
|
||||
private View.OnDragListener mOnDragListener = new View.OnDragListener() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user