|
@ -241,17 +241,7 @@ public abstract class BaseActivity extends AppCompatActivity { |
|
|
.withIcon(homeIcon) |
|
|
.withIcon(homeIcon) |
|
|
.withSelectedIcon(homeIconSelected); |
|
|
.withSelectedIcon(homeIconSelected); |
|
|
|
|
|
|
|
|
|
|
|
downloadsItem = new PrimaryDrawerItem() // Don't put it in the if below
|
|
|
if (sessionManager.isLoggedIn()) //When logged in
|
|
|
|
|
|
{ |
|
|
|
|
|
loginLogoutItem = new PrimaryDrawerItem() |
|
|
|
|
|
.withTextColor(primaryColor) |
|
|
|
|
|
.withSelectedColor(selectedSecondaryColor) |
|
|
|
|
|
.withIdentifier(LOG_ID) |
|
|
|
|
|
.withName(R.string.logout) |
|
|
|
|
|
.withIcon(logoutIcon) |
|
|
|
|
|
.withSelectable(false); |
|
|
|
|
|
downloadsItem = new PrimaryDrawerItem() |
|
|
|
|
|
.withTextColor(primaryColor) |
|
|
.withTextColor(primaryColor) |
|
|
.withSelectedColor(selectedPrimaryColor) |
|
|
.withSelectedColor(selectedPrimaryColor) |
|
|
.withSelectedTextColor(selectedSecondaryColor) |
|
|
.withSelectedTextColor(selectedSecondaryColor) |
|
@ -267,6 +257,16 @@ public abstract class BaseActivity extends AppCompatActivity { |
|
|
// .withName(R.string.upload)
|
|
|
// .withName(R.string.upload)
|
|
|
// .withIcon(uploadIcon)
|
|
|
// .withIcon(uploadIcon)
|
|
|
// .withSelectedIcon(uploadIconSelected);
|
|
|
// .withSelectedIcon(uploadIconSelected);
|
|
|
|
|
|
|
|
|
|
|
|
if (sessionManager.isLoggedIn()) //When logged in
|
|
|
|
|
|
{ |
|
|
|
|
|
loginLogoutItem = new PrimaryDrawerItem() |
|
|
|
|
|
.withTextColor(primaryColor) |
|
|
|
|
|
.withSelectedColor(selectedSecondaryColor) |
|
|
|
|
|
.withIdentifier(LOG_ID) |
|
|
|
|
|
.withName(R.string.logout) |
|
|
|
|
|
.withIcon(logoutIcon) |
|
|
|
|
|
.withSelectable(false); |
|
|
} else |
|
|
} else |
|
|
loginLogoutItem = new PrimaryDrawerItem() |
|
|
loginLogoutItem = new PrimaryDrawerItem() |
|
|
.withTextColor(primaryColor) |
|
|
.withTextColor(primaryColor) |
|
@ -410,16 +410,16 @@ public abstract class BaseActivity extends AppCompatActivity { |
|
|
if (!sessionManager.isLoggedIn()) //When logged out or if user is guest
|
|
|
if (!sessionManager.isLoggedIn()) //When logged out or if user is guest
|
|
|
{ |
|
|
{ |
|
|
drawer.removeItem(DOWNLOADS_ID); |
|
|
drawer.removeItem(DOWNLOADS_ID); |
|
|
drawer.removeItem(UPLOAD_ID); |
|
|
// drawer.removeItem(UPLOAD_ID);
|
|
|
loginLogoutItem.withName(R.string.login).withIcon(loginIcon); //Swap logout with login
|
|
|
loginLogoutItem.withName(R.string.login).withIcon(loginIcon); //Swap logout with login
|
|
|
profileDrawerItem.withName(sessionManager.getUsername()); |
|
|
profileDrawerItem.withName(sessionManager.getUsername()); |
|
|
setDefaultAvatar(); |
|
|
setDefaultAvatar(); |
|
|
} else { |
|
|
} else { |
|
|
if (!drawer.getDrawerItems().contains(downloadsItem)) { |
|
|
if (!drawer.getDrawerItems().contains(downloadsItem)) { |
|
|
drawer.addItemAtPosition(downloadsItem, 2); |
|
|
drawer.addItemAtPosition(downloadsItem, 3); |
|
|
} |
|
|
} |
|
|
// if (!drawer.getDrawerItems().contains(uploadItem)) {
|
|
|
// if (!drawer.getDrawerItems().contains(uploadItem)) {
|
|
|
// drawer.addItemAtPosition(uploadItem, 3);
|
|
|
// drawer.addItemAtPosition(uploadItem, 4);
|
|
|
// }
|
|
|
// }
|
|
|
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()); |
|
|