Loading src/com/android/launcher3/ButtonDropTarget.java +3 −3 Original line number Diff line number Diff line Loading @@ -178,7 +178,7 @@ public abstract class ButtonDropTarget extends TextView @Override public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { mActive = supportsDrop(dragObject.dragSource, dragObject.dragInfo); mActive = supportsDrop(dragObject.dragInfo); mDrawable.setColorFilter(null); if (mCurrentColorAnim != null) { mCurrentColorAnim.cancel(); Loading @@ -194,10 +194,10 @@ public abstract class ButtonDropTarget extends TextView @Override public final boolean acceptDrop(DragObject dragObject) { return supportsDrop(dragObject.dragSource, dragObject.dragInfo); return supportsDrop(dragObject.dragInfo); } protected abstract boolean supportsDrop(DragSource source, ItemInfo info); protected abstract boolean supportsDrop(ItemInfo info); @Override public boolean isDropEnabled() { Loading src/com/android/launcher3/DeleteDropTarget.java +5 −5 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class DeleteDropTarget extends ButtonDropTarget { @Override public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { super.onDragStart(dragObject, options); setTextBasedOnDragSource(dragObject.dragSource); setTextBasedOnDragSource(dragObject.dragInfo); } /** @return true for items that should have a "Remove" action in accessibility. */ Loading @@ -57,16 +57,16 @@ public class DeleteDropTarget extends ButtonDropTarget { } @Override protected boolean supportsDrop(DragSource source, ItemInfo info) { protected boolean supportsDrop(ItemInfo info) { return true; } /** * Set the drop target's text to either "Remove" or "Cancel" depending on the drag source. * Set the drop target's text to either "Remove" or "Cancel" depending on the drag item. */ public void setTextBasedOnDragSource(DragSource dragSource) { private void setTextBasedOnDragSource(ItemInfo item) { if (!TextUtils.isEmpty(mText)) { mText = getResources().getString(dragSource.supportsDeleteDropTarget() mText = getResources().getString(item.id != ItemInfo.NO_ID ? R.string.remove_drop_target_label : android.R.string.cancel); requestLayout(); Loading src/com/android/launcher3/DragSource.java +0 −16 Original line number Diff line number Diff line Loading @@ -26,22 +26,6 @@ import com.android.launcher3.logging.UserEventDispatcher.LogContainerProvider; */ public interface DragSource extends LogContainerProvider { /** * @return whether items dragged from this source supports 'App Info' */ boolean supportsAppInfoDropTarget(); /** * @return whether items dragged from this source supports 'Delete' drop target (e.g. to remove * a shortcut.) If this returns false, the drop target will say "Cancel" instead of "Remove." */ boolean supportsDeleteDropTarget(); /* * @return the scale of the icons over the workspace icon size */ float getIntrinsicIconScaleFactor(); /** * A callback made back to the source after an item from this source has been dropped on a * DropTarget. Loading src/com/android/launcher3/InfoDropTarget.java +2 −2 Original line number Diff line number Diff line Loading @@ -99,8 +99,8 @@ public class InfoDropTarget extends UninstallDropTarget { } @Override protected boolean supportsDrop(DragSource source, ItemInfo info) { return source.supportsAppInfoDropTarget() && supportsDrop(getContext(), info); protected boolean supportsDrop(ItemInfo info) { return supportsDrop(getContext(), info); } public static boolean supportsDrop(Context context, ItemInfo info) { Loading src/com/android/launcher3/UninstallDropTarget.java +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public class UninstallDropTarget extends ButtonDropTarget { } @Override protected boolean supportsDrop(DragSource source, ItemInfo info) { protected boolean supportsDrop(ItemInfo info) { return supportsDrop(getContext(), info); } Loading Loading
src/com/android/launcher3/ButtonDropTarget.java +3 −3 Original line number Diff line number Diff line Loading @@ -178,7 +178,7 @@ public abstract class ButtonDropTarget extends TextView @Override public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { mActive = supportsDrop(dragObject.dragSource, dragObject.dragInfo); mActive = supportsDrop(dragObject.dragInfo); mDrawable.setColorFilter(null); if (mCurrentColorAnim != null) { mCurrentColorAnim.cancel(); Loading @@ -194,10 +194,10 @@ public abstract class ButtonDropTarget extends TextView @Override public final boolean acceptDrop(DragObject dragObject) { return supportsDrop(dragObject.dragSource, dragObject.dragInfo); return supportsDrop(dragObject.dragInfo); } protected abstract boolean supportsDrop(DragSource source, ItemInfo info); protected abstract boolean supportsDrop(ItemInfo info); @Override public boolean isDropEnabled() { Loading
src/com/android/launcher3/DeleteDropTarget.java +5 −5 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class DeleteDropTarget extends ButtonDropTarget { @Override public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { super.onDragStart(dragObject, options); setTextBasedOnDragSource(dragObject.dragSource); setTextBasedOnDragSource(dragObject.dragInfo); } /** @return true for items that should have a "Remove" action in accessibility. */ Loading @@ -57,16 +57,16 @@ public class DeleteDropTarget extends ButtonDropTarget { } @Override protected boolean supportsDrop(DragSource source, ItemInfo info) { protected boolean supportsDrop(ItemInfo info) { return true; } /** * Set the drop target's text to either "Remove" or "Cancel" depending on the drag source. * Set the drop target's text to either "Remove" or "Cancel" depending on the drag item. */ public void setTextBasedOnDragSource(DragSource dragSource) { private void setTextBasedOnDragSource(ItemInfo item) { if (!TextUtils.isEmpty(mText)) { mText = getResources().getString(dragSource.supportsDeleteDropTarget() mText = getResources().getString(item.id != ItemInfo.NO_ID ? R.string.remove_drop_target_label : android.R.string.cancel); requestLayout(); Loading
src/com/android/launcher3/DragSource.java +0 −16 Original line number Diff line number Diff line Loading @@ -26,22 +26,6 @@ import com.android.launcher3.logging.UserEventDispatcher.LogContainerProvider; */ public interface DragSource extends LogContainerProvider { /** * @return whether items dragged from this source supports 'App Info' */ boolean supportsAppInfoDropTarget(); /** * @return whether items dragged from this source supports 'Delete' drop target (e.g. to remove * a shortcut.) If this returns false, the drop target will say "Cancel" instead of "Remove." */ boolean supportsDeleteDropTarget(); /* * @return the scale of the icons over the workspace icon size */ float getIntrinsicIconScaleFactor(); /** * A callback made back to the source after an item from this source has been dropped on a * DropTarget. Loading
src/com/android/launcher3/InfoDropTarget.java +2 −2 Original line number Diff line number Diff line Loading @@ -99,8 +99,8 @@ public class InfoDropTarget extends UninstallDropTarget { } @Override protected boolean supportsDrop(DragSource source, ItemInfo info) { return source.supportsAppInfoDropTarget() && supportsDrop(getContext(), info); protected boolean supportsDrop(ItemInfo info) { return supportsDrop(getContext(), info); } public static boolean supportsDrop(Context context, ItemInfo info) { Loading
src/com/android/launcher3/UninstallDropTarget.java +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public class UninstallDropTarget extends ButtonDropTarget { } @Override protected boolean supportsDrop(DragSource source, ItemInfo info) { protected boolean supportsDrop(ItemInfo info) { return supportsDrop(getContext(), info); } Loading