[Home] Add marking everything as read in the home fragment

This commit is contained in:
Kacper Ziubryniewicz 2019-10-11 23:38:40 +02:00
parent 7eaa4caae2
commit ea36e8e9bd
3 changed files with 11 additions and 1 deletions

View File

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

View File

@ -855,4 +855,5 @@
<string name="sync_action_syncing_grade_comments">Getting grade comments</string>
<string name="sync_action_syncing_school_free_days">Getting school free days</string>
<string name="settings_register_show_teacher_absences_text">Show teacher absences in Agenda</string>
<string name="menu_mark_everything_as_read">Mark everything as read</string>
</resources>

View File

@ -435,6 +435,7 @@
<string name="menu_homework">Zadania domowe</string>
<string name="menu_manage_profiles">Zarządzaj profilami</string>
<string name="menu_mark_as_read">Oznacz jako przeczytane</string>
<string name="menu_mark_everything_as_read">Oznacz wszystko jako przeczytane</string>
<string name="menu_messages">Wiadomości</string>
<string name="menu_messages_inbox">Odebrane</string>
<string name="menu_messages_sent">Wysłane</string>