X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2Factivity%2FProfileDetailActivity.java;h=323568b4ea9cdac4a339fe6b0512485f281ba413;hb=1f0ccbf96f45e2a99fe519fd6e32e9705729664f;hp=4536e0d91f66aa6d22f1d6a48fadf6f64e9d9bad;hpb=017aa3e990667845af1513ede2db282c4c03b991;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java index 4536e0d9..323568b4 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java @@ -57,12 +57,18 @@ public class ProfileDetailActivity extends CrashReportingActivity { index)); debug("profiles", String.format(Locale.ENGLISH, "Editing profile %s (%s); hue=%d", - profile.getName(), profile.getUuid(), profile.getThemeId())); + profile.getName(), profile.getUuid(), profile.getThemeHue())); } } super.onCreate(savedInstanceState); - Colors.setupTheme(this, profile); + int themeHue; + if (profile != null) + themeHue = profile.getThemeHue(); + else { + themeHue = Colors.getNewProfileThemeHue(Data.profiles.getValue()); + } + Colors.setupTheme(this, themeHue); setContentView(R.layout.activity_profile_detail); Toolbar toolbar = findViewById(R.id.detail_toolbar); setSupportActionBar(toolbar); @@ -87,6 +93,7 @@ public class ProfileDetailActivity extends CrashReportingActivity { // using a fragment transaction. Bundle arguments = new Bundle(); arguments.putInt(ProfileDetailFragment.ARG_ITEM_ID, index); + arguments.putInt(ProfileDetailFragment.ARG_HUE, themeHue); mFragment = new ProfileDetailFragment(); mFragment.setArguments(arguments); getSupportFragmentManager().beginTransaction()