Browse Source

Minor fixes

pull/27/head
Apostolos Fanakis 7 years ago
parent
commit
7262a5e223
  1. 6
      app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java
  2. 3
      app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java

6
app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java

@ -152,7 +152,7 @@ public abstract class BaseActivity extends AppCompatActivity {
private AccountHeader accountHeader; private AccountHeader accountHeader;
private ProfileDrawerItem profileDrawerItem; private ProfileDrawerItem profileDrawerItem;
private PrimaryDrawerItem downloadsItem, settingsItem, loginLogoutItem; private PrimaryDrawerItem downloadsItem, loginLogoutItem;
private IconicsDrawable loginIcon, logoutIcon; 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 selectedPrimaryColor = ContextCompat.getColor(this, R.color.primary_dark);
final int selectedSecondaryColor = ContextCompat.getColor(this, R.color.accent); final int selectedSecondaryColor = ContextCompat.getColor(this, R.color.accent);
PrimaryDrawerItem homeItem, bookmarksItem, aboutItem; PrimaryDrawerItem homeItem, bookmarksItem, settingsItem, aboutItem;
IconicsDrawable homeIcon, homeIconSelected, downloadsIcon, downloadsIconSelected, settingsIcon, IconicsDrawable homeIcon, homeIconSelected, downloadsIcon, downloadsIconSelected, settingsIcon,
settingsIconSelected, bookmarksIcon, bookmarksIconSelected, aboutIcon, aboutIconSelected; settingsIconSelected, bookmarksIcon, bookmarksIconSelected, aboutIcon, aboutIconSelected;
@ -396,7 +396,7 @@ public abstract class BaseActivity extends AppCompatActivity {
setDefaultAvatar(); setDefaultAvatar();
} else { } else {
if (!drawer.getDrawerItems().contains(downloadsItem)){ if (!drawer.getDrawerItems().contains(downloadsItem)){
drawer.addItemAtPosition(settingsItem, 2); drawer.addItemAtPosition(downloadsItem, 2);
} }
loginLogoutItem.withName(R.string.logout).withIcon(logoutIcon); //Swap login with logout loginLogoutItem.withName(R.string.logout).withIcon(logoutIcon); //Swap login with logout
profileDrawerItem.withName(sessionManager.getUsername()); profileDrawerItem.withName(sessionManager.getUsername());

3
app/src/main/java/gr/thmmy/mthmmy/services/NotificationService.java

@ -76,7 +76,8 @@ public class NotificationService extends FirebaseMessagingService {
Timber.i("Creating a notification..."); Timber.i("Creating a notification...");
SharedPreferences settingsFile = getSharedPreferences(SETTINGS_SHARED_PREFS, Context.MODE_PRIVATE); 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); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean notificationsVibrateEnabled = sharedPrefs.getBoolean(NOTIFICATION_VIBRATION_KEY, true); boolean notificationsVibrateEnabled = sharedPrefs.getBoolean(NOTIFICATION_VIBRATION_KEY, true);

Loading…
Cancel
Save