https://github.com/smarttoolfactory/badgetextview
✅✏️📌 Badge TextView for Android to draw numbers on a TextView which is customizable and scalable. Displays numbers either as circle or rounded rectangle depending on badge count and selected threshold to transform from circle to rounded rectangle.
https://github.com/smarttoolfactory/badgetextview
android badge-textview badgeview custom-view
Last synced: about 2 months ago
JSON representation
✅✏️📌 Badge TextView for Android to draw numbers on a TextView which is customizable and scalable. Displays numbers either as circle or rounded rectangle depending on badge count and selected threshold to transform from circle to rounded rectangle.
- Host: GitHub
- URL: https://github.com/smarttoolfactory/badgetextview
- Owner: SmartToolFactory
- Created: 2021-02-14T11:21:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-13T19:17:27.000Z (over 3 years ago)
- Last Synced: 2025-04-04T10:28:21.178Z (2 months ago)
- Topics: android, badge-textview, badgeview, custom-view
- Language: Kotlin
- Homepage:
- Size: 2.99 MB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Badge TextView
Badge TextView for Android that like the draws number on a badge which can be customizable and
scalable by almost retaining it's same shape. It displays numbers either as circle or rounded
rectangle depending on badge count and selected threshold to transform from circle to rounded
rectangle| Default | Debug | Increment |
| ----------|----------------| --------|
||
|
|
Customizable features
* Set threshold **badge_circle_threshold** to change shape from circle to rounded shape. For better
results select between 1 and 2* Set maximum number **badge_max_number**. After this number it's displayed with +. For instance if
you set maximum number to 99, after 99 it looks as **99+*** Set radius ratio **badge_round_corner_ratio** for rounded rectangle, it's .5f by default change it
to any number between 1 and 0### Shadow
* Set shadow by setting **badge_shadow_radius** to any number greater than 0
* Change shadow color with **badge_shadow_color**
* Change shadow x and/or y offset with **badge_shadow_offset_x**, **badge_shadow_offset_y**### Border
* Set border by setting **badge_border_width** to any number greater than 0
* Set border color with **badge_border_color**If you wish to change drawable area at top and right of the view
```verticalSpaceAroundText = (textHeight * .12f + 6 + paddingVertical).toInt()``` as you wishTo change horizontal area set
``` horizontalSpaceAroundText = ((textHeight * .24f) + 8 + paddingHorizontal).toInt()```
any function in **onMeasure**### TODOs:
- [ ] Add Compose style Scope and Modifier to set properties using these interfaces
- [ ] Add pin mode to display smaller circle with no text as WhatsApp status notification.