From ea36e8e9bd3ff18a6dc1026eb72a8bfceadc41ac Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Fri, 11 Oct 2019 23:38:40 +0200 Subject: [PATCH] [Home] Add marking everything as read in the home fragment --- .../edziennik/ui/modules/home/HomeFragment.java | 10 +++++++++- app/src/main/res/values-en/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java index ce8f524f..7b5e2b4d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java @@ -255,7 +255,15 @@ public class HomeFragment extends Fragment { activity.getBottomSheet().close(); setNumberDialog(); }), - new BottomSheetSeparatorItem(true) + new BottomSheetSeparatorItem(true), + new BottomSheetPrimaryItem(true) + .withTitle(R.string.menu_mark_everything_as_read) + .withIcon(CommunityMaterial.Icon.cmd_eye_check) + .withOnClickListener(v3 -> { + activity.getBottomSheet().close(); + AsyncTask.execute(() -> app.db.metadataDao().setAllSeen(App.profileId, true)); + Toast.makeText(activity, R.string.main_menu_mark_as_read_success, Toast.LENGTH_SHORT).show(); + }) ); activity.gainAttention(); } diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 82f32af5..a200e659 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -855,4 +855,5 @@ Getting grade comments Getting school free days Show teacher absences in Agenda + Mark everything as read diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c5326ab6..4179f64c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -435,6 +435,7 @@ Zadania domowe Zarządzaj profilami Oznacz jako przeczytane + Oznacz wszystko jako przeczytane Wiadomości Odebrane Wysłane