Fix default favorite color
This commit is contained in:
parent
ac8c6d7cd8
commit
76f20fa5ee
1 changed files with 3 additions and 1 deletions
|
@ -5,6 +5,7 @@ import android.content.res.Resources;
|
|||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
|
@ -29,7 +30,8 @@ public class FavoriteImageDrawable extends Drawable {
|
|||
this.resources = ctx.getResources();
|
||||
this.color = color;
|
||||
paintIcon = new Paint();
|
||||
paintIcon.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN));
|
||||
int col = color == 0 || color == Color.BLACK ? getResources().getColor(R.color.color_favorite) : color;
|
||||
paintIcon.setColorFilter(new PorterDuffColorFilter(col, PorterDuff.Mode.SRC_IN));
|
||||
paintBackground = new Paint();
|
||||
favIcon = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_action_fav_dark);
|
||||
favBackground = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.map_white_shield);
|
||||
|
|
Loading…
Reference in a new issue