Skip to main content
The 2024 Developer Survey results are live! See the results

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
0 votes
0 answers
40 views

Why could not inflate Behavior subclass com.google.android.material.bottomsheet.BottomSheetBehavior?

My intention is: when I press the buttom labeled "STANDARD BOTTOM SHEET", I want the Standard sheet dialog to be shown. I'm trying to use a bottom sheet modal dialog, but for some reason, ...
Thyerry Nunes's user avatar
-1 votes
0 answers
19 views

material3 TextInputLayout actual text overlaps with prefix when it's inside recycler view

I'm using TextInputLayout and TextInputEditText as item layout inside a recycler view. the recycler view has 9 items, the first 4 items that are shown have no problem, the problem is within items 5,6,...
Mahes's user avatar
  • 101
0 votes
1 answer
19 views

How can i implement a tab selector for BottomNavigationView?

Hellow there, i just wanna implement a tab selector for BottomNavigation view like this: At the moment i don't care about the item animations, i only want to put the bottom rectangle for the selected ...
Daniel Francos's user avatar
1 vote
0 answers
18 views

How to change rounding of the Android Material range sliders

I haven't found any information on how to change both the active and inactive tracks corner rounding for Android Material range sliders ; how do I do that or work around it? I have read: Android ...
xxfogs's user avatar
  • 79
0 votes
1 answer
33 views

Must I use MaterialTheme.typography when using Jetpack Compose, or are there any alternatives?

Recently, I have switched to Jetpack Compose, I see that it's very convenient and faster when building UI with Compose. But I find it difficult and confusing to decide which style of Text should use ...
soiXam's user avatar
  • 33
0 votes
1 answer
27 views

How to show border on TextInputLayout in Android Kotlin without MaterialComponents support

How to show border on TextInputLayout in Android without MaterialComponents. I have an AppCompatActivity using AppTheme.DialogTheme to show the Activity as a Dialog, but this configuration does not ...
jetberrocal's user avatar
0 votes
0 answers
57 views

Why are Dynamic Colors not working on my android 14?

I want to use dynamic colors in my app with java and I use DynamicColors.applyToActivitiesIfAvailable(getApplication()); to apply them, but colors doesn't change as in my phone's other apps except ...
Yamen l'Her's user avatar
1 vote
0 answers
33 views

MaterialAlertDialog not showing singleChoiceItems nor multipleChoiceItems

I'm using Java to develop Android apps. In my current app, I want to create a custom alert dialog based on MaterialAlertDialogBuilder to reuse across the app and reduce repetitive code. The problem is ...
Guy David's user avatar
1 vote
1 answer
109 views

LargeTopAppBar is collapsible even if the inner content is not scrollable in Jetpack Compose

I am trying to implement a screen that uses TopAppBar and some items with LazyColumn. However, LargeTopAppBar is collapsible even if the inner content is not scrollable. STEPS I made a scrollBehavior ...
ChungJungSoo's user avatar
0 votes
1 answer
38 views

MaterialAutoCompleteTextView automatically shows dropdown when changing theme

I'm using MaterialAutoCompleteTextView to display a dropdown list for selecting a theme. xml: <com.google.android.material.textfield.TextInputLayout android:id="@+id/...
djes's user avatar
  • 36
0 votes
0 answers
42 views

Transition from Activity to Fragment

How to create a transition from an Activity to a Fragment? I specificly tried to create a MaterialSharedAxis transition from an Activity to a Fragment which did not work for me. Sample Code: // ...
Matthäus Winkler's user avatar
-1 votes
1 answer
199 views

Fatal Exception: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 5: TypedValue{t=0x2/d=0x7f040109 a=23}

I am facing an error message which triggers whenever I click in a MaterialDatePicker. I think it is related with the ThemeOverlay but I have no idea how can I get rid of it. This is the error message: ...
Sergio Rey's user avatar
-1 votes
1 answer
40 views

Switching between list view and grid view in android efficiently with smooth transition

I am trying to achieve a view switch that enables user to switch between "List view" and "Grid view" in Android. However, I have achieved this but I am not satisfied with results ...
Devarshi Rawal's user avatar
2 votes
1 answer
177 views

Updating Jetpack Compose broke dynamic colors

In my Android Project I was using the Compose BOM 2023.08.00 version, and now I updated to 2024.04.01, but after doing so, dynamic colors no longer work. Instead, it shows gray (which isn't the ...
SoyFaii's user avatar
  • 77
1 vote
1 answer
118 views

Material Design scroll-away searchbar with recyclerview

I would like my Material Design Searchbar to scroll-away/collapse when scrolling down in my recyclerview. I followed the guidelines from here but I can't get it to work. My activity XML: <?xml ...
Dieter27's user avatar
  • 114
1 vote
1 answer
63 views

How do I set the checked icon of a Chip programmatically?

Is there any way to set a drawable xml asset in a chip programmatically? Just playing around with chips, not forced to use them actually. I can easily swap, but i was wondering if that's possible or ...
Hele's user avatar
  • 345
0 votes
3 answers
173 views

How to Enforce ColorAccent in Dialog Buttons Across Different App Themes?

I expected the dialog's button text to use colorAccent. However, in some app themes, the dialog's button text uses colorPrimary. Here are my findings: Theme.AppCompat.Light.DarkActionBar - Dialog's ...
Cheok Yan Cheng's user avatar
0 votes
0 answers
34 views

The default top app bar color changes after updating material version to 1.11.0

I designed my app to look like this: But after updating the material library version from com.google.android.material:material:1.10.0 to com.google.android.material:material:1.11.0 the top app bar ...
ganjaam's user avatar
  • 1,256
0 votes
0 answers
37 views

Rule of thumb for smoothing angle between two lines `shapePath.lineTo` in java/kotlin

I want to make smooth the angle between two mirrored lines shapePath.lineTo(x1,y1) and shapePath.lineTo(x2,y2) by adding an arc of given radius R between that two lines. But I don't know how to work ...
C.F.G's user avatar
  • 1,389
0 votes
0 answers
34 views

Android BottomSheetDialog: Background blinks between bottom sheet and keyboard when keyboard is expanding (XML)

I have simple bottom sheet with one input field. When it opens I also show keyboard. Here is the sample code. MainActivity class MainActivity : AppCompatActivity() { override fun onCreate(...
imegorov's user avatar
0 votes
0 answers
32 views

Tab ItemIndicator not visible - Android TabLayout

I'm trying to display a white tab indicator that's 1 dp in height and extends the full width of the tab. However, nothing is being displayed except the text layout.xml <com.google.android....
Da Chelimo's user avatar
0 votes
0 answers
132 views

Styling Android Material Time Picker

I'm new here and seeking guidance on styling a time picker to match a specific design. I'm working on a Android kotlin project, and I want to achieve a look similar to the following image: However, I'...
Blazerstrom's user avatar
1 vote
2 answers
139 views

(BottomNavigationView) The style on this component requires your app theme to be Theme.AppCompat (or a descendant)

When using com.google.android.material.bottomnavigation.BottomNavigationView in my app layout, I get the following error: Caused by: android.view.InflateException: Binary XML file line #25 in com....
Niilo Poutanen's user avatar
0 votes
2 answers
152 views

How to change CheckBox icons more effectively in jetpack compose

ok so i have two rows of checkboxes that the user can either press checked or uncheked to each individual column so i came up with this idea of code : fun HowAmIDoingComponent( modifier: Modifier =...
Victor Pierre's user avatar
0 votes
1 answer
365 views

How to make a mini player like YouTube Music or YouTube in Android Jetpack Compose while having bottom navigation bar?

Using Material3 design principle, I think (I may be wrong here) BottomSheetScaffold Composable should be used rather than ModalBottomSheet Composable, but the problem is that I didn't find any way of ...
Curious Head's user avatar
0 votes
1 answer
60 views

How to Disable or Customize Shadow Effect in Material Design Components for Android Studio

I'm developing an Android app using Android Studio, and I'm using Material Design components, specifically BottomNavigationView. I want to disable or customize the shadow effect on this ...
Jules Gaudet's user avatar
1 vote
1 answer
125 views

Material Design SearchView has no method "setOnQueryTextListener"

I am struggling to implement material components search in my android app following this tutorial I built a basic app with viewbinding, added implementation 'com.google.android.material:material:1.11....
Kalle's user avatar
  • 222
0 votes
1 answer
130 views

How to change inflated toolbar item icon color in Actionmode from App Theme

This is the main theme we use for all our apps: <resources> <!-- Learn more about theming: https://m2.material.io/design/material-theming/implementing-your-theme.html#color --> <...
Chris's user avatar
  • 13
0 votes
0 answers
32 views

AutocompleteActivity with Compose : IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents

We are in the process of migrating our app from XML to compose and migrated a lot of areas in the app. right now we need to implement Autocomplete from Google Places to one of our Compose screens ...
Sattar's user avatar
  • 2,573
0 votes
0 answers
29 views

Toolbar small to Medium by Text Lenght

I'm developing a toolbar that adheres to MD3 guidelines, but I'm unsure if this aligns with the intended use. The toolbar will dynamically change its title based on server-received data. This text ...
thproflord's user avatar

15 30 50 per page
1
2 3 4 5
46