adding the settings item for moving undone checklist items

This commit is contained in:
tibbi
2019-12-07 15:04:40 +01:00
parent 970f641854
commit bf3f02461d
4 changed files with 37 additions and 0 deletions

View File

@ -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 {

View File

@ -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()
}

View File

@ -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