From 77d1d448bafbc5babdf7f532f0ba6ec678278b1e Mon Sep 17 00:00:00 2001 From: qwerty287 Date: Thu, 2 Sep 2021 08:52:18 +0200 Subject: [PATCH] Fix visibility of "Mark as read" button (#975) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Describe what your pull request does and which issue you’re targeting Closes #970

- [X] I carefully read the [contribution guidelines](https://codeberg.org/GitNex/GitNex/src/branch/main/CONTRIBUTING.md). - [X] I'm following the code standards as defined [here](https://codeberg.org/gitnex/GitNex/wiki/Code-Standards). - [X] By submitting this pull request, I permit GitNex to license my work under the [GNU General Public License v3](https://codeberg.org/GitNex/GitNex/src/branch/main/LICENSE). Co-authored-by: qwerty287 Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/975 Reviewed-by: M M Arif Co-authored-by: qwerty287 Co-committed-by: qwerty287 --- .../gitnex/fragments/NotificationsFragment.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/mian/gitnex/fragments/NotificationsFragment.java b/app/src/main/java/org/mian/gitnex/fragments/NotificationsFragment.java index eaa70b3b..0ae7c462 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/NotificationsFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/NotificationsFragment.java @@ -250,13 +250,16 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap AppUtil.setMultiVisibility(View.GONE, loadingMoreView, progressBar); pullToRefresh.setRefreshing(false); - if(notificationThreads.isEmpty()) { + if(currentFilterMode.equalsIgnoreCase("unread")) { - noDataNotifications.setVisibility(View.VISIBLE); - markAllAsRead.setVisibility(View.GONE); - } - else { - markAllAsRead.setVisibility(View.VISIBLE); + if(notificationThreads.isEmpty()) { + + noDataNotifications.setVisibility(View.VISIBLE); + markAllAsRead.setVisibility(View.GONE); + } + else { + markAllAsRead.setVisibility(View.VISIBLE); + } } } });