* commit '9c6e7e233ee2a6379f6b784c23bfba58861aae3d': Stop vibration while repeating delete key in emoji view
This commit is contained in:
commit
33587f919e
1 changed files with 6 additions and 4 deletions
|
@ -718,12 +718,14 @@ public final class EmojiKeyboardView extends LinearLayout implements OnTabChange
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
int repeatCount = 1;
|
||||||
int timeCount = 0;
|
int timeCount = 0;
|
||||||
while (timeCount < MAX_REPEAT_COUNT_TIME && !mAborted) {
|
while (timeCount < MAX_REPEAT_COUNT_TIME && !mAborted) {
|
||||||
if (timeCount > mKeyRepeatStartTimeout) {
|
if (timeCount > mKeyRepeatStartTimeout) {
|
||||||
pressDelete();
|
pressDelete(repeatCount);
|
||||||
}
|
}
|
||||||
timeCount += mKeyRepeatInterval;
|
timeCount += mKeyRepeatInterval;
|
||||||
|
++repeatCount;
|
||||||
try {
|
try {
|
||||||
Thread.sleep(mKeyRepeatInterval);
|
Thread.sleep(mKeyRepeatInterval);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
@ -736,9 +738,9 @@ public final class EmojiKeyboardView extends LinearLayout implements OnTabChange
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pressDelete() {
|
public void pressDelete(int repeatCount) {
|
||||||
mKeyboardActionListener.onPressKey(
|
mKeyboardActionListener.onPressKey(
|
||||||
Constants.CODE_DELETE, 0 /* repeatCount */, true /* isSinglePointer */);
|
Constants.CODE_DELETE, repeatCount, true /* isSinglePointer */);
|
||||||
mKeyboardActionListener.onCodeInput(
|
mKeyboardActionListener.onCodeInput(
|
||||||
Constants.CODE_DELETE, NOT_A_COORDINATE, NOT_A_COORDINATE);
|
Constants.CODE_DELETE, NOT_A_COORDINATE, NOT_A_COORDINATE);
|
||||||
mKeyboardActionListener.onReleaseKey(
|
mKeyboardActionListener.onReleaseKey(
|
||||||
|
@ -754,7 +756,7 @@ public final class EmojiKeyboardView extends LinearLayout implements OnTabChange
|
||||||
switch(event.getAction()) {
|
switch(event.getAction()) {
|
||||||
case MotionEvent.ACTION_DOWN:
|
case MotionEvent.ACTION_DOWN:
|
||||||
v.setBackgroundColor(mDeleteKeyPressedBackgroundColor);
|
v.setBackgroundColor(mDeleteKeyPressedBackgroundColor);
|
||||||
pressDelete();
|
pressDelete(0 /* repeatCount */);
|
||||||
startRepeat();
|
startRepeat();
|
||||||
return true;
|
return true;
|
||||||
case MotionEvent.ACTION_UP:
|
case MotionEvent.ACTION_UP:
|
||||||
|
|
Loading…
Reference in a new issue