Loading src/com/android/launcher3/BubbleTextView.java +11 −4 Original line number Diff line number Diff line Loading @@ -331,10 +331,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, public boolean onTouchEvent(MotionEvent event) { // ignore events if they happen in padding area if (event.getAction() == MotionEvent.ACTION_DOWN && (event.getY() < getPaddingTop() || event.getX() < getPaddingLeft() || event.getY() > getHeight() - getPaddingBottom() || event.getX() > getWidth() - getPaddingRight())) { && shouldIgnoreTouchDown(event.getX(), event.getY())) { return false; } if (isLongClickable()) { Loading @@ -347,6 +344,16 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, } } /** * Returns true if the touch down at the provided position be ignored */ protected boolean shouldIgnoreTouchDown(float x, float y) { return y < getPaddingTop() || x < getPaddingLeft() || y > getHeight() - getPaddingBottom() || x > getWidth() - getPaddingRight(); } void setStayPressed(boolean stayPressed) { mStayPressed = stayPressed; refreshDrawableState(); Loading src/com/android/launcher3/shortcuts/DeepShortcutTextView.java +6 −7 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.text.TextUtils; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.Toast; import com.android.launcher3.BubbleTextView; Loading Loading @@ -106,12 +105,12 @@ public class DeepShortcutTextView extends BubbleTextView { } @Override public boolean onTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { protected boolean shouldIgnoreTouchDown(float x, float y) { // Show toast if user touches the drag handle (long clicks still start the drag). mShowInstructionToast = mDragHandleBounds.contains((int) ev.getX(), (int) ev.getY()); } return super.onTouchEvent(ev); mShowInstructionToast = mDragHandleBounds.contains((int) x, (int) y); // assume the whole view as clickable return false; } @Override Loading Loading
src/com/android/launcher3/BubbleTextView.java +11 −4 Original line number Diff line number Diff line Loading @@ -331,10 +331,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, public boolean onTouchEvent(MotionEvent event) { // ignore events if they happen in padding area if (event.getAction() == MotionEvent.ACTION_DOWN && (event.getY() < getPaddingTop() || event.getX() < getPaddingLeft() || event.getY() > getHeight() - getPaddingBottom() || event.getX() > getWidth() - getPaddingRight())) { && shouldIgnoreTouchDown(event.getX(), event.getY())) { return false; } if (isLongClickable()) { Loading @@ -347,6 +344,16 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, } } /** * Returns true if the touch down at the provided position be ignored */ protected boolean shouldIgnoreTouchDown(float x, float y) { return y < getPaddingTop() || x < getPaddingLeft() || y > getHeight() - getPaddingBottom() || x > getWidth() - getPaddingRight(); } void setStayPressed(boolean stayPressed) { mStayPressed = stayPressed; refreshDrawableState(); Loading
src/com/android/launcher3/shortcuts/DeepShortcutTextView.java +6 −7 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.text.TextUtils; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.Toast; import com.android.launcher3.BubbleTextView; Loading Loading @@ -106,12 +105,12 @@ public class DeepShortcutTextView extends BubbleTextView { } @Override public boolean onTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { protected boolean shouldIgnoreTouchDown(float x, float y) { // Show toast if user touches the drag handle (long clicks still start the drag). mShowInstructionToast = mDragHandleBounds.contains((int) ev.getX(), (int) ev.getY()); } return super.onTouchEvent(ev); mShowInstructionToast = mDragHandleBounds.contains((int) x, (int) y); // assume the whole view as clickable return false; } @Override Loading