Category : material-design

In MaterialComponents theming we can use attributes to either use the default styles or extend them to reflect your design guidelines, e.g.: <style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight.NoActionBar"> … <item name="textAppearanceCaption">@style/TextCaption</item> … </style> <style name="TextCaption" parent="TextAppearance.MaterialComponents.Caption"> <item name="fontFamily">@font/inter_regular</item> </style> Then the framework automatically applies opacity to the text colors based on the theme, which is kinda cool, because ..

Read more

This is my layout <com.google.android.material.appbar.AppBarLayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="wrap_content"> <com.google.android.material.appbar.CollapsingToolbarLayout android:id="@+id/coll_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content"> <com.google.android.material.appbar.MaterialToolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"> </com.google.android.material.appbar.MaterialToolbar> </com.google.android.material.appbar.CollapsingToolbarLayout> </com.google.android.material.appbar.AppBarLayout> If this layout isn’t the first activity/fragment, the toolbar wolud have a back icon . But the color of back icon is black. I want it to be a whit color. I search it in github,but ..

Read more

Is there a way to align the icon to the start, top, and left of the material button in android XML? Do it programmatically is also acceptable. I would expect app:iconPadding="0dp" to do that, but it doesn’t. The goal is something like this: My XML: <com.google.android.material.button.MaterialButton android:id="@+id/return_button" app:cornerRadius="40dp" app:icon="@drawable/icon_back" app:iconPadding="0dp" app:iconGravity="start" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="RETURN" /> ..

Read more

I am using MaterialDatePicker to select dates. I am facing some designing issues with this. At the top text are overlapping. Below are the style used: <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> <style name="MaterialCalendarTheme" parent="ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> and below is the gradle dependency: implementation "com.google.android.material:material:1.3.0" also ..

Read more