material-components-android

How to create a circular outlined Material Button in Android?

折月煮酒 提交于 2020-07-18 04:25:58
问题 I am trying to create a button with an icon in the center. The top and bottom part of the circle are a little flat. Is there a way to do this without using corner radius? Here is my layout for the button. <com.google.android.material.button.MaterialButton android:id="@+id/start_dispenser_btn" style="@style/Widget.MaterialComponents.Button.OutlinedButton" android:layout_width="175dp" android:layout_height="175dp" android:padding="14dp" app:cornerRadius="150dp" app:icon="@drawable/ic_play_arrow

MaterialDatePicker shows current date instead of needed

匆匆过客 提交于 2020-07-14 09:46:30
问题 Using MaterialDatePicker I want to show required date and give an opportunity to select another. But when a DatePicker appears it shows current date instead of specified. I plug the library: implementation 'com.google.android.material:material:1.2.0-alpha06' (or 1.1.0). Then override AppTheme in styles.xml : <style name="AppTheme" parent="Theme.MaterialComponents.Light"> And now can show DatePicker. val now = Calendar.getInstance() now[Calendar.YEAR] = 2020 now[Calendar.MONTH] = 10 now

how to change visiblity (visible, invisible or gone ) of setEndIconDrawable in TextInputLayout android?

痴心易碎 提交于 2020-07-10 03:13:05
问题 I am trying to make invisible or visibility gone of endIconDrawable which is the edit icon in the picture above for FirstName field only and want to keep visibile edit icon rest of the fields but unable to do? How can i do this? <com.google.android.material.textfield.TextInputLayout android:id="@+id/tilFirstName" android:layout_width="match_parent" android:layout_height="@dimen/_64dp" app:endIconDrawable="@drawable/icon_edit" app:endIconMode="custom"> <com.google.android.material.textfield

how to change visiblity (visible, invisible or gone ) of setEndIconDrawable in TextInputLayout android?

断了今生、忘了曾经 提交于 2020-07-10 03:12:42
问题 I am trying to make invisible or visibility gone of endIconDrawable which is the edit icon in the picture above for FirstName field only and want to keep visibile edit icon rest of the fields but unable to do? How can i do this? <com.google.android.material.textfield.TextInputLayout android:id="@+id/tilFirstName" android:layout_width="match_parent" android:layout_height="@dimen/_64dp" app:endIconDrawable="@drawable/icon_edit" app:endIconMode="custom"> <com.google.android.material.textfield

MaterialComponents AlertDialog text color

安稳与你 提交于 2020-07-07 06:53:49
问题 Reading MaterialComponents theme alert dialog buttons and https://medium.com/@lcdsmao/material-design-custom-alert-dialog-5a9cab3ade11 I set AlertDialog buttons and text colors of new Material Theme. <!-- Base application theme. --> <style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color

Material Date Picker Custom Styling

孤人 提交于 2020-07-06 16:08:32
问题 i have used range date picker from google material with this library implementation 'com.google.android.material:material:1.2.0-alpha02' this is my code MaterialDatePicker.Builder<Pair<Long, Long>> builder = MaterialDatePicker.Builder.dateRangePicker(); CalendarConstraints.Builder constraintsBuilder = new CalendarConstraints.Builder(); builder.setCalendarConstraints(constraintsBuilder.build()); MaterialDatePicker<Pair<Long,Long>> picker = builder.build(); assert getFragmentManager() != null;

Material Components theme dialog buttons go puffy after changing theme of Application

烂漫一生 提交于 2020-07-06 10:25:49
问题 Today I was trying out new material components part of their instalation is that you need to change parent of your app to inherit from Theme.MaterialComponents. So I did it because I wanted to use Bottom navigation with nicer ripple. But after that, almost all buttons in application got puffier. What should I do to revert to the previous state (image on right)? On left is a material version on right is appcompat version 回答1: During research, I found the answer I will leave it here maybe it

Material Components theme dialog buttons go puffy after changing theme of Application

送分小仙女□ 提交于 2020-07-06 10:24:28
问题 Today I was trying out new material components part of their instalation is that you need to change parent of your app to inherit from Theme.MaterialComponents. So I did it because I wanted to use Bottom navigation with nicer ripple. But after that, almost all buttons in application got puffier. What should I do to revert to the previous state (image on right)? On left is a material version on right is appcompat version 回答1: During research, I found the answer I will leave it here maybe it

How to disable past dates in MaterialDatePicker?

十年热恋 提交于 2020-07-03 10:20:55
问题 //Material Date Picker private val calendar = Calendar.getInstance() private val constraintsBuilder = CalendarConstraints.Builder().setStart(calendar.timeInMillis) private val builder = MaterialDatePicker.Builder.datePicker() private val picker = builder .setSelection(calendar.timeInMillis) .setInputMode(MaterialDatePicker.INPUT_MODE_CALENDAR) .setCalendarConstraints(constraintsBuilder.build()) .build() I am using above code to open calendar setSelection method select current date and

MaterialCardView crashes with material:1.1.0

邮差的信 提交于 2020-07-03 05:52:16
问题 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