diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/SettingsActivity.kt index c009a20b..9064ec66 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/SettingsActivity.kt @@ -38,6 +38,7 @@ class SettingsActivity : SimpleActivity() { setupMonospacedFont() setupShowKeyboard() setupShowNotePicker() + setupMoveUndoneChecklistItems() setupShowWordCount() setupEnableLineWrap() setupFontSize() @@ -130,6 +131,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupMoveUndoneChecklistItems() { + settings_move_undone_checklist_items.isChecked = config.moveUndoneChecklistItems + settings_move_undone_checklist_items_holder.setOnClickListener { + settings_move_undone_checklist_items.toggle() + config.moveUndoneChecklistItems = settings_move_undone_checklist_items.isChecked + } + } + private fun setupShowWordCount() { settings_show_word_count.isChecked = config.showWordCount settings_show_word_count_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/helpers/Config.kt index 300b2e09..b20e5558 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/helpers/Config.kt @@ -76,4 +76,8 @@ class Config(context: Context) : BaseConfig(context) { var lastCreatedNoteType: Int get() = prefs.getInt(LAST_CREATED_NOTE_TYPE, TYPE_TEXT) set(lastCreatedNoteType) = prefs.edit().putInt(LAST_CREATED_NOTE_TYPE, lastCreatedNoteType).apply() + + var moveUndoneChecklistItems: Boolean + get() = prefs.getBoolean(MOVE_UNDONE_CHECKLIST_ITEMS, false) + set(moveUndoneChecklistItems) = prefs.edit().putBoolean(MOVE_UNDONE_CHECKLIST_ITEMS, moveUndoneChecklistItems).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/helpers/Constants.kt index 1a49e375..fe56c4d5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/helpers/Constants.kt @@ -30,6 +30,7 @@ const val LAST_USED_SAVE_PATH = "last_used_save_path" const val ENABLE_LINE_WRAP = "enable_line_wrap" const val USE_INCOGNITO_MODE = "use_incognito_mode" const val LAST_CREATED_NOTE_TYPE = "last_created_note_type" +const val MOVE_UNDONE_CHECKLIST_ITEMS = "move_undone_checklist_items" // gravity const val GRAVITY_LEFT = 0 diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index e03189e5..a3036128 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -338,6 +338,29 @@ + + + + + +