Skip to content

Commit 9748e8a

Browse files
committed
Add "Show key borders" preference
1 parent 05fe9de commit 9748e8a

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

app/src/main/kotlin/com/simplemobiletools/keyboard/activities/SettingsActivity.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class SettingsActivity : SimpleActivity() {
4040
setupManageClipboardItems()
4141
setupVibrateOnKeypress()
4242
setupShowPopupOnKeypress()
43+
setupShowKeyBorders()
4344
setupKeyboardLanguage()
4445
setupKeyboardHeightMultiplier()
4546

@@ -106,6 +107,14 @@ class SettingsActivity : SimpleActivity() {
106107
}
107108
}
108109

110+
private fun setupShowKeyBorders() {
111+
settings_show_key_borders.isChecked = config.showKeyBorders
112+
settings_show_key_borders_holder.setOnClickListener {
113+
settings_show_key_borders.toggle()
114+
config.showKeyBorders = settings_show_key_borders.isChecked
115+
}
116+
}
117+
109118
private fun setupKeyboardLanguage() {
110119
settings_keyboard_language.text = getKeyboardLanguageText(config.keyboardLanguage)
111120
settings_keyboard_language_holder.setOnClickListener {

app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Config.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ class Config(context: Context) : BaseConfig(context) {
1717
get() = prefs.getBoolean(SHOW_POPUP_ON_KEYPRESS, true)
1818
set(showPopupOnKeypress) = prefs.edit().putBoolean(SHOW_POPUP_ON_KEYPRESS, showPopupOnKeypress).apply()
1919

20+
var showKeyBorders: Boolean
21+
get() = prefs.getBoolean(SHOW_KEY_BORDERS, false)
22+
set(showKeyBorders) = prefs.edit().putBoolean(SHOW_KEY_BORDERS, showKeyBorders).apply()
23+
2024
var lastExportedClipsFolder: String
2125
get() = prefs.getString(LAST_EXPORTED_CLIPS_FOLDER, "")!!
2226
set(lastExportedClipsFolder) = prefs.edit().putString(LAST_EXPORTED_CLIPS_FOLDER, lastExportedClipsFolder).apply()

app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const val MAX_KEYS_PER_MINI_ROW = 9
1010
// shared prefs
1111
const val VIBRATE_ON_KEYPRESS = "vibrate_on_keypress"
1212
const val SHOW_POPUP_ON_KEYPRESS = "show_popup_on_keypress"
13+
const val SHOW_KEY_BORDERS = "show_key_borders"
1314
const val LAST_EXPORTED_CLIPS_FOLDER = "last_exported_clips_folder"
1415
const val KEYBOARD_LANGUAGE = "keyboard_language"
1516
const val HEIGHT_MULTIPLIER = "height_multiplier"

app/src/main/res/layout/activity_settings.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,21 @@
161161

162162
</RelativeLayout>
163163

164+
<RelativeLayout
165+
android:id="@+id/settings_show_key_borders_holder"
166+
style="@style/SettingsHolderCheckboxStyle"
167+
android:layout_width="match_parent"
168+
android:layout_height="wrap_content">
169+
170+
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
171+
android:id="@+id/settings_show_key_borders"
172+
style="@style/SettingsCheckboxStyle"
173+
android:layout_width="match_parent"
174+
android:layout_height="wrap_content"
175+
android:text="@string/show_key_borders" />
176+
177+
</RelativeLayout>
178+
164179
<RelativeLayout
165180
android:id="@+id/settings_keyboard_language_holder"
166181
style="@style/SettingsHolderTextViewStyle"

0 commit comments

Comments
 (0)