@@ -33,7 +33,6 @@ class ShortcutHelper {
3333 private static final int ADAPTIVE_BITMAP_SIZE = 108 * ADAPTIVE_BITMAP_SCALE ;
3434 private static final int ADAPTIVE_BITMAP_VISIBLE_SIZE = 72 * ADAPTIVE_BITMAP_SCALE ;
3535 private static final int ADAPTIVE_BITMAP_IMAGE_SIZE = ADAPTIVE_BITMAP_VISIBLE_SIZE + 5 * ADAPTIVE_BITMAP_SCALE ;
36- private static final int PADDING_COLOR_OVERLAY = Color .argb (127 , 0 , 0 , 0 );
3736
3837 /**
3938 * Add a card to the app shortcuts, and maintain a list of the most
@@ -120,7 +119,7 @@ static void removeShortcut(Context context, int cardId) {
120119 Bitmap createAdaptiveBitmap (@ NotNull Bitmap in , int paddingColor ) {
121120 Bitmap ret = Bitmap .createBitmap (ADAPTIVE_BITMAP_SIZE , ADAPTIVE_BITMAP_SIZE , Bitmap .Config .ARGB_8888 );
122121 Canvas output = new Canvas (ret );
123- output .drawColor (ColorUtils . compositeColors ( PADDING_COLOR_OVERLAY , paddingColor ) );
122+ output .drawColor (paddingColor );
124123 Bitmap resized = Utils .resizeBitmap (in , ADAPTIVE_BITMAP_IMAGE_SIZE );
125124 output .drawBitmap (resized , (ADAPTIVE_BITMAP_SIZE - resized .getWidth ()) / 2f , (ADAPTIVE_BITMAP_SIZE - resized .getHeight ()) / 2f , null );
126125 return ret ;
@@ -140,7 +139,7 @@ static ShortcutInfoCompat.Builder createShortcutBuilder(Context context, Loyalty
140139 if (iconBitmap == null ) {
141140 iconBitmap = Utils .generateIcon (context , loyaltyCard , true ).getLetterTile ();
142141 } else {
143- iconBitmap = createAdaptiveBitmap (iconBitmap , Utils .getHeaderColor (context , loyaltyCard ));
142+ iconBitmap = createAdaptiveBitmap (iconBitmap , Utils .needsDarkForeground ( Utils . getHeaderColor (context , loyaltyCard )) ? Color . BLACK : Color . WHITE );
144143 }
145144
146145 IconCompat icon = IconCompat .createWithAdaptiveBitmap (iconBitmap );
0 commit comments