Skip to content

Commit

Permalink
Add selector drawable demo
Browse files Browse the repository at this point in the history
  • Loading branch information
minibugdev committed Oct 19, 2017
1 parent 33bca47 commit 0860b87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class DemoActivity : AppCompatActivity() {

private fun drawBadge(number: Int, position: BadgePosition) {
DrawableBadge.Builder(applicationContext)
.drawableResId(R.mipmap.ic_launcher)
.drawableResId(R.drawable.selector_badge)
.badgeColor(R.color.badgeColor)
.badgeSize(R.dimen.badge_size)
.badgePosition(position)
Expand Down
6 changes: 6 additions & 0 deletions demo/src/main/res/drawable/selector_badge.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_launcher_round" android:state_pressed="true" />
<item android:drawable="@drawable/ic_launcher_round" android:state_focused="true" />
<item android:drawable="@drawable/ic_launcher" />
</selector>

0 comments on commit 0860b87

Please sign in to comment.