Loading src/com/android/documentsui/dirlist/DirectoryDragListener.java +1 −3 Original line number Diff line number Diff line Loading @@ -35,9 +35,7 @@ class DirectoryDragListener extends ItemDragListener<DirectoryFragment> { public boolean onDrag(View v, DragEvent event) { final boolean result = super.onDrag(v, event); if (event.getAction() == DragEvent.ACTION_DRAG_STARTED) { mDragHost.dragStarted(); } else if (event.getAction() == DragEvent.ACTION_DRAG_ENDED) { if (event.getAction() == DragEvent.ACTION_DRAG_ENDED) { // getResult() is true if drag was accepted mDragHost.dragStopped(event.getResult()); } Loading src/com/android/documentsui/dirlist/DirectoryFragment.java +1 −13 Original line number Diff line number Diff line Loading @@ -1002,18 +1002,6 @@ public class DirectoryFragment extends Fragment } } void dragStarted() { // When files are selected for dragging, ActionMode is started. This obscures the breadcrumb // with an ActionBar. In order to make drag and drop to the breadcrumb possible, we first // end ActionMode so the breadcrumb is visible to the user. // // mActionModeController is null when dragStarted() is called on spring loaded // folders/roots. if (mActionModeController != null) { mActionModeController.finishActionMode(); } } void dragStopped(boolean result) { if (result) { mSelectionMgr.clearSelection(); Loading Loading @@ -1119,7 +1107,7 @@ public class DirectoryFragment extends Fragment if (v.getParent() == mRecView) { RecyclerView.ViewHolder vh = mRecView.getChildViewHolder(v); if (vh instanceof DocumentHolder) { ((DocumentHolder) vh).setHighlighted(highlight); ((DocumentHolder) vh).setDroppableHighlight(highlight); } } } Loading src/com/android/documentsui/dirlist/DocumentHolder.java +7 −2 Original line number Diff line number Diff line Loading @@ -106,10 +106,15 @@ public abstract class DocumentHolder } /** * Highlights the associated item view. * Highlights the associated item view to indicate it's droppable. * @param highlighted */ public void setHighlighted(boolean highlighted) { public void setDroppableHighlight(boolean highlighted) { // If item is already selected, its droppable highlight should not be changed. if (itemView.isActivated()) { return; } itemView.setBackgroundColor(highlighted ? mSelectedBgColor : mDefaultBgColor); } Loading Loading
src/com/android/documentsui/dirlist/DirectoryDragListener.java +1 −3 Original line number Diff line number Diff line Loading @@ -35,9 +35,7 @@ class DirectoryDragListener extends ItemDragListener<DirectoryFragment> { public boolean onDrag(View v, DragEvent event) { final boolean result = super.onDrag(v, event); if (event.getAction() == DragEvent.ACTION_DRAG_STARTED) { mDragHost.dragStarted(); } else if (event.getAction() == DragEvent.ACTION_DRAG_ENDED) { if (event.getAction() == DragEvent.ACTION_DRAG_ENDED) { // getResult() is true if drag was accepted mDragHost.dragStopped(event.getResult()); } Loading
src/com/android/documentsui/dirlist/DirectoryFragment.java +1 −13 Original line number Diff line number Diff line Loading @@ -1002,18 +1002,6 @@ public class DirectoryFragment extends Fragment } } void dragStarted() { // When files are selected for dragging, ActionMode is started. This obscures the breadcrumb // with an ActionBar. In order to make drag and drop to the breadcrumb possible, we first // end ActionMode so the breadcrumb is visible to the user. // // mActionModeController is null when dragStarted() is called on spring loaded // folders/roots. if (mActionModeController != null) { mActionModeController.finishActionMode(); } } void dragStopped(boolean result) { if (result) { mSelectionMgr.clearSelection(); Loading Loading @@ -1119,7 +1107,7 @@ public class DirectoryFragment extends Fragment if (v.getParent() == mRecView) { RecyclerView.ViewHolder vh = mRecView.getChildViewHolder(v); if (vh instanceof DocumentHolder) { ((DocumentHolder) vh).setHighlighted(highlight); ((DocumentHolder) vh).setDroppableHighlight(highlight); } } } Loading
src/com/android/documentsui/dirlist/DocumentHolder.java +7 −2 Original line number Diff line number Diff line Loading @@ -106,10 +106,15 @@ public abstract class DocumentHolder } /** * Highlights the associated item view. * Highlights the associated item view to indicate it's droppable. * @param highlighted */ public void setHighlighted(boolean highlighted) { public void setDroppableHighlight(boolean highlighted) { // If item is already selected, its droppable highlight should not be changed. if (itemView.isActivated()) { return; } itemView.setBackgroundColor(highlighted ? mSelectedBgColor : mDefaultBgColor); } Loading