fine-tuned the virtual key swiping thresholds
This commit is contained in:
parent
2369da045f
commit
8f571a7783
2 changed files with 3 additions and 3 deletions
|
|
@ -21,7 +21,7 @@ public class SettingsStore extends SettingsUI {
|
|||
public final static int RESIZE_THROTTLING_TIME = 60; // ms
|
||||
public final static byte SLOW_QUERY_TIME = 50; // ms
|
||||
public final static int SLOW_QUERY_TIMEOUT = 3000; // ms
|
||||
public final static float SOFT_KEY_AMOUNT_OF_KEY_WIDTH_FOR_SWIPE = 0.75f; // amount of key width
|
||||
public final static float SOFT_KEY_AMOUNT_OF_KEY_SIZE_FOR_SWIPE = 0.5f; // 1 = full key size
|
||||
public final static int SOFT_KEY_DOUBLE_CLICK_DELAY = 500; // ms
|
||||
public final static int SOFT_KEY_REPEAT_DELAY = 40; // ms
|
||||
public final static int SOFT_KEY_TITLE_MAX_CHARS = 5;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ abstract public class SwipeableKey extends SoftKey {
|
|||
|
||||
|
||||
protected float getHoldDurationThreshold() { return SettingsStore.SOFT_KEY_REPEAT_DELAY * 9; }
|
||||
protected float getSwipeYThreshold() { return getResources().getDimensionPixelSize(R.dimen.numpad_key_height) / 10.0f; }
|
||||
protected float getSwipeYThreshold() { return getResources().getDimensionPixelSize(R.dimen.numpad_key_height) * SettingsStore.SOFT_KEY_AMOUNT_OF_KEY_SIZE_FOR_SWIPE; }
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -84,7 +84,7 @@ abstract public class SwipeableKey extends SoftKey {
|
|||
float functionKeyScale = outValue.getFloat();
|
||||
|
||||
float keyWidth = tt9.getWidth() / 5f * functionKeyScale;
|
||||
return keyWidth * SettingsStore.SOFT_KEY_AMOUNT_OF_KEY_WIDTH_FOR_SWIPE;
|
||||
return keyWidth * SettingsStore.SOFT_KEY_AMOUNT_OF_KEY_SIZE_FOR_SWIPE;
|
||||
} catch (Exception e) {
|
||||
Logger.e(LOG_TAG, "Error calculating the swipe X threshold. Using default to prevent crashing. " + e);
|
||||
return getSwipeYThreshold();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue