Merging ub-launcher3-rvc-qpr-dev to rvc-qpr-dev
Bug: 162366734 Test: system image builds Change-Id: I6675431b180976798afacc7a99251ae36764a50a Merged-In: Ibff46b3ef7ff89accb459db323f31179adb4ef21
This commit is contained in:
@@ -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()) {
|
||||
@@ -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();
|
||||
@@ -607,6 +614,9 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
@Override
|
||||
public void setIconVisible(boolean visible) {
|
||||
mIsIconVisible = visible;
|
||||
if (!mIsIconVisible) {
|
||||
resetIconScale();
|
||||
}
|
||||
Drawable icon = visible ? mIcon : new ColorDrawable(Color.TRANSPARENT);
|
||||
applyCompoundDrawables(icon);
|
||||
}
|
||||
@@ -746,11 +756,14 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
|
||||
@Override
|
||||
public SafeCloseable prepareDrawDragView() {
|
||||
if (getIcon() instanceof FastBitmapDrawable) {
|
||||
FastBitmapDrawable icon = (FastBitmapDrawable) getIcon();
|
||||
icon.setScale(1f);
|
||||
}
|
||||
resetIconScale();
|
||||
setForceHideDot(true);
|
||||
return () -> { };
|
||||
}
|
||||
|
||||
private void resetIconScale() {
|
||||
if (mIcon instanceof FastBitmapDrawable) {
|
||||
((FastBitmapDrawable) mIcon).setScale(1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user