From cead924ca512ed496b411ed7361910db3c73b43d Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Thu, 20 Aug 2020 19:56:35 +0100 Subject: [PATCH] Notification timestamp timezone fix. Tweak loading unread notification count. --- app/src/main/java/io/lbry/browser/MainActivity.java | 4 +--- .../io/lbry/browser/adapter/NotificationListAdapter.java | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/lbry/browser/MainActivity.java b/app/src/main/java/io/lbry/browser/MainActivity.java index c58d386b..ab7134b4 100644 --- a/app/src/main/java/io/lbry/browser/MainActivity.java +++ b/app/src/main/java/io/lbry/browser/MainActivity.java @@ -2144,7 +2144,6 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener } private void handleNotificationReceived(Intent intent) { - loadUnreadNotificationsCount(); loadRemoteNotifications(false); } @@ -3255,9 +3254,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener @Override public void onSuccess(List notifications) { remoteNotifcationsLastLoaded = new Date(); - loadLocalNotifications(); - loadUnreadNotificationsCount(); if (markRead && findViewById(R.id.notifications_container).getVisibility() == View.VISIBLE) { markNotificationsRead(); } @@ -3293,6 +3290,7 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener protected void onPostExecute(List notifications) { findViewById(R.id.notification_list_empty_container).setVisibility(notifications.size() == 0 ? View.VISIBLE : View.GONE); findViewById(R.id.notifications_progress).setVisibility(View.GONE); + loadUnreadNotificationsCount(); if (notificationListAdapter == null) { notificationListAdapter = new NotificationListAdapter(notifications, MainActivity.this); diff --git a/app/src/main/java/io/lbry/browser/adapter/NotificationListAdapter.java b/app/src/main/java/io/lbry/browser/adapter/NotificationListAdapter.java index a7cdbda8..cb425d53 100644 --- a/app/src/main/java/io/lbry/browser/adapter/NotificationListAdapter.java +++ b/app/src/main/java/io/lbry/browser/adapter/NotificationListAdapter.java @@ -16,8 +16,10 @@ import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; import java.util.ArrayList; +import java.util.Calendar; import java.util.Collections; import java.util.List; +import java.util.TimeZone; import io.lbry.browser.R; import io.lbry.browser.model.Claim; @@ -160,9 +162,11 @@ public class NotificationListAdapter extends RecyclerView.Adapter