Skip to content

Commit

Permalink
Switch top - bottom coordinates
Browse files Browse the repository at this point in the history
This went unnoticed because Android 7 and later "auto-correct" the
error.

Fixes #2348
  • Loading branch information
simonpoole committed Aug 16, 2023
1 parent b533550 commit 85809cc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/de/blau/android/util/BadgeDrawable.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Based on https://mobikul.com/adding-badge-count-on-menu-items-like-cart-notification-etc/
*
* Unluckily google BadgeDrawable seems to rather non-functional and without as stable API currently.
* Unluckily google BadgeDrawable seems to rather non-functional and without a stable API currently.
*
* @author simon
*
Expand Down Expand Up @@ -102,13 +102,13 @@ public void draw(Canvas canvas) {
mBadgePaint.setColor(errorColor);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
canvas.drawRoundRect(centerX - halfWidth - 7.5f, centerY + radius + 7.5f, centerX + halfWidth + 7.5f, centerY - radius - 7.5f, radius, radius,
canvas.drawRoundRect(centerX - halfWidth - 7.5f, centerY - radius - 7.5f, centerX + halfWidth + 7.5f, centerY + radius + 7.5f, radius, radius,
mBadgePaint1);
canvas.drawRoundRect(centerX - halfWidth - 5.5f, centerY + radius + 5.5f, centerX + halfWidth + 5.5f, centerY - radius - 5.5f, radius, radius,
canvas.drawRoundRect(centerX - halfWidth - 5.5f, centerY - radius - 5.5f, centerX + halfWidth + 5.5f, centerY + radius + 5.5f, radius, radius,
mBadgePaint);
} else {
canvas.drawRect(centerX - halfWidth - 7.5f, centerY + radius + 7.5f, centerX + halfWidth + 7.5f, centerY - radius - 7.5f, mBadgePaint1);
canvas.drawRect(centerX - halfWidth - 5.5f, centerY + radius + 5.5f, centerX + halfWidth + 5.5f, centerY - radius - 5.5f, mBadgePaint);
canvas.drawRect(centerX - halfWidth - 7.5f, centerY - radius - 7.5f, centerX + halfWidth + 7.5f, centerY + radius 1 7.5f, mBadgePaint1);
canvas.drawRect(centerX - halfWidth - 5.5f, centerY - radius - 5.5f, centerX + halfWidth + 5.5f, centerY + radius + 5.5f, mBadgePaint);
}
float textHeight = (float) mTxtRect.bottom - mTxtRect.top;
float textY = centerY + (textHeight / 2f);
Expand Down

0 comments on commit 85809cc

Please sign in to comment.