Skip to content

Tag: material-design

How to add a badge above a button?

In my MainActivity class, I have this button: I now want to add a badge with the number 1, using Material Design (see the documentation). This is how I tried: but what I get is the error ‘attachBadgeDrawable(com.google.android.material.badge.BadgeDrawable, android.view.View, android.widget.FrameLayout)&…

Runtime Change Android material theme

I have one setting screen for change app themes at runtime. I know how to create material design theme. I have create one in my style.xml file Here is code of my style.xml: Now I want to change runtime app theme from green to purple or yellow. Anything can any one tell me how can I create a color picker