material-components-android

MaterialCardView crashes with material:1.1.0

∥☆過路亽.° 提交于 2020-07-03 05:52:13
问题 I am using MaterialCardView as my cardview layout. Now, Android-studio started showing me that instead of current implementation "com.google.android.material:material:1.0.0" , I should update to 1.1.0 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/edit_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="vertical" android

MaterialCardView crashes with material:1.1.0

北慕城南 提交于 2020-07-03 05:51:24
问题 I am using MaterialCardView as my cardview layout. Now, Android-studio started showing me that instead of current implementation "com.google.android.material:material:1.0.0" , I should update to 1.1.0 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/edit_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="vertical" android

How to change Theme of “MaterialDatePicker” in Android?

北慕城南 提交于 2020-06-26 14:38:53
问题 I've used MaterialDatePicker for the purpose of selecting a single date & also I had achieved that task but I cannot change the theme of the header & button. MaterialDatePicker.Builder builder; MaterialDatePicker materialDatePicker; long today = MaterialDatePicker.todayInUtcMilliseconds(); CalendarConstraints.Builder con = new CalendarConstraints.Builder(); con.setValidator(DateValidatorPointForward.now()); builder.setSelection(today); builder.setCalendarConstraints(con.build());

IllegalArgumentException When trying to use @style/Widget.MaterialComponents.TextInputLayout.OutlinedBox

浪子不回头ぞ 提交于 2020-06-23 16:00:26
问题 I am trying to stylize the TextInputLayout with an outline. But when I try to use @style/Widget.MaterialComponents.TextInputLayout.OutlinedBox in style attribute my app crashes with this exception: Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant). Here is the TextInputLayout theme I want to use OutlinedBox It was working fine but suddenly this error appeared during development <style name=

Restrict Range in Android DatePicker Custom Dialog

时光怂恿深爱的人放手 提交于 2020-06-08 20:12:54
问题 I have a custom linear layout which has DatePicker and TimePicker widgets in it. This is used as DateTime picker. I want to restrict the DatePicker by way of setMaxDate() and setMinDate() . I have done: dp.setMaxDate(new DateTime().minusDays(1).getMillis()); dp.setMinDate(new DateTime().minusDays(30).getMillis()); The dates beyond this range are actually grayed out when the dialog appears. But I can still select a grayed date. I have stumbled upon this. But, what is the work around for a

how can i do a rounded toolbar/actionbar in android studio with code like this in the image? [closed]

大兔子大兔子 提交于 2020-05-30 07:00:01
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 months ago . I'm trying to do this, with code and not with background image 回答1: Define xml file like this (this is how i rounded my botton) put the xml file in drawable folder <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android

How to put the android BottomAppBar with rounded corners

别等时光非礼了梦想. 提交于 2020-05-25 23:45:29
问题 I am using the BottomAppBar from google like this: <com.google.android.material.bottomappbar.BottomAppBar android:id="@+id/vNavigationBar" android:layout_width="match_parent" android:layout_height="wrap_content"> The custom bottom bar is flat and I need to add rounded corners on the Bottom bar(image example bellow) What should I do to make this work this way? 回答1: you can try add a shape drawable xml file and add the following code to it <corners android:topLeftRadius="16dp" android

What's the difference between the CardView from com.google.android.material and android.support.v7.widget

[亡魂溺海] 提交于 2020-05-25 11:24:03
问题 I'd like to know the difference between both widgets android.support.v7.widget.CardView which is added using Android Studio IDE components palette and com.google.android.material.card.MaterialCardView which is used on Material Design documentation. Are they two libraries that contains the same widget? Which one should I use and how to take this decision? I tried to read more the developers.android documentation, but the docs on developer.android are really big with many version and I'm yet a

What's the difference between the CardView from com.google.android.material and android.support.v7.widget

蹲街弑〆低调 提交于 2020-05-25 11:24:03
问题 I'd like to know the difference between both widgets android.support.v7.widget.CardView which is added using Android Studio IDE components palette and com.google.android.material.card.MaterialCardView which is used on Material Design documentation. Are they two libraries that contains the same widget? Which one should I use and how to take this decision? I tried to read more the developers.android documentation, but the docs on developer.android are really big with many version and I'm yet a

Overriding editTextStyle doesn't work with latest Material Components base style

时间秒杀一切 提交于 2020-05-25 07:41:47
问题 In an app of mine, I'm using the Theme.MaterialComponents.Light.NoActionBar as a base style. In this style, which I call AppTheme , I'm trying to override editTextStyle to provide a custom style for com.google.android.material.textfield.TextInputEditText (according to the source code, it uses R.attr.editTextStyle as a default style). This is my current theme, related to the TIEditText and TILayout: <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> [ primary and