Fix white on white icons

This commit is contained in:
Sylvia van Os
2019-12-11 17:35:31 +01:00
parent ed048e6424
commit 7b7624a3e0
26 changed files with 96 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.graphics.ColorUtils;
import android.support.v4.widget.TextViewCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
@@ -44,6 +45,8 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
ImportURIHelper importURIHelper;
Settings settings;
boolean backgroundNeedsDarkIcons;
private void extractIntentFields(Intent intent)
{
final Bundle b = intent.getExtras();
@@ -165,6 +168,17 @@ 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);
if(backgroundNeedsDarkIcons)
{
ActionBar actionBar = getSupportActionBar();
if(actionBar != null)
{
actionBar.setHomeAsUpIndicator(R.drawable.ic_arrow_back_black);
}
}
if(barcodeImage.getHeight() == 0)
{
Log.d(TAG, "ImageView size is not known known at start, waiting for load");
@@ -203,13 +217,21 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
{
getMenuInflater().inflate(R.menu.card_view_menu, menu);
if(settings.getLockBarcodeScreenOrientation())
// Always calculate lockscreen icon, it may need a black color
boolean lockBarcodeScreenOrientation = settings.getLockBarcodeScreenOrientation();
MenuItem item = menu.findItem(R.id.action_lock_unlock);
setOrientatonLock(item, lockBarcodeScreenOrientation);
if(lockBarcodeScreenOrientation)
{
MenuItem item = menu.findItem(R.id.action_lock_unlock);
setOrientatonLock(item, true);
item.setVisible(false);
}
if(backgroundNeedsDarkIcons)
{
menu.findItem(R.id.action_share).setIcon(R.drawable.ic_share_black);
menu.findItem(R.id.action_edit).setIcon(R.drawable.ic_mode_edit_black_24dp);
}
return super.onCreateOptionsMenu(menu);
}
@@ -258,13 +280,27 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
{
if(lock)
{
item.setIcon(R.drawable.ic_lock_outline_white_24dp);
if(backgroundNeedsDarkIcons)
{
item.setIcon(R.drawable.ic_lock_outline_black_24dp);
}
else
{
item.setIcon(R.drawable.ic_lock_outline_white_24dp);
}
item.setTitle(R.string.unlockScreen);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
}
else
{
item.setIcon(R.drawable.ic_lock_open_white_24dp);
if(backgroundNeedsDarkIcons)
{
item.setIcon(R.drawable.ic_lock_open_black_24dp);
}
else
{
item.setIcon(R.drawable.ic_lock_open_white_24dp);
}
item.setTitle(R.string.lockScreen);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
}

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#333333"
android:alpha="0.6">
<path
android:fillColor="#FF000000"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#333333"
android:alpha="0.6">
<path
android:fillColor="#FF000000"
android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6h1.9c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM18,20L6,20L6,10h12v10z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#333333"
android:alpha="0.6">
<path
android:fillColor="#FF000000"
android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1s3.1,1.39 3.1,3.1v2L8.9,8L8.9,6zM18,20L6,20L6,10h12v10z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#333333"
android:alpha="0.6">
<path
android:fillColor="#FF000000"
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#333333"
android:alpha="0.6">
<path
android:fillColor="#FF000000"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/>
</vector>

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 B