Implement checklist sort

This commit is contained in:
darthpaul
2021-09-29 10:35:21 +01:00
parent 8d8ab9554d
commit a90bfb9a0a
13 changed files with 212 additions and 9 deletions

View File

@ -11,6 +11,7 @@ import com.simplemobiletools.notes.pro.fragments.NoteFragment
import com.simplemobiletools.notes.pro.fragments.TextFragment
import com.simplemobiletools.notes.pro.helpers.NOTE_ID
import com.simplemobiletools.notes.pro.helpers.NoteType
import com.simplemobiletools.notes.pro.models.ChecklistSort
import com.simplemobiletools.notes.pro.models.Note
class NotesPagerAdapter(fm: FragmentManager, val notes: List<Note>, val activity: Activity) : FragmentStatePagerAdapter(fm) {
@ -95,4 +96,8 @@ class NotesPagerAdapter(fm: FragmentManager, val notes: List<Note>, val activity
fun removeDoneCheckListItems(position: Int) {
(fragments[position] as? ChecklistFragment)?.removeDoneItems()
}
fun sortChecklistItems(position: Int, sort:ChecklistSort){
(fragments[position] as? ChecklistFragment)?.sortChecklist(sort)
}
}