From 6168aee6ac92a5c6320c790f2dc9e905ff04a939 Mon Sep 17 00:00:00 2001 From: neslihanturan Date: Sun, 9 Sep 2018 21:39:45 +0300 Subject: [PATCH] Add shared preferences provider for latest notification activity visit time --- .../free/nrw/commons/di/CommonsApplicationModule.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/fr/free/nrw/commons/di/CommonsApplicationModule.java b/app/src/main/java/fr/free/nrw/commons/di/CommonsApplicationModule.java index 99db50d0a..fdccb2878 100644 --- a/app/src/main/java/fr/free/nrw/commons/di/CommonsApplicationModule.java +++ b/app/src/main/java/fr/free/nrw/commons/di/CommonsApplicationModule.java @@ -108,6 +108,17 @@ public class CommonsApplicationModule { return context.getSharedPreferences("direct_nearby_upload_prefs", MODE_PRIVATE); } + /** + * Is used to determine when user is viewed notifications activity last + * @param context + * @return date of lastReadNotificationDate + */ + @Provides + @Named("last_read_notification_date") + public SharedPreferences providesLastReadNotificationDatePreferences(Context context) { + return context.getSharedPreferences("last_read_notification_date", MODE_PRIVATE); + } + @Provides public UploadController providesUploadController(SessionManager sessionManager, @Named("default_preferences") SharedPreferences sharedPreferences, Context context) { return new UploadController(sessionManager, context, sharedPreferences);