Skip to content

Commit 7218c18

Browse files
committed
Update demo to display difference drawable type
1 parent 60d577a commit 7218c18

File tree

14 files changed

+67
-21
lines changed

14 files changed

+67
-21
lines changed

demo/src/main/java/com/minibugdev/drawablebadge/demo/DemoActivity.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ class DemoActivity : AppCompatActivity() {
2323
}
2424

2525
private fun drawBadge(number: Int, position: BadgePosition) {
26+
val drawableResId = when (radioGroup.checkedRadioButtonId) {
27+
R.id.radioButtonSelectorDrawable -> R.drawable.selector_badge
28+
R.id.radioButtonVectorDrawable -> R.drawable.ic_notifications
29+
else -> R.drawable.ic_launcher
30+
}
31+
2632
DrawableBadge.Builder(applicationContext)
27-
.drawableResId(R.drawable.selector_badge)
33+
.drawableResId(drawableResId)
2834
.badgeColor(R.color.badgeColor)
2935
.badgeSize(R.dimen.badge_size)
3036
.badgePosition(position)
466 Bytes
Loading
486 Bytes
Loading
312 Bytes
Loading
311 Bytes
Loading
573 Bytes
Loading
571 Bytes
Loading
844 Bytes
Loading
842 Bytes
Loading
1.1 KB
Loading

0 commit comments

Comments
 (0)