mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-25 21:10:12 +01:00
Added new checklist items at the top (#583)
This commit is contained in:
parent
d34defed76
commit
ba07d6b01d
@ -50,6 +50,7 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
setupCursorPlacement()
|
setupCursorPlacement()
|
||||||
setupIncognitoMode()
|
setupIncognitoMode()
|
||||||
setupCustomizeWidgetColors()
|
setupCustomizeWidgetColors()
|
||||||
|
setupAddNewChecklistItemsTop()
|
||||||
updateTextColors(settings_nested_scrollview)
|
updateTextColors(settings_nested_scrollview)
|
||||||
|
|
||||||
arrayOf(
|
arrayOf(
|
||||||
@ -257,4 +258,12 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
config.useIncognitoMode = settings_use_incognito_mode.isChecked
|
config.useIncognitoMode = settings_use_incognito_mode.isChecked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setupAddNewChecklistItemsTop() {
|
||||||
|
settings_add_checklist_top.isChecked = config.addNewChecklistItemsTop
|
||||||
|
settings_add_checklist_top_holder.setOnClickListener {
|
||||||
|
settings_add_checklist_top.toggle()
|
||||||
|
config.addNewChecklistItemsTop = settings_add_checklist_top.isChecked
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,12 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
items.addAll(newItems)
|
if (config?.addNewChecklistItemsTop == true) {
|
||||||
|
items.addAll(0, newItems)
|
||||||
|
} else {
|
||||||
|
items.addAll(newItems)
|
||||||
|
}
|
||||||
|
|
||||||
saveNote()
|
saveNote()
|
||||||
setupAdapter()
|
setupAdapter()
|
||||||
}
|
}
|
||||||
|
@ -89,4 +89,8 @@ class Config(context: Context) : BaseConfig(context) {
|
|||||||
var fontSizePercentage: Int
|
var fontSizePercentage: Int
|
||||||
get() = prefs.getInt(FONT_SIZE_PERCENTAGE, 100)
|
get() = prefs.getInt(FONT_SIZE_PERCENTAGE, 100)
|
||||||
set(fontSizePercentage) = prefs.edit().putInt(FONT_SIZE_PERCENTAGE, fontSizePercentage).apply()
|
set(fontSizePercentage) = prefs.edit().putInt(FONT_SIZE_PERCENTAGE, fontSizePercentage).apply()
|
||||||
|
|
||||||
|
var addNewChecklistItemsTop: Boolean
|
||||||
|
get() = prefs.getBoolean(ADD_NEW_CHECKLIST_ITEMS_TOP, false)
|
||||||
|
set(addNewCheckListItemsTop) = prefs.edit().putBoolean(ADD_NEW_CHECKLIST_ITEMS_TOP, addNewCheckListItemsTop).apply()
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ const val LAST_CREATED_NOTE_TYPE = "last_created_note_type"
|
|||||||
const val MOVE_DONE_CHECKLIST_ITEMS = "move_undone_checklist_items" // it has been replaced from moving undone items at the top to moving done to bottom
|
const val MOVE_DONE_CHECKLIST_ITEMS = "move_undone_checklist_items" // it has been replaced from moving undone items at the top to moving done to bottom
|
||||||
const val FONT_SIZE_PERCENTAGE = "font_size_percentage"
|
const val FONT_SIZE_PERCENTAGE = "font_size_percentage"
|
||||||
const val EXPORT_MIME_TYPE = "text/plain"
|
const val EXPORT_MIME_TYPE = "text/plain"
|
||||||
|
const val ADD_NEW_CHECKLIST_ITEMS_TOP = "add_new_checklist_items_top"
|
||||||
|
|
||||||
// gravity
|
// gravity
|
||||||
const val GRAVITY_LEFT = 0
|
const val GRAVITY_LEFT = 0
|
||||||
|
@ -227,6 +227,21 @@
|
|||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/settings_add_checklist_top_holder"
|
||||||
|
style="@style/SettingsHolderCheckboxStyle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
|
android:id="@+id/settings_add_checklist_top"
|
||||||
|
style="@style/SettingsCheckboxStyle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/add_new_checklist_items_top" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/settings_gravity_holder"
|
android:id="@+id/settings_gravity_holder"
|
||||||
style="@style/SettingsHolderTextViewStyle"
|
style="@style/SettingsHolderTextViewStyle"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user