Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba46cae7 authored by Jay Aliomer's avatar Jay Aliomer
Browse files

Enable stroked QS tile background

To allow for a stroked background, a new resource property is added
the resource is overlayable
Test: visual
Fixes: 146475397

Change-Id: I52ed773193cafdac00504bd41ba57f2f414b9b08
parent 290bc3ba
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -486,6 +486,7 @@
    -->
    <dimen name="qs_customize_header_min_height">46dp</dimen>
    <dimen name="qs_tile_margin_top">18dp</dimen>
    <dimen name="qs_tile_icon_background_stroke_width">-1dp</dimen>
    <dimen name="qs_tile_background_size">44dp</dimen>
    <dimen name="qs_quick_tile_size">48dp</dimen>
    <dimen name="qs_quick_tile_padding">12dp</dimen>
+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.Drawable;
@@ -92,6 +93,12 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
        PathShape p = new PathShape(path, pathSize, pathSize);
        ShapeDrawable d = new ShapeDrawable(p);
        d.setTintList(ColorStateList.valueOf(Color.TRANSPARENT));
        float backgroundStrokeWidth = context.getResources()
                .getDimension(R.dimen.qs_tile_icon_background_stroke_width);
        if (backgroundStrokeWidth > 0) {
            d.getPaint().setStyle(Paint.Style.STROKE);
            d.getPaint().setStrokeWidth(backgroundStrokeWidth);
        }
        int bgSize = context.getResources().getDimensionPixelSize(R.dimen.qs_tile_background_size);
        d.setIntrinsicHeight(bgSize);
        d.setIntrinsicWidth(bgSize);