mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Lowering long press time for workspace items.
Change-Id: I6a3b0e13681f07d0e50bf2dcec777037c4ef51a5
This commit is contained in:
@@ -65,6 +65,7 @@ public class BubbleTextView extends TextView {
|
||||
private Drawable mBackground;
|
||||
|
||||
private boolean mStayPressed;
|
||||
private CheckLongPressHelper mLongPressHelper;
|
||||
|
||||
public BubbleTextView(Context context) {
|
||||
super(context);
|
||||
@@ -82,6 +83,7 @@ public class BubbleTextView extends TextView {
|
||||
}
|
||||
|
||||
private void init() {
|
||||
mLongPressHelper = new CheckLongPressHelper(this);
|
||||
mBackground = getBackground();
|
||||
|
||||
final Resources res = getContext().getResources();
|
||||
@@ -222,6 +224,8 @@ public class BubbleTextView extends TextView {
|
||||
} else {
|
||||
mDidInvalidateForPressedState = false;
|
||||
}
|
||||
|
||||
mLongPressHelper.postCheckForLongPress();
|
||||
break;
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
case MotionEvent.ACTION_UP:
|
||||
@@ -230,6 +234,8 @@ public class BubbleTextView extends TextView {
|
||||
if (!isPressed()) {
|
||||
mPressedOrFocusedBackground = null;
|
||||
}
|
||||
|
||||
mLongPressHelper.cancelLongPress();
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
@@ -318,4 +324,11 @@ public class BubbleTextView extends TextView {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelLongPress() {
|
||||
super.cancelLongPress();
|
||||
|
||||
mLongPressHelper.cancelLongPress();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user