@@ -16,8 +16,8 @@ Badge | Badge with number
1616![ badge_icon] ( assets/badge/IconOnlyBadge.png ) | ![ badge_with_number_8] ( assets/badge/BadgeNumber.png ) | ![ badge_with_999+] ( assets/badge/BadgeNumberLongerThanMaxCharCount.png )
1717
1818** Note:** This component is still under development and may not support the full
19- range of customization Material Android components generally support (e.g.
20- themed attributes) .
19+ range of customization Material Android components generally support, for
20+ instance, themed attributes.
2121
2222A ` BadgeDrawable ` represents dynamic information such as a number of pending
2323requests in a [ ` BottomNavigationView ` ] ( BottomNavigation.md ) or
@@ -34,19 +34,19 @@ requests in a [`BottomNavigationView`](BottomNavigation.md) or
3434Create an instance of ` BadgeDrawable ` by calling ` create(Context) ` or
3535` createFromAttributes(Context, AttributeSet, int, int)} ` .
3636
37- How to add and display a ` BadgeDrawable ` on top of its anchor view depends on
38- the API level:
37+ The approach used to add and display a ` BadgeDrawable ` on top of its anchor view
38+ depends on the API level:
3939
4040In API 18+ (APIs supported by
4141[ ViewOverlay] ( https://developer.android.com/reference/android/view/ViewOverlay ) )
4242
43431 . Add ` BadgeDrawable ` as a
4444 [ ViewOverlay] ( https://developer.android.com/reference/android/view/ViewOverlay )
4545 to the desired anchor view.
46- 1 . Update the ` BadgeDrawable ` 's coordinates (center and bounds) based on its
46+ 2 . Update the ` BadgeDrawable ` 's coordinates (center and bounds) based on its
4747 anchor view using ` #updateBadgeCoordinates(View) ` .
4848
49- Both of the above steps have been encapsulated in a util method:
49+ Both steps have been encapsulated in a util method:
5050
5151``` java
5252BadgeUtils . attachBadgeDrawable(badgeDrawable, anchor);
@@ -56,11 +56,11 @@ In Pre API-18
5656
57571 . Set ` BadgeDrawable ` as the foreground of the anchor view's ` FrameLayout `
5858 ancestor.
59- 1 . Update the ` BadgeDrawable ` 's coordinates (center and bounds) based on its
60- anchor view ( relative to its ` FrameLayout ` ancestor's coordinate space),
59+ 2 . Update the ` BadgeDrawable ` 's coordinates (center and bounds) based on its
60+ anchor view, relative to its ` FrameLayout ` ancestor's coordinate space.
6161
6262Option 1: ` BadgeDrawable ` will dynamically create and wrap the anchor view in a
63- ` FrameLayout ` , then insert the ` FrameLayout ` into the anchor view original
63+ ` FrameLayout ` , then insert the ` FrameLayout ` into the original anchor view
6464position in the view hierarchy. Same syntax as API 18+
6565
6666``` java
@@ -76,17 +76,17 @@ can specify a `FrameLayout` to display the badge instead.
7676
7777### ` BadgeDrawable ` Gravity Modes
7878
79- ` BadgeDrawable ` provides 4 pre-packaged gravity modes that control how the badge
80- aligns with respect to its anchor view. By default (` TOP_END ` ), badge aligns to
81- the top and end edges of the anchor (with some offsets). The other options are
79+ ` BadgeDrawable ` provides four pre-packaged gravity modes that control how the
80+ badge aligns with its anchor view. By default (` TOP_END ` ) badge aligns with the
81+ top and end edges of the anchor (with some offsets). The other options are
8282` TOP_START ` , ` BOTTOM_START ` and ` BOTTOM_END ` .
8383
8484### ` BadgeDrawable ` center offsets
8585
86- By default, ` BadgeDrawable ` is aligned to the top and end edges of its anchor
86+ By default, ` BadgeDrawable ` is aligned with the top and end edges of its anchor
8787view (with some offsets). Call ` setBadgeGravity(int) ` to change it to one of the
88- other supported modes. To adjust the badge's offsets w.r.t. the anchor's center,
89- use ` setHoriziontalOffset(int) ` or ` setVerticalOffset(int) `
88+ other supported modes. To adjust the badge's offsets relative to the anchor's
89+ center, use ` setHoriziontalOffset(int) ` or ` setVerticalOffset(int) `
9090
9191### ` BadgeDrawable ` Attributes
9292
@@ -100,6 +100,6 @@ Badge Gravity | `app:badgeGravity`
100100### Talkback Support
101101
102102` BadgeDrawable ` provides a getter for its content description, which is based on
103- the number (if any) being displayed. Users should specify content description:
103+ the number (if any) displayed. Users should specify content description:
104104` setContentDescriptionNumberless(CharSequence) `
105105` setContentDescriptionQuantityStringsResource(@StringRes) `
0 commit comments