Changing some colors for folderIcon in dark themes
Bug: 111139480
Change-Id: I5b338c6faf61626a21f703da37b95466806cbbfd
diff --git a/src/com/android/launcher3/folder/PreviewBackground.java b/src/com/android/launcher3/folder/PreviewBackground.java
index 60f0eee..fd4774f 100644
--- a/src/com/android/launcher3/folder/PreviewBackground.java
+++ b/src/com/android/launcher3/folder/PreviewBackground.java
@@ -24,6 +24,7 @@
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
+import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
@@ -63,6 +64,7 @@
float mScale = 1f;
private float mColorMultiplier = 1f;
private int mBgColor;
+ private int mStrokeColor;
private int mDotColor;
private float mStrokeWidth;
private int mStrokeAlpha = MAX_BG_OPACITY;
@@ -125,8 +127,12 @@
public void setup(Context context, ActivityContext activity, View invalidateDelegate,
int availableSpaceX, int topPadding) {
mInvalidateDelegate = invalidateDelegate;
- mBgColor = Themes.getAttrColor(context, android.R.attr.colorPrimary);
- mDotColor = Themes.getAttrColor(context, R.attr.folderDotColor);
+
+ TypedArray ta = context.getTheme().obtainStyledAttributes(R.styleable.FolderIconPreview);
+ mDotColor = ta.getColor(R.styleable.FolderIconPreview_folderDotColor, 0);
+ mStrokeColor = ta.getColor(R.styleable.FolderIconPreview_folderIconBorderColor, 0);
+ mBgColor = ta.getColor(R.styleable.FolderIconPreview_android_colorPrimary, 0);
+ ta.recycle();
DeviceProfile grid = activity.getDeviceProfile();
previewSize = grid.folderIconSizePx;
@@ -275,7 +281,7 @@
}
public void drawBackgroundStroke(Canvas canvas) {
- mPaint.setColor(setColorAlphaBound(mBgColor, mStrokeAlpha));
+ mPaint.setColor(setColorAlphaBound(mStrokeColor, mStrokeAlpha));
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeWidth(mStrokeWidth);