Added 'Cancel' drop target from all apps and widget picker.

- Reuse DeleteDropTarget since it's the same effect, but with "Cancel"
  instead of "Remove" if supportsDeleteDropTarget() returns false.
- Rename related strings (but not their values)

Bug: 24104015
Bug: 24099531
Change-Id: Ia9fbcaa17bb17f7aa31df1f830298da01544c178
This commit is contained in:
Tony Wickham
2015-10-01 13:04:22 -07:00
parent b99d74bb05
commit 9aae47f8a6
12 changed files with 46 additions and 30 deletions

View File

@@ -65,6 +65,8 @@ public abstract class ButtonDropTarget extends TextView
protected ColorStateList mOriginalTextColor;
protected Drawable mDrawable;
protected DeviceProfile mDeviceProfile;
private AnimatorSet mCurrentColorAnim;
@Thunk ColorMatrix mSrcFilter, mDstFilter, mCurrentFilter;
@@ -84,8 +86,8 @@ public abstract class ButtonDropTarget extends TextView
mOriginalTextColor = getTextColors();
// Remove the text in the Phone UI in landscape
DeviceProfile grid = ((Launcher) getContext()).getDeviceProfile();
if (grid.isVerticalBarLayout()) {
mDeviceProfile = ((Launcher) getContext()).getDeviceProfile();
if (mDeviceProfile.isVerticalBarLayout()) {
setText("");
}
}
@@ -193,7 +195,7 @@ public abstract class ButtonDropTarget extends TextView
}
@Override
public final void onDragStart(DragSource source, ItemInfo info, int dragAction) {
public void onDragStart(DragSource source, ItemInfo info, int dragAction) {
mActive = supportsDrop(source, info);
mDrawable.setColorFilter(null);
if (mCurrentColorAnim != null) {