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

Commit ec6fd6ff authored by Tony Wickham's avatar Tony Wickham
Browse files

Update folder leave-behind color for taskbar

Test: open folder in light theme and dark theme
Fixes: 265828742
Change-Id: Ib544ab85dad16c203917ae02f924650e8a5bbc6f
parent c5677f82
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.LauncherBindableItemsContainer;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.DoubleShadowBubbleTextView;
import com.android.launcher3.views.IconButtonView;
@@ -70,6 +71,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
    private final int mIconTouchSize;
    private final int mItemMarginLeftRight;
    private final int mItemPadding;
    private final int mFolderLeaveBehindColor;
    private final boolean mIsRtl;

    private final TaskbarActivityContext mActivityContext;
@@ -136,6 +138,9 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        mItemMarginLeftRight = actualMargin - (mIconTouchSize - actualIconSize) / 2;
        mItemPadding = (mIconTouchSize - actualIconSize) / 2;

        mFolderLeaveBehindColor = Themes.getAttrColor(mActivityContext,
                android.R.attr.textColorTertiary);

        // Needed to draw folder leave-behind when opening one.
        setWillNotDraw(false);

@@ -547,7 +552,8 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        if (mLeaveBehindFolderIcon != null) {
            canvas.save();
            canvas.translate(mLeaveBehindFolderIcon.getLeft(), mLeaveBehindFolderIcon.getTop());
            mLeaveBehindFolderIcon.getFolderBackground().drawLeaveBehind(canvas);
            mLeaveBehindFolderIcon.getFolderBackground().drawLeaveBehind(canvas,
                    mFolderLeaveBehindColor);
            canvas.restore();
        }
    }
+4 −1
Original line number Diff line number Diff line
@@ -92,6 +92,9 @@ public class CellLayout extends ViewGroup {
    private static final String TAG = "CellLayout";
    private static final boolean LOGD = false;

    /** The color of the "leave-behind" shape when a folder is opened from Hotseat. */
    private static final int FOLDER_LEAVE_BEHIND_COLOR = Color.argb(160, 245, 245, 245);

    protected final ActivityContext mActivity;
    @ViewDebug.ExportedProperty(category = "launcher")
    @Thunk int mCellWidth;
@@ -528,7 +531,7 @@ public class CellLayout extends ViewGroup {
                    mFolderLeaveBehind.mDelegateCellY, mTempLocation);
            canvas.save();
            canvas.translate(mTempLocation[0], mTempLocation[1]);
            mFolderLeaveBehind.drawLeaveBehind(canvas);
            mFolderLeaveBehind.drawLeaveBehind(canvas, FOLDER_LEAVE_BEHIND_COLOR);
            canvas.restore();
        }

+5 −2
Original line number Diff line number Diff line
@@ -333,12 +333,15 @@ public class PreviewBackground extends CellLayout.DelegatedCellDrawing {
                getOffsetX() + inset, getOffsetY() + inset, getScaledRadius() - inset, mPaint);
    }

    public void drawLeaveBehind(Canvas canvas) {
    /**
     * Draws the leave-behind circle on the given canvas and in the given color.
     */
    public void drawLeaveBehind(Canvas canvas, int color) {
        float originalScale = mScale;
        mScale = 0.5f;

        mPaint.setStyle(Paint.Style.FILL);
        mPaint.setColor(Color.argb(160, 245, 245, 245));
        mPaint.setColor(color);
        getShape().drawShape(canvas, getOffsetX(), getOffsetY(), getScaledRadius(), mPaint);

        mScale = originalScale;