mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-10-22 14:04:54 -04:00
Use a const for luminance halfway point
This commit is contained in:
1 parent
7b7624a3e0
commit
a642b12795
1 file changed
+2
-1
@@ -31,6 +31,7 @@ import protect.card_locker.preferences.Settings;
|
||||
public class LoyaltyCardViewActivity extends AppCompatActivity
|
||||
{
|
||||
private static final String TAG = "CardLocker";
|
||||
private static final double LUMINANCE_MIDPOINT = 0.5;
|
||||
|
||||
TextView cardIdFieldView;
|
||||
TextView noteView;
|
||||
@@ -169,7 +170,7 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
|
||||
collapsingToolbarLayout.setBackgroundColor(backgroundHeaderColor);
|
||||
|
||||
// If the background is very bright, we should use dark icons
|
||||
backgroundNeedsDarkIcons = (ColorUtils.calculateLuminance(backgroundHeaderColor) > 0.5);
|
||||
backgroundNeedsDarkIcons = (ColorUtils.calculateLuminance(backgroundHeaderColor) > LUMINANCE_MIDPOINT);
|
||||
if(backgroundNeedsDarkIcons)
|
||||
{
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
Reference in new issue
Block a user