summaryrefslogtreecommitdiffstats
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/app/fedilab/android/fragments/DisplayNotificationsFragment.java6
-rw-r--r--app/src/main/res/layout/update_account.xml38
2 files changed, 6 insertions, 38 deletions
diff --git a/app/src/main/java/app/fedilab/android/fragments/DisplayNotificationsFragment.java b/app/src/main/java/app/fedilab/android/fragments/DisplayNotificationsFragment.java
index fc4226fac..829cd33b5 100644
--- a/app/src/main/java/app/fedilab/android/fragments/DisplayNotificationsFragment.java
+++ b/app/src/main/java/app/fedilab/android/fragments/DisplayNotificationsFragment.java
@@ -14,6 +14,7 @@ package app.fedilab.android.fragments;
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
+import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -250,6 +251,11 @@ public class DisplayNotificationsFragment extends Fragment implements OnRetrieve
swipeRefreshLayout.setEnabled(true);
if (context == null)
return;
+ if( getUserVisibleHint()){
+ NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
+ assert mNotificationManager != null;
+ mNotificationManager.cancelAll();
+ }
if (getUserVisibleHint() && notifications != null && notifications.size() > 0) {
retrieveMissingNotifications(notifications.get(0).getId());
updateNotificationLastId(notifications.get(0).getId());
diff --git a/app/src/main/res/layout/update_account.xml b/app/src/main/res/layout/update_account.xml
deleted file mode 100644
index ec71b7209..000000000
--- a/app/src/main/res/layout/update_account.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- Copyright 2017 Thomas Schneider
-
- This file is a part of Fedilab
-
- This program is free software; you can redistribute it and/or modify it under the terms of the
- GNU General Public License as published by the Free Software Foundation; either version 3 of the
- License, or (at your option) any later version.
-
- Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- Public License for more details.
-
- You should have received a copy of the GNU General Public License along with Fedilab; if not,
- see <http://www.gnu.org/licenses>.
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="center_vertical"
- android:gravity="center_vertical">
-
- <ImageView
- android:id="@+id/account_remove_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginStart="5dp"
- android:layout_marginLeft="5dp"
- android:layout_marginEnd="5dp"
- android:layout_marginRight="5dp"
- android:contentDescription="@string/cancel"
- android:gravity="center"
- android:padding="5dp"
- android:scaleType="center"
- android:src="@drawable/ic_cancel"
- android:tint="?attr/iconColor" />
-</LinearLayout> \ No newline at end of file