Skip to content

Commit 07142bf

Browse files
committed
fix: correct defaults and resetAllSettings() for v1.2.5
- Change SHORT_GESTURE_MIN_DISTANCE: 37 → 28% - Change KEYBOARD_HEIGHT_PORTRAIT: 28 → 30% - Change KEYBOARD_HEIGHT_LANDSCAPE: 50 → 40% - Change MARGIN_BOTTOM_PORTRAIT: 2 → 0% - Change MARGIN_BOTTOM_LANDSCAPE: 2 → 0% Fix resetAllSettings() to: - Use Defaults constants instead of hardcoded values - Apply BALANCED neural profile (beam_width=6, etc.) - Set correct theme (cleverkeysdark) - Set all margin, haptic, and input behavior defaults — Opus 4.5
1 parent f353c12 commit 07142bf

2 files changed

Lines changed: 87 additions & 24 deletions

File tree

src/main/kotlin/tribixbite/cleverkeys/Config.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import tribixbite.cleverkeys.prefs.LayoutsPreference
1717
object Defaults {
1818
// Appearance
1919
const val THEME = "cleverkeysdark"
20-
const val KEYBOARD_HEIGHT_PORTRAIT = 28
21-
const val KEYBOARD_HEIGHT_LANDSCAPE = 50
20+
const val KEYBOARD_HEIGHT_PORTRAIT = 30
21+
const val KEYBOARD_HEIGHT_LANDSCAPE = 40
2222
const val LABEL_BRIGHTNESS = 100
2323
const val KEYBOARD_OPACITY = 81
2424
const val KEY_OPACITY = 100
@@ -38,8 +38,8 @@ object Defaults {
3838

3939
// Margin settings (percentages of screen dimension)
4040
// Bottom margin as % of screen height
41-
const val MARGIN_BOTTOM_PORTRAIT = 2 // ~2% of screen height
42-
const val MARGIN_BOTTOM_LANDSCAPE = 2 // ~2% of screen height
41+
const val MARGIN_BOTTOM_PORTRAIT = 0 // No bottom margin
42+
const val MARGIN_BOTTOM_LANDSCAPE = 0 // No bottom margin
4343
// Left/Right margins as % of screen width
4444
const val MARGIN_LEFT_PORTRAIT = 1 // ~1% of screen width
4545
const val MARGIN_LEFT_LANDSCAPE = 5 // ~5% of screen width
@@ -90,7 +90,7 @@ object Defaults {
9090

9191
// Short gestures
9292
const val SHORT_GESTURES_ENABLED = true
93-
const val SHORT_GESTURE_MIN_DISTANCE = 37
93+
const val SHORT_GESTURE_MIN_DISTANCE = 28
9494
const val SHORT_GESTURE_MAX_DISTANCE = 141
9595

9696
// Selection-delete mode (backspace swipe+hold)

src/main/kotlin/tribixbite/cleverkeys/SettingsActivity.kt

Lines changed: 82 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4579,28 +4579,91 @@ class SettingsActivity : ComponentActivity(), SharedPreferences.OnSharedPreferen
45794579
.setTitle(getString(R.string.settings_reset_dialog_title))
45804580
.setMessage(getString(R.string.settings_reset_dialog_message))
45814581
.setPositiveButton(getString(R.string.settings_reset_dialog_confirm)) { _, _ ->
4582-
// Reset all settings to safe defaults
4582+
// Reset all settings using Defaults constants
45834583
val editor = prefs.edit()
45844584
editor.clear()
45854585

4586-
// Set essential defaults to prevent crashes
4587-
editor.putInt("neural_beam_width", 8)
4588-
editor.putInt("neural_max_length", 35)
4589-
editor.putFloat("neural_confidence_threshold", 0.1f)
4590-
editor.putString("theme", "jewel") // Default theme
4591-
editor.putInt("keyboard_height", 35)
4592-
editor.putBoolean("vibration_enabled", false)
4593-
editor.putBoolean("debug_enabled", false)
4594-
editor.putBoolean("clipboard_history_enabled", true)
4595-
editor.putBoolean("autocapitalisation", true)
4596-
editor.putBoolean("sticky_keys_enabled", false)
4597-
editor.putInt("sticky_keys_timeout_ms", 5000)
4598-
editor.putBoolean("voice_guidance_enabled", false)
4599-
// Swipe corrections defaults
4600-
editor.putBoolean("swipe_beam_autocorrect_enabled", true)
4601-
editor.putBoolean("swipe_final_autocorrect_enabled", true)
4602-
editor.putString("swipe_correction_preset", "balanced")
4603-
editor.putString("swipe_fuzzy_match_mode", "edit_distance")
4586+
// Appearance - use Defaults constants
4587+
editor.putString("theme", Defaults.THEME)
4588+
editor.putInt("keyboard_height", Defaults.KEYBOARD_HEIGHT_PORTRAIT)
4589+
editor.putInt("keyboard_height_landscape", Defaults.KEYBOARD_HEIGHT_LANDSCAPE)
4590+
editor.putInt("label_brightness", Defaults.LABEL_BRIGHTNESS)
4591+
editor.putInt("keyboard_opacity", Defaults.KEYBOARD_OPACITY)
4592+
editor.putInt("key_opacity", Defaults.KEY_OPACITY)
4593+
editor.putFloat("character_size", Defaults.CHARACTER_SIZE)
4594+
4595+
// Margins - use Defaults constants (0% bottom, 1% sides)
4596+
editor.putInt("margin_bottom_portrait", Defaults.MARGIN_BOTTOM_PORTRAIT)
4597+
editor.putInt("margin_bottom_landscape", Defaults.MARGIN_BOTTOM_LANDSCAPE)
4598+
editor.putInt("margin_left_portrait", Defaults.MARGIN_LEFT_PORTRAIT)
4599+
editor.putInt("margin_left_landscape", Defaults.MARGIN_LEFT_LANDSCAPE)
4600+
editor.putInt("margin_right_portrait", Defaults.MARGIN_RIGHT_PORTRAIT)
4601+
editor.putInt("margin_right_landscape", Defaults.MARGIN_RIGHT_LANDSCAPE)
4602+
4603+
// Short gesture settings - use Defaults constants
4604+
editor.putBoolean("short_gestures_enabled", Defaults.SHORT_GESTURES_ENABLED)
4605+
editor.putInt("short_gesture_min_distance", Defaults.SHORT_GESTURE_MIN_DISTANCE)
4606+
editor.putInt("short_gesture_max_distance", Defaults.SHORT_GESTURE_MAX_DISTANCE)
4607+
4608+
// Neural prediction - BALANCED profile (using Defaults constants)
4609+
editor.putInt("neural_beam_width", Defaults.NEURAL_BEAM_WIDTH)
4610+
editor.putInt("neural_max_length", Defaults.NEURAL_MAX_LENGTH)
4611+
editor.putFloat("neural_confidence_threshold", Defaults.NEURAL_CONFIDENCE_THRESHOLD)
4612+
editor.putFloat("neural_beam_alpha", Defaults.NEURAL_BEAM_ALPHA)
4613+
editor.putFloat("neural_beam_prune_confidence", Defaults.NEURAL_BEAM_PRUNE_CONFIDENCE)
4614+
editor.putFloat("neural_beam_score_gap", Defaults.NEURAL_BEAM_SCORE_GAP)
4615+
editor.putInt("neural_adaptive_width_step", Defaults.NEURAL_ADAPTIVE_WIDTH_STEP)
4616+
editor.putInt("neural_score_gap_step", Defaults.NEURAL_SCORE_GAP_STEP)
4617+
editor.putFloat("neural_temperature", Defaults.NEURAL_TEMPERATURE)
4618+
editor.putFloat("neural_frequency_weight", Defaults.NEURAL_FREQUENCY_WEIGHT)
4619+
editor.putInt("swipe_smoothing_window", Defaults.SWIPE_SMOOTHING_WINDOW)
4620+
4621+
// Input behavior
4622+
editor.putBoolean("vibrate_custom", Defaults.VIBRATE_CUSTOM)
4623+
editor.putInt("vibrate_duration", Defaults.VIBRATE_DURATION)
4624+
editor.putInt("longpress_timeout", Defaults.LONGPRESS_TIMEOUT)
4625+
editor.putBoolean("keyrepeat_enabled", Defaults.KEYREPEAT_ENABLED)
4626+
editor.putBoolean("autocapitalisation", Defaults.AUTOCAPITALISATION)
4627+
editor.putBoolean("double_space_to_period", Defaults.DOUBLE_SPACE_TO_PERIOD)
4628+
editor.putBoolean("smart_punctuation", Defaults.SMART_PUNCTUATION)
4629+
editor.putInt("tap_duration_threshold", Defaults.TAP_DURATION_THRESHOLD)
4630+
4631+
// Haptic feedback
4632+
editor.putBoolean("haptic_key_press", Defaults.HAPTIC_KEY_PRESS)
4633+
editor.putBoolean("haptic_prediction_tap", Defaults.HAPTIC_PREDICTION_TAP)
4634+
editor.putBoolean("haptic_trackpoint_activate", Defaults.HAPTIC_TRACKPOINT_ACTIVATE)
4635+
editor.putBoolean("haptic_long_press", Defaults.HAPTIC_LONG_PRESS)
4636+
editor.putBoolean("haptic_swipe_complete", Defaults.HAPTIC_SWIPE_COMPLETE)
4637+
4638+
// Word prediction
4639+
editor.putBoolean("swipe_typing_enabled", Defaults.SWIPE_TYPING_ENABLED)
4640+
editor.putBoolean("word_prediction_enabled", Defaults.WORD_PREDICTION_ENABLED)
4641+
editor.putInt("suggestion_bar_opacity", Defaults.SUGGESTION_BAR_OPACITY)
4642+
editor.putBoolean("context_aware_predictions_enabled", Defaults.CONTEXT_AWARE_PREDICTIONS_ENABLED)
4643+
editor.putBoolean("personalized_learning_enabled", Defaults.PERSONALIZED_LEARNING_ENABLED)
4644+
4645+
// Autocorrect
4646+
editor.putBoolean("autocorrect_enabled", Defaults.AUTOCORRECT_ENABLED)
4647+
editor.putBoolean("swipe_beam_autocorrect_enabled", Defaults.SWIPE_BEAM_AUTOCORRECT_ENABLED)
4648+
editor.putBoolean("swipe_final_autocorrect_enabled", Defaults.SWIPE_FINAL_AUTOCORRECT_ENABLED)
4649+
editor.putString("swipe_fuzzy_match_mode", Defaults.SWIPE_FUZZY_MATCH_MODE)
4650+
4651+
// Swipe trail
4652+
editor.putBoolean("swipe_trail_enabled", Defaults.SWIPE_TRAIL_ENABLED)
4653+
editor.putString("swipe_trail_effect", Defaults.SWIPE_TRAIL_EFFECT)
4654+
4655+
// Clipboard
4656+
editor.putBoolean("clipboard_history_enabled", Defaults.CLIPBOARD_HISTORY_ENABLED)
4657+
editor.putInt("clipboard_pane_height_percent", Defaults.CLIPBOARD_PANE_HEIGHT_PERCENT)
4658+
4659+
// Accessibility
4660+
editor.putBoolean("sticky_keys_enabled", Defaults.STICKY_KEYS_ENABLED)
4661+
editor.putInt("sticky_keys_timeout", Defaults.STICKY_KEYS_TIMEOUT)
4662+
editor.putBoolean("voice_guidance_enabled", Defaults.VOICE_GUIDANCE_ENABLED)
4663+
4664+
// Debug (off by default)
4665+
editor.putBoolean("debug_enabled", Defaults.DEBUG_ENABLED)
4666+
editor.putBoolean("termux_mode_enabled", Defaults.TERMUX_MODE_ENABLED)
46044667

46054668
editor.apply()
46064669

0 commit comments

Comments
 (0)