Make header colour code more consistent (#1363)

- Ensure a header colour is picked for the main screen
- Simplify all different header colour code pickers into a single code
  path
This commit is contained in:
Sylvia van Os
2023-06-10 18:34:49 +02:00
committed by GitHub
parent e66c5e36fb
commit 6e390717da
6 changed files with 15 additions and 14 deletions

View File

@@ -613,12 +613,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
dialog.show();
});
int backgroundHeaderColor;
if (loyaltyCard.headerColor != null) {
backgroundHeaderColor = loyaltyCard.headerColor;
} else {
backgroundHeaderColor = LetterBitmap.getDefaultColor(this, loyaltyCard.store);
}
int backgroundHeaderColor = Utils.getHeaderColor(this, loyaltyCard);
// Also apply colours to UI elements
int darkenedColor = ColorUtils.blendARGB(backgroundHeaderColor, Color.BLACK, 0.1f);