From 7262a5e223a1be6f87589edb71a2b23ef99ae6ae Mon Sep 17 00:00:00 2001 From: Apostolof Date: Sat, 7 Jul 2018 21:21:44 +0300 Subject: [PATCH] Minor fixes --- app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java | 6 +++--- .../java/gr/thmmy/mthmmy/services/NotificationService.java | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java b/app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java index bbbc41af..a68a8aed 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java @@ -152,7 +152,7 @@ public abstract class BaseActivity extends AppCompatActivity { private AccountHeader accountHeader; private ProfileDrawerItem profileDrawerItem; - private PrimaryDrawerItem downloadsItem, settingsItem, loginLogoutItem; + private PrimaryDrawerItem downloadsItem, loginLogoutItem; private IconicsDrawable loginIcon, logoutIcon; /** @@ -163,7 +163,7 @@ public abstract class BaseActivity extends AppCompatActivity { final int selectedPrimaryColor = ContextCompat.getColor(this, R.color.primary_dark); final int selectedSecondaryColor = ContextCompat.getColor(this, R.color.accent); - PrimaryDrawerItem homeItem, bookmarksItem, aboutItem; + PrimaryDrawerItem homeItem, bookmarksItem, settingsItem, aboutItem; IconicsDrawable homeIcon, homeIconSelected, downloadsIcon, downloadsIconSelected, settingsIcon, settingsIconSelected, bookmarksIcon, bookmarksIconSelected, aboutIcon, aboutIconSelected; @@ -396,7 +396,7 @@ public abstract class BaseActivity extends AppCompatActivity { setDefaultAvatar(); } else { if (!drawer.getDrawerItems().contains(downloadsItem)){ - drawer.addItemAtPosition(settingsItem, 2); + drawer.addItemAtPosition(downloadsItem, 2); } loginLogoutItem.withName(R.string.logout).withIcon(logoutIcon); //Swap login with logout profileDrawerItem.withName(sessionManager.getUsername()); diff --git a/app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java b/app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java index f6db39ad..ed837d78 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java +++ b/app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java @@ -76,7 +76,8 @@ public class NotificationService extends FirebaseMessagingService { Timber.i("Creating a notification..."); SharedPreferences settingsFile = getSharedPreferences(SETTINGS_SHARED_PREFS, Context.MODE_PRIVATE); - Uri notificationSoundUri = Uri.parse(settingsFile.getString(SELECTED_RINGTONE, null)); + String notificationsSound = settingsFile.getString(SELECTED_RINGTONE, null); + Uri notificationSoundUri = notificationsSound != null ? Uri.parse(notificationsSound) : null; SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); boolean notificationsVibrateEnabled = sharedPrefs.getBoolean(NOTIFICATION_VIBRATION_KEY, true);