1
0
Fork 0

fine-tuned the virtual key swiping thresholds

This commit is contained in:
sspanak 2024-11-30 21:45:05 +02:00 committed by Dimo Karaivanov
parent 2369da045f
commit 8f571a7783
2 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ public class SettingsStore extends SettingsUI {
public final static int RESIZE_THROTTLING_TIME = 60; // ms public final static int RESIZE_THROTTLING_TIME = 60; // ms
public final static byte SLOW_QUERY_TIME = 50; // ms public final static byte SLOW_QUERY_TIME = 50; // ms
public final static int SLOW_QUERY_TIMEOUT = 3000; // 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_DOUBLE_CLICK_DELAY = 500; // ms
public final static int SOFT_KEY_REPEAT_DELAY = 40; // ms public final static int SOFT_KEY_REPEAT_DELAY = 40; // ms
public final static int SOFT_KEY_TITLE_MAX_CHARS = 5; public final static int SOFT_KEY_TITLE_MAX_CHARS = 5;

View file

@ -64,7 +64,7 @@ abstract public class SwipeableKey extends SoftKey {
protected float getHoldDurationThreshold() { return SettingsStore.SOFT_KEY_REPEAT_DELAY * 9; } 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 functionKeyScale = outValue.getFloat();
float keyWidth = tt9.getWidth() / 5f * functionKeyScale; 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) { } catch (Exception e) {
Logger.e(LOG_TAG, "Error calculating the swipe X threshold. Using default to prevent crashing. " + e); Logger.e(LOG_TAG, "Error calculating the swipe X threshold. Using default to prevent crashing. " + e);
return getSwipeYThreshold(); return getSwipeYThreshold();