Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smarttoolfactory/compose-badge
✏️📌 Dynamic Badge with customizable features as max number before displaying with +, color, shadow, border, corner radius, font properties and more written with Jetpack Compose. Displays numbers either in circle or rounded rectangle shape based on badge count and selected threshold to transform from circle to rounded rectangle.
https://github.com/smarttoolfactory/compose-badge
android badge badgeview custom-view jetpack-compose
Last synced: 23 days ago
JSON representation
✏️📌 Dynamic Badge with customizable features as max number before displaying with +, color, shadow, border, corner radius, font properties and more written with Jetpack Compose. Displays numbers either in circle or rounded rectangle shape based on badge count and selected threshold to transform from circle to rounded rectangle.
- Host: GitHub
- URL: https://github.com/smarttoolfactory/compose-badge
- Owner: SmartToolFactory
- Created: 2021-12-09T11:06:39.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-18T15:11:28.000Z (about 3 years ago)
- Last Synced: 2024-11-11T00:38:14.508Z (3 months ago)
- Topics: android, badge, badgeview, custom-view, jetpack-compose
- Language: Kotlin
- Homepage:
- Size: 1.16 MB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Jetpack Compose Customizable Badge
Customizable Badge written with Jetpack Compose.
Displays numbers either as circle or rounded rectangle depending on badge count and selected threshold to transform from circle to rounded rectangle.Use `BadgeState` with properties
**maxNumber:** after this number it's displayed with maxNumber+ such as 99+
**circleShapeThreshold:** number of digits that this will badge will be drawn as circle
**roundedRadiusPercent:** corner radius ratio when badge has rounded rectangle shape
**backgroundColor:** background color for badge
**horizontalPadding:** horizontal padding for rounded rectangle shape
**verticalPadding:** for rounded rectangle or general padding for circle shape
**textColor:** color of the text
**fontSize:** size of the font used for Text
**fontWeight:** The typeface thickness to use when painting the text (e.g.,FontWeight.Bold).
**fontFamily:** The font family to be used when rendering the text.
**textDecoration:** The decorations to paint on the text (e.g., an underline).
**fontStyle:** The typeface variant to use when drawing the letters (e.g., italic).
**shadow:** Shadow with elevation, dx, dy, radius and color traits.
**borderStroke:** nullable border stroke around badge
**showBadgeThreshold:** for count to display badge. If badge count is below this threshold don't display a badge. For instance don't display badge number of notification is zero.