Lowering long press time for workspace items.

Change-Id: I6a3b0e13681f07d0e50bf2dcec777037c4ef51a5
This commit is contained in:
Winson Chung
2012-02-23 15:23:44 -08:00
parent 72d598400d
commit 88f334571f
5 changed files with 121 additions and 41 deletions

View File

@@ -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();
}
}