Skip to content

Commit fb870c7

Browse files
committed
修改按压效果处理
1 parent 300c991 commit fb870c7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

taglayout/src/main/java/com/dl7/tag/TagView.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ protected void onDraw(Canvas canvas) {
248248
} else if (mTagShape == SHAPE_RECT) {
249249
radius = 0;
250250
}
251-
final boolean isChecked = mIsTagPress || mIsChecked;
251+
final boolean isChecked = (mIsTagPress && mIsPressFeedback) || mIsChecked;
252252
// 绘制背景
253253
if (isChecked) {
254254
mPaint.setColor(mBgColorChecked);
@@ -264,7 +264,8 @@ protected void onDraw(Canvas canvas) {
264264
}
265265
canvas.drawRoundRect(mRect, radius, radius, mBorderPaint);
266266
// 绘制半透明遮罩
267-
if (mIsTagPress && (!mIsPressFeedback || mIsChecked || mBgColor == mBgColorChecked)) {
267+
if (mIsTagPress && (!mIsPressFeedback || mIsChecked ||
268+
(mBgColor == mBgColorChecked && mBorderColor == mBorderColorChecked && mTextColor == mTextColorChecked))) {
268269
canvas.drawRoundRect(mRect, radius, radius, mScrimPaint);
269270
}
270271

0 commit comments

Comments
 (0)