diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/MainActivity.kt index 73e2eb21..74c17996 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/MainActivity.kt @@ -153,6 +153,7 @@ class MainActivity : SimpleActivity() { findItem(R.id.delete_note).isVisible = multipleNotesExist findItem(R.id.export_all_notes).isVisible = multipleNotesExist && hasPermission(PERMISSION_WRITE_STORAGE) findItem(R.id.open_search).isVisible = !isCurrentItemChecklist() + findItem(R.id.remove_done_items).isVisible = isCurrentItemChecklist() findItem(R.id.import_folder).isVisible = hasPermission(PERMISSION_READ_STORAGE) saveNoteButton = findItem(R.id.save_note) @@ -185,6 +186,7 @@ class MainActivity : SimpleActivity() { R.id.delete_note -> displayDeleteNotePrompt() R.id.settings -> startActivity(Intent(applicationContext, SettingsActivity::class.java)) R.id.about -> launchAbout() + R.id.remove_done_items -> removeDoneItems() else -> return super.onOptionsItemSelected(item) } return true @@ -1058,4 +1060,8 @@ class MainActivity : SimpleActivity() { checkWhatsNew(this, BuildConfig.VERSION_CODE) } } + + private fun removeDoneItems() { + getPagerAdapter().removeDoneCheckListItems(view_pager.currentItem) + } } diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/adapters/NotesPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/adapters/NotesPagerAdapter.kt index 051ebe1b..f2fdcbc4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/adapters/NotesPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/adapters/NotesPagerAdapter.kt @@ -89,4 +89,8 @@ class NotesPagerAdapter(fm: FragmentManager, val notes: List, val activity fragments[position] = fragment return fragment } + + fun removeDoneCheckListItems(position: Int) { + (fragments[position] as? ChecklistFragment)?.removeDoneItems() + } } diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/ChecklistFragment.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/ChecklistFragment.kt index ee7dff8d..77d72205 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/ChecklistFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/ChecklistFragment.kt @@ -135,11 +135,7 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener { } private fun setupAdapter() { - with(view) { - fragment_placeholder.beVisibleIf(items.isEmpty()) - fragment_placeholder_2.beVisibleIf(items.isEmpty()) - checklist_list.beVisibleIf(items.isNotEmpty()) - } + updateUIVisibility() ChecklistAdapter( activity = activity as SimpleActivity, @@ -176,6 +172,21 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener { } } + fun removeDoneItems() { + items.removeIf { it.isDone } + updateUIVisibility() + view.checklist_list.adapter?.notifyDataSetChanged() + saveNote() + } + + private fun updateUIVisibility() { + with(view) { + fragment_placeholder.beVisibleIf(items.isEmpty()) + fragment_placeholder_2.beVisibleIf(items.isEmpty()) + checklist_list.beVisibleIf(items.isNotEmpty()) + } + } + override fun saveChecklist() { saveNote() } diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu.xml index 6e04cb02..daca116f 100644 --- a/app/src/main/res/menu/menu.xml +++ b/app/src/main/res/menu/menu.xml @@ -36,6 +36,11 @@ android:icon="@drawable/ic_rename_new" android:title="@string/rename_note" app:showAsAction="ifRoom"/> + إضافة عنصر قائمة تدقيق جديد إضافة عناصر قائمة تدقيق جديدة قائمة التدقيق فارغة + Remove done items تصدير جميع الملاحظات كملفات diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index 81bc0d09..7d9b2696 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -55,6 +55,7 @@ Add a new checklist item Add new checklist items The checklist is empty + Remove done items Bütün qeydləri fayl şəklində çıxar diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index c6b65ac7..24b45f43 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -55,6 +55,7 @@ Přidat do seznamu novou položku Přidat do seznamu nové položky Seznam položek je prázdný + Remove done items Exportovat všechny poznámky jako soubory diff --git a/app/src/main/res/values-cy/strings.xml b/app/src/main/res/values-cy/strings.xml index a62c7a73..9d98224d 100644 --- a/app/src/main/res/values-cy/strings.xml +++ b/app/src/main/res/values-cy/strings.xml @@ -55,6 +55,7 @@ Ychwanegu eitem newydd at restr wirio Ychwanegu eitemau newydd at restr wirio Mae\'r rhestr wirio yn wag + Remove done items Allforio pob nodyn fel ffeil diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 902ecdd4..40e8d1ce 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -55,6 +55,7 @@ Føj et nyt punkt til tjeklisten Føj nye punkter til tjeklisten Tjeklisten er tom + Remove done items Eksporter alle noter som filer diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 254f5d01..c42e7dd7 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -55,6 +55,7 @@ Einen neuen Checklisteneintrag hinzufügen Neue Checklisteneinträge hinzufügen Die Checkliste ist leer + Remove done items Alle Notizen als Dateien exportieren diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 3ce7e2dc..326d144a 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -55,6 +55,7 @@ Προσθήκη νέου στοιχείου λίστας ελέγχου Προσθήκη νέων στοιχείων λίστας ελέγχου Η λίστα ελέγχου είναι κενή + Remove done items Εξαγωγή όλων των σημειώσεων ως αρχεία diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 9632fff9..d39a8230 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -55,6 +55,7 @@ Añadir un nuevo item a la lista Añadir nuevos items a la lista La lista está vacía + Remove done items Exportar todas las notas como archivos diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index c1aa311e..588f08bd 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -55,6 +55,7 @@ Ajouter un nouvel élément Ajouter de nouveaux éléments La checklist est vide + Remove done items Exporter toutes les notes en tant que fichiers diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 01d43463..79239339 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -55,6 +55,7 @@ Engadir un elemento a unha nova lista de verificación Engadir elementos a unha nova lista de verificación A lista de verificación está baleira + Remove done items Exportar todas as notas como ficheiros diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index ef36b540..da44924a 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -55,6 +55,7 @@ Dodajte novu stavku na spisak Dodajte nove stavke na spisak Spisak je prazan + Remove done items Izvezi sve bilješke kao datoteke diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 5739bc54..74af6462 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -55,6 +55,7 @@ Add a new checklist item Add new checklist items The checklist is empty + Remove done items Export all notes as files diff --git a/app/src/main/res/values-id/strings.xml b/app/src/main/res/values-id/strings.xml index 157ebac9..7bc2c54f 100644 --- a/app/src/main/res/values-id/strings.xml +++ b/app/src/main/res/values-id/strings.xml @@ -55,6 +55,7 @@ Tambah item checklist baru Tambah item checklist baru Checklist kosong + Remove done items Ekspor semua catatan ke berkas diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 157ebac9..7bc2c54f 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -55,6 +55,7 @@ Tambah item checklist baru Tambah item checklist baru Checklist kosong + Remove done items Ekspor semua catatan ke berkas diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 5c41a605..442a88e4 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -55,6 +55,7 @@ Aggiungi un nuovo elemento Aggiungi nuovi elementi La scaletta è vuota + Remove done items Esporta le note come file diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 7e1f3c0c..95f3096a 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -55,6 +55,7 @@ 新しいチェックリスト項目を追加 新しいチェックリスト項目を追加 チェックリストが空です + Remove done items すべてのメモをファイルとしてエクスポート diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 017d71b6..8d3e0b15 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -55,6 +55,7 @@ Pridėti naują kontrolinio sąrašo objektą Pridėti naujus kontrolinio sąrašo objektus Kontrolinis sąršas tuščias + Remove done items Eksportuoti visus užrašus kaip bylas diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index cf32780c..d3346e1c 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -55,6 +55,7 @@ Item toevoegen Items toevoegen De lijst is leeg + Remove done items Alle notities naar bestanden exporteren diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 6e8b9c01..dcd5bb98 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -55,6 +55,7 @@ Add a new checklist item Add new checklist items The checklist is empty + Remove done items Eksportuj wszystkie notatki jako pliki diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index ca7556fd..e10c0a85 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -55,6 +55,7 @@ Adicionar novo item de lista de verificação Adicionar novos itens de lista de verificação A lista de verificação está vazia + Remove done items Exportar todas as notas como arquivo diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 08d90714..54860b35 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -55,6 +55,7 @@ Adicionar item à lista de verificações Adicionar itens à lista de verificação A lista está vazia + Remove done items Exportar todas as notas como ficheiros diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 60bbc695..f2f88b9a 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -55,6 +55,7 @@ Добавить позицию в список Добавить позиции в список Список пуст + Remove done items Экспортировать все заметки в файлы diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index f1f53a99..5d0f5a94 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -55,6 +55,7 @@ Pridať do zoznamu novú položku Pridať do zoznamu nové položky Zoznam položiek je prázdny + Remove done items Exportovať všetky poznámky ako súbory diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 746415d5..65cd3c46 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -55,6 +55,7 @@ Lägg till ett nytt checklisteobjekt Lägg till nya checklisteobjekt Checklistan är tom + Remove done items Exportera alla anteckningar som filer diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index e33bd65d..b492a6d4 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -55,6 +55,7 @@ Yeni bir yapılacak listesi öğesi ekle Yeni yapılacak listesi öğeleri ekle Yapılacak listesi boş + Remove done items Tüm notları dosya olarak dışa aktar diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index bf88747c..5819bd6c 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -55,6 +55,7 @@ Додати нову позицію у списку Додати нові позиції у списку Список порожній + Remove done items Експортувати всі нотатки як файли diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 777bf69b..cb6a3a66 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -55,6 +55,7 @@ 添加一个新的清单项目 添加新的清单项目 清单为空 + Remove done items 以文件导出所有笔记 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 54f53e4f..35814d14 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -55,6 +55,7 @@ 新增新的核對清單項目 新增新的核對清單項目 核對清單為空白 + Remove done items 將全部筆記匯出成檔案 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5e20b2c4..447b1549 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -55,6 +55,7 @@ Add a new checklist item Add new checklist items The checklist is empty + Remove done items Export all notes as files