Skip to content

Commit

Permalink
Fix badge positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
therealsujitk committed Oct 7, 2023
1 parent 9453b11 commit 31d8f79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

BadgeDrawable spotlightBadge = BadgeDrawable.create(requireContext());
spotlightBadge.setBadgeGravity(BadgeDrawable.TOP_END);
spotlightBadge.setHorizontalOffset((int) (16 * pixelDensity));
spotlightBadge.setVerticalOffset((int) (16 * pixelDensity));
spotlightBadge.setHorizontalOffset((int) (24 * pixelDensity));
spotlightBadge.setVerticalOffset((int) (24 * pixelDensity));
spotlightBadge.setVisible(false);

spotlightButton.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void onSuccess(@NonNull List<Course.AllData> courses) {
BadgeDrawable badgeDrawable = tab.getOrCreateBadge();
badgeDrawable.setBadgeGravity(BadgeDrawable.TOP_END);
badgeDrawable.setNumber(courses.get(position).unreadMarkCount);
badgeDrawable.setHorizontalOffset((int) (-3 * pixelDensity));
badgeDrawable.setHorizontalOffset((int) (6 * pixelDensity));
badgeDrawable.setVerticalOffset((int) (-6 * pixelDensity));

if (courses.get(position).unreadMarkCount > 9) {
Expand Down

0 comments on commit 31d8f79

Please sign in to comment.