diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-06-30 14:51:52 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-06-30 14:51:52 +0300 |
commit | ed7a25361a1f1ec6f6e116464f62aadbc84f7588 (patch) | |
tree | e3af90b449fcdd78e38ca62f70bb2ca5c1fce74d /app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java | |
parent | ebecdb942bf4b1f70291700519380f743fc25ff7 (diff) |
#525 Adjust design to new style of Nextcloud app
Move static branding helper functions to BrandingUtil
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java index 3c8cc4f38..c487a5edd 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java @@ -101,9 +101,11 @@ import static androidx.lifecycle.Transformations.switchMap; import static it.niedermann.nextcloud.deck.Application.NO_ACCOUNT_ID; import static it.niedermann.nextcloud.deck.Application.NO_BOARD_ID; import static it.niedermann.nextcloud.deck.Application.NO_STACK_ID; +import static it.niedermann.nextcloud.deck.Application.saveCurrentAccountId; import static it.niedermann.nextcloud.deck.persistence.sync.adapters.db.util.LiveDataHelper.observeOnce; import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.applyBrandToFAB; import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.applyBrandToPrimaryTabLayout; +import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.saveBrandColors; import static it.niedermann.nextcloud.deck.util.ColorUtil.contrastRatioIsSufficient; import static it.niedermann.nextcloud.deck.util.DrawerMenuUtil.MENU_ID_ABOUT; import static it.niedermann.nextcloud.deck.util.DrawerMenuUtil.MENU_ID_ADD_BOARD; @@ -195,7 +197,7 @@ public class MainActivity extends BrandedActivity implements DeleteStackListener }).observe(this, (List<Account> accounts) -> { if (accounts == null || accounts.size() == 0) { // Last account has been deleted. hasAccounts LiveData will handle this, but we make sure, that branding is reset. - Application.saveBrandColors(this, getResources().getColor(R.color.primary)); + saveBrandColors(this, getResources().getColor(R.color.primary)); return; } @@ -233,8 +235,8 @@ public class MainActivity extends BrandedActivity implements DeleteStackListener SingleAccountHelper.setCurrentAccount(getApplicationContext(), mainViewModel.getCurrentAccount().getName()); syncManager = new SyncManager(this); - Application.saveBrandColors(this, parseColor(mainViewModel.getCurrentAccount().getColor())); - Application.saveCurrentAccountId(this, mainViewModel.getCurrentAccount().getId()); + saveBrandColors(this, parseColor(mainViewModel.getCurrentAccount().getColor())); + saveCurrentAccountId(this, mainViewModel.getCurrentAccount().getId()); if (mainViewModel.getCurrentAccount().isMaintenanceEnabled()) { refreshCapabilities(mainViewModel.getCurrentAccount()); } @@ -517,7 +519,7 @@ public class MainActivity extends BrandedActivity implements DeleteStackListener recreate(); } @ColorInt final int mainColor = parseColor(response.getColor()); - runOnUiThread(() -> Application.saveBrandColors(MainActivity.this, mainColor)); + runOnUiThread(() -> saveBrandColors(MainActivity.this, mainColor)); } } |