Questions tagged [material-components-android]
Material Components for Android (MDC-Android) help developers execute Material Design. Developed by a core team of engineers and UX designers at Google, these components enable a reliable development workflow to build beautiful and functional Android apps.
material-components-android
323
questions with no upvoted or accepted answers
9
votes
0
answers
762
views
Android text selection toolbar is not showing up while using SelectionContainer in Jetpack Compose
I want to create selectable text using Jetpack Compose. Sample code is as following
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super....
7
votes
0
answers
478
views
Preference library styling using the material components theme
I'm using preference library(androidx.preference:preference) along with the material components theming(Theme.MaterialComponents.Light.DarkActionBar). I'm looking for a proper way for styling(font, ...
6
votes
2
answers
805
views
BottomNavigation BadgeDrawable set displayed number in a specific Locale irrespective of selected one
The project supports RTL; Arabic in particular.
The requirement is that all numbers must appear in English format even when language is selected as Arabic Locale, the way we achieve it everywhere is ...
6
votes
0
answers
2k
views
Restarter must be created only during owner's initialization stage transition
I am trying to implement transitions in my app for the first time, but it keeps crashing with this message
Restarter must be created only during owner's initialization stage transition
This is how I ...
6
votes
1
answer
2k
views
change drawable of selected MaterialButton using MaterialButtonToggleGroup
I can not able to change the background of the selected MaterialButton.
<com.google.android.material.button.MaterialButtonToggleGroup
android:id="@+id/toggleButton"
...
5
votes
0
answers
523
views
Restrain Android MaterialTimePicker dialog to specific values of hours and minutes
Is there a way to restrain the hours/minutes to specific values while a MaterialTimePicker is displayed in Android? In contrast to the MaterialDatePicker dialog there is no CalendarConstraints ...
5
votes
0
answers
3k
views
switching to Theme.MaterialComponents from Theme.AppCompat shows white blank labels & buttons
I was using Material design 1.1.0
For Tabs with Viewpager2 . I updated it to '1.2.0-alpha05' Material library version it was working fine for single module but was crashing for another module where I'...
5
votes
0
answers
3k
views
Change text color of Material TextView on surface and on background through theming
I'm following Material Design's guidelines on how to do color theming. We can alter some attributes that are already defined to customize the color and/or shape of a certain component. Some useful ...
4
votes
1
answer
725
views
What is the correct way to apply a round, colored background to a Material PopupMenu Component?
I am trying to make a popup menu with rounded corners and custom font. I am using a Material Menu from material.io. I want to acheive something like this:
What I have tried so far is to use PopupMenu ...
4
votes
0
answers
2k
views
What's the difference between DialogFragment and AppCompatDialogFragment in Android?
I mean to say androidx.appcompat.app.AppCompatDialogFragment and androidx.fragment.app.DialogFragment: the documentation says that the first one is a subclass of the second one and that the first one ...
4
votes
1
answer
563
views
Custom TextInputLayout gets wrong values set on back pressed
In my app I'm using custom view containing a TextInputLayout with the following code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget....
4
votes
1
answer
803
views
how to remove ` frequently used email ` toast on my edit text?
as you can see from the image above, there is something like a toast with text "Frequently used email" . whenever I complete typing an email then that toast will appear, I don't think I make ...
4
votes
0
answers
336
views
Android dialog with new motion system fade in
I was going through the new material motion system page here and was specifically looking at the fade animation for dialog. Unfortunately I cannot seem to find any documentation on how to use it.
What ...
4
votes
0
answers
1k
views
How to get the number of chips left outside fixed size chipGroup
I use ChipGroup in fragment to put entries I picked up from the list
<com.google.android.material.chip.ChipGroup
android:id="@+id/cgGroup"
android:layout_width="...
4
votes
1
answer
822
views
textColorPrimary is to colorOnBackground/colorOnSurface while textColorSecondary is to?
So I've been following the guidelines mentioned here
https://material.io/develop/android/theming/color/ for Color Theming my application.
Previously before this, there was an attribute called ...