Skip to content

Commit

Permalink
Merge pull request #2 from zhangjianhd/dev
Browse files Browse the repository at this point in the history
feature (viewModel): drawable无限invalidateSelf的问题
  • Loading branch information
zhangjianhd authored Feb 5, 2021
2 parents 203cbbf + fc3d796 commit 15da54f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,15 @@ public void draw(@NonNull Canvas canvas) {

//画背景
contentDrawable().draw(canvas);
invalidateSelf();

if (!hasInvalidate) {
invalidateSelf();
hasInvalidate = true;
}
}

private boolean hasInvalidate = false;

private void drawRadius(Canvas canvas) {
//左上角 阴影圆弧
tempOut.left = shadowBounds.left;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,15 @@ public void draw(@NonNull Canvas canvas) {

//画背景
contentDrawable().draw(canvas);
invalidateSelf();

if (!hasInvalidate) {
invalidateSelf();
hasInvalidate = true;
}
}

private boolean hasInvalidate = false;

private void drawRadius(Canvas canvas) {
//左上角 阴影圆弧
tempOut.left = shadowBounds.left;
Expand Down

0 comments on commit 15da54f

Please sign in to comment.