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);
// 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()