mirror of
				https://github.com/SimpleMobileTools/Simple-Keyboard.git
				synced 2025-06-05 21:49:26 +02:00 
			
		
		
		
	Add "Show key borders" preference
This commit is contained in:
		| @@ -40,6 +40,7 @@ class SettingsActivity : SimpleActivity() { | |||||||
|         setupManageClipboardItems() |         setupManageClipboardItems() | ||||||
|         setupVibrateOnKeypress() |         setupVibrateOnKeypress() | ||||||
|         setupShowPopupOnKeypress() |         setupShowPopupOnKeypress() | ||||||
|  |         setupShowKeyBorders() | ||||||
|         setupKeyboardLanguage() |         setupKeyboardLanguage() | ||||||
|         setupKeyboardHeightMultiplier() |         setupKeyboardHeightMultiplier() | ||||||
|  |  | ||||||
| @@ -106,6 +107,14 @@ class SettingsActivity : SimpleActivity() { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     private fun setupShowKeyBorders() { | ||||||
|  |         settings_show_key_borders.isChecked = config.showKeyBorders | ||||||
|  |         settings_show_key_borders_holder.setOnClickListener { | ||||||
|  |             settings_show_key_borders.toggle() | ||||||
|  |             config.showKeyBorders = settings_show_key_borders.isChecked | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|     private fun setupKeyboardLanguage() { |     private fun setupKeyboardLanguage() { | ||||||
|         settings_keyboard_language.text = getKeyboardLanguageText(config.keyboardLanguage) |         settings_keyboard_language.text = getKeyboardLanguageText(config.keyboardLanguage) | ||||||
|         settings_keyboard_language_holder.setOnClickListener { |         settings_keyboard_language_holder.setOnClickListener { | ||||||
|   | |||||||
| @@ -17,6 +17,10 @@ class Config(context: Context) : BaseConfig(context) { | |||||||
|         get() = prefs.getBoolean(SHOW_POPUP_ON_KEYPRESS, true) |         get() = prefs.getBoolean(SHOW_POPUP_ON_KEYPRESS, true) | ||||||
|         set(showPopupOnKeypress) = prefs.edit().putBoolean(SHOW_POPUP_ON_KEYPRESS, showPopupOnKeypress).apply() |         set(showPopupOnKeypress) = prefs.edit().putBoolean(SHOW_POPUP_ON_KEYPRESS, showPopupOnKeypress).apply() | ||||||
|  |  | ||||||
|  |     var showKeyBorders: Boolean | ||||||
|  |         get() = prefs.getBoolean(SHOW_KEY_BORDERS, false) | ||||||
|  |         set(showKeyBorders) = prefs.edit().putBoolean(SHOW_KEY_BORDERS, showKeyBorders).apply() | ||||||
|  |  | ||||||
|     var lastExportedClipsFolder: String |     var lastExportedClipsFolder: String | ||||||
|         get() = prefs.getString(LAST_EXPORTED_CLIPS_FOLDER, "")!! |         get() = prefs.getString(LAST_EXPORTED_CLIPS_FOLDER, "")!! | ||||||
|         set(lastExportedClipsFolder) = prefs.edit().putString(LAST_EXPORTED_CLIPS_FOLDER, lastExportedClipsFolder).apply() |         set(lastExportedClipsFolder) = prefs.edit().putString(LAST_EXPORTED_CLIPS_FOLDER, lastExportedClipsFolder).apply() | ||||||
|   | |||||||
| @@ -10,6 +10,7 @@ const val MAX_KEYS_PER_MINI_ROW = 9 | |||||||
| // shared prefs | // shared prefs | ||||||
| const val VIBRATE_ON_KEYPRESS = "vibrate_on_keypress" | const val VIBRATE_ON_KEYPRESS = "vibrate_on_keypress" | ||||||
| const val SHOW_POPUP_ON_KEYPRESS = "show_popup_on_keypress" | const val SHOW_POPUP_ON_KEYPRESS = "show_popup_on_keypress" | ||||||
|  | const val SHOW_KEY_BORDERS = "show_key_borders" | ||||||
| const val LAST_EXPORTED_CLIPS_FOLDER = "last_exported_clips_folder" | const val LAST_EXPORTED_CLIPS_FOLDER = "last_exported_clips_folder" | ||||||
| const val KEYBOARD_LANGUAGE = "keyboard_language" | const val KEYBOARD_LANGUAGE = "keyboard_language" | ||||||
| const val HEIGHT_MULTIPLIER = "height_multiplier" | const val HEIGHT_MULTIPLIER = "height_multiplier" | ||||||
|   | |||||||
| @@ -161,6 +161,21 @@ | |||||||
|  |  | ||||||
|             </RelativeLayout> |             </RelativeLayout> | ||||||
|  |  | ||||||
|  |             <RelativeLayout | ||||||
|  |                 android:id="@+id/settings_show_key_borders_holder" | ||||||
|  |                 style="@style/SettingsHolderCheckboxStyle" | ||||||
|  |                 android:layout_width="match_parent" | ||||||
|  |                 android:layout_height="wrap_content"> | ||||||
|  |  | ||||||
|  |                 <com.simplemobiletools.commons.views.MyAppCompatCheckbox | ||||||
|  |                     android:id="@+id/settings_show_key_borders" | ||||||
|  |                     style="@style/SettingsCheckboxStyle" | ||||||
|  |                     android:layout_width="match_parent" | ||||||
|  |                     android:layout_height="wrap_content" | ||||||
|  |                     android:text="@string/show_key_borders" /> | ||||||
|  |  | ||||||
|  |             </RelativeLayout> | ||||||
|  |  | ||||||
|             <RelativeLayout |             <RelativeLayout | ||||||
|                 android:id="@+id/settings_keyboard_language_holder" |                 android:id="@+id/settings_keyboard_language_holder" | ||||||
|                 style="@style/SettingsHolderTextViewStyle" |                 style="@style/SettingsHolderTextViewStyle" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user