mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
Merge "Update folder leave-behind color for taskbar" into tm-qpr-dev
This commit is contained in:
@@ -47,6 +47,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;
|
||||
@@ -66,6 +67,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;
|
||||
@@ -132,6 +134,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);
|
||||
|
||||
@@ -523,7 +528,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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user