Skip to content

Commit a394429

Browse files
feat: added setting to show number row
1 parent 87b3de8 commit a394429

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class SettingsActivity : SimpleActivity() {
4444
setupKeyboardLanguage()
4545
setupKeyboardHeightMultiplier()
4646
setupShowClipboardContent()
47+
setupShowNumbersRow()
4748

4849
updateTextColors(settings_nested_scrollview)
4950

@@ -159,4 +160,11 @@ class SettingsActivity : SimpleActivity() {
159160
config.showClipboardContent = settings_show_clipboard_content.isChecked
160161
}
161162
}
163+
private fun setupShowNumbersRow() {
164+
settings_show_numbers_row.isChecked = config.showNumbersRow
165+
settings_show_numbers_row_holder.setOnClickListener {
166+
settings_show_numbers_row.toggle()
167+
config.showNumbersRow = settings_show_numbers_row.isChecked
168+
}
169+
}
162170
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class Config(context: Context) : BaseConfig(context) {
3737
get() = prefs.getBoolean(SHOW_CLIPBOARD_CONTENT, true)
3838
set(showClipboardContent) = prefs.edit().putBoolean(SHOW_CLIPBOARD_CONTENT, showClipboardContent).apply()
3939

40+
var showNumbersRow: Boolean
41+
get() = prefs.getBoolean(SHOW_NUMBERS_ROW, false)
42+
set(showNumbersRow) = prefs.edit().putBoolean(SHOW_NUMBERS_ROW, showNumbersRow).apply()
4043

4144
private fun getDefaultLanguage(): Int {
4245
val conf = context.resources.configuration

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const val LAST_EXPORTED_CLIPS_FOLDER = "last_exported_clips_folder"
1515
const val KEYBOARD_LANGUAGE = "keyboard_language"
1616
const val HEIGHT_MULTIPLIER = "height_multiplier"
1717
const val SHOW_CLIPBOARD_CONTENT = "show_clipboard_content"
18+
const val SHOW_NUMBERS_ROW = "show_numbers_row"
1819

1920
// differentiate current and pinned clips at the keyboards' Clipboard section
2021
const val ITEM_SECTION_LABEL = 0

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,20 @@
189189
android:layout_height="wrap_content"
190190
android:text="@string/show_clipboard_content" />
191191

192+
</RelativeLayout>
193+
<RelativeLayout
194+
android:id="@+id/settings_show_numbers_row_holder"
195+
style="@style/SettingsHolderCheckboxStyle"
196+
android:layout_width="match_parent"
197+
android:layout_height="wrap_content">
198+
199+
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
200+
android:id="@+id/settings_show_numbers_row"
201+
style="@style/SettingsCheckboxStyle"
202+
android:layout_width="match_parent"
203+
android:layout_height="wrap_content"
204+
android:text="@string/show_numbers_row" />
205+
192206
</RelativeLayout>
193207

194208
<RelativeLayout

0 commit comments

Comments
 (0)