Add "Show key borders" preference

This commit is contained in:
Naveen 2023-01-30 17:54:20 +05:30
parent 05fe9debc3
commit 9748e8ac5f
4 changed files with 29 additions and 0 deletions

View File

@ -40,6 +40,7 @@ class SettingsActivity : SimpleActivity() {
setupManageClipboardItems()
setupVibrateOnKeypress()
setupShowPopupOnKeypress()
setupShowKeyBorders()
setupKeyboardLanguage()
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() {
settings_keyboard_language.text = getKeyboardLanguageText(config.keyboardLanguage)
settings_keyboard_language_holder.setOnClickListener {

View File

@ -17,6 +17,10 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getBoolean(SHOW_POPUP_ON_KEYPRESS, true)
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
get() = prefs.getString(LAST_EXPORTED_CLIPS_FOLDER, "")!!
set(lastExportedClipsFolder) = prefs.edit().putString(LAST_EXPORTED_CLIPS_FOLDER, lastExportedClipsFolder).apply()

View File

@ -10,6 +10,7 @@ const val MAX_KEYS_PER_MINI_ROW = 9
// shared prefs
const val VIBRATE_ON_KEYPRESS = "vibrate_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 KEYBOARD_LANGUAGE = "keyboard_language"
const val HEIGHT_MULTIPLIER = "height_multiplier"

View File

@ -161,6 +161,21 @@
</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
android:id="@+id/settings_keyboard_language_holder"
style="@style/SettingsHolderTextViewStyle"