Skip to content

Commit ed27ffa

Browse files
Make thumbnails in edit view consistent with card view
Commit 88c1dd1 changed the behaviour of the background colour of the thumbnails, but the edit view still used the old behaviour. This creates more consistency.
1 parent 208b1a2 commit ed27ffa

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

app/src/main/java/protect/card_locker/LoyaltyCardEditActivity.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,9 +1005,8 @@ protected void onResume() {
10051005
}
10061006
}
10071007

1008-
protected void setColorFromIcon() {
1009-
Object icon = thumbnail.getTag();
1010-
if (icon != null && (icon instanceof Bitmap)) {
1008+
protected void setColorFromIcon(Bitmap icon) {
1009+
if (icon != null) {
10111010
int headerColor = Utils.getHeaderColorFromImage((Bitmap) icon, Utils.getHeaderColor(this, tempLoyaltyCard));
10121011

10131012
setLoyaltyCardHeaderColor(headerColor);
@@ -1025,8 +1024,8 @@ protected void setThumbnailImage(@Nullable Bitmap bitmap) {
10251024
if (bitmap == null) {
10261025
generateIcon(storeFieldEdit.getText().toString().trim());
10271026
} else {
1028-
thumbnail.setBackgroundColor(Color.TRANSPARENT);
1029-
setColorFromIcon();
1027+
setColorFromIcon(bitmap);
1028+
thumbnail.setBackgroundColor(Utils.needsDarkForeground(tempLoyaltyCard.headerColor) ? Color.BLACK : Color.WHITE);
10301029
}
10311030

10321031
if (tempLoyaltyCard.headerColor != null) {

0 commit comments

Comments
 (0)