updateBadgeCoordinates

open fun updateBadgeCoordinates(@NonNull anchorView: View)

Calculates and updates this badge's center coordinates based on its anchor's bounds. Internally also updates this BadgeDrawable BadgeDrawable's bounds, because they are dependent on the center coordinates.

For pre API-18, optionally wrap the anchor in a FrameLayout (if it's not done already) that will be inserted into the anchor's view hierarchy and calculate the badge's coordinates the parent FrameLayout because the BadgeDrawable will be set as the parent's foreground.

Parameters

anchorView

This badge's anchor.


open fun updateBadgeCoordinates(@NonNull anchorView: View, @Nullable customBadgeParent: FrameLayout)

Calculates and updates this badge's center coordinates based on its anchor's bounds. Internally also updates this BadgeDrawable BadgeDrawable's bounds, because they are dependent on the center coordinates.

For pre API-18, if no customBadgeParent is specified, optionally wrap the anchor in a FrameLayout (if it's not done already) that will be inserted into the anchor's view hierarchy and calculate the badge's coordinates the parent FrameLayout because the BadgeDrawable will be set as the parent's foreground.

Parameters

anchorView

This badge's anchor.

customBadgeParent

An optional parent view that will set this BadgeDrawable as its foreground.


open fun updateBadgeCoordinates(@NonNull anchorView: View, @Nullable customBadgeParent: ViewGroup)

Deprecated

use updateBadgeCoordinates instead.

Calculates and updates this badge's center coordinates based on its anchor's bounds. Internally also updates this BadgeDrawable BadgeDrawable's bounds, because they are dependent on the center coordinates. For pre API-18, coordinates will be calculated relative to customBadgeParent because the BadgeDrawable will be set as the parent's foreground.

Parameters

anchorView

This badge's anchor.

customBadgeParent

An optional parent view that will set this BadgeDrawable as its foreground.