Skip to content
Advertisement

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)’ in ‘com.google.android.material.badge.BadgeUtils’ cannot be applied to ‘(com.google.android.material.badge.BadgeDrawable, android.view.View)’ Answer If you tried this on a device with <18 API this

Change PreferenceFragmentCompat dialog background color in Android

I recently started working with PreferenceFragmentCompat and MaterialComponents and noticed that in Dark mode, Dialogs generated by preferences like ListPreference always have that weird grey android background no matter how many background attributes I change in the style. (source: pocketnow.com) This I’ve tried: I’ve also tried with android:background and worked but it brokes everything. So I investigated a bit in-depth

Persistent Bottom Sheet with rounded corners in Android crashes when used in a card view

I have created a persistent bottom sheet in android with the intent of displaying a ListView containing additional information about locations. I want the sheet to have rounded corners. I got a ton of results for modal dialog but none for persistent. Is it possible or should I use the modal version? As suggested in an answer here, I tried

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

Advertisement