material-components-android

Android material chip component crashing app. Unable to inflate xml

蹲街弑〆低调 提交于 2019-11-27 09:26:16
Tried Chip component from both support library com.google.android.support:design:28.0.0-rc01 and material com.google.android.material:material:1.0.0-rc01 StackTrace android.view.InflateException: Binary XML file line #72: Binary XML file line #72: Error inflating class com.google.android.material.chip.Chip at android.view.LayoutInflater.inflate(LayoutInflater.java:551) at android.view.LayoutInflater.inflate(LayoutInflater.java:429)` Layout <com.google.android.material.chip.Chip android:id="@+id/chip" style="style/Widget.MaterialComponents.Chip.Entry" android:layout_width="wrap_content" android

How to display badge for a menuItem of BottomNavigationView of material library (version 1.1.0-alpha08)?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 09:21:42
I just want to add badge for a menuItem of BottomNavigationView in my app. I'm using BottomNavigationView of Material Components library(version 1.1.0-alpha08) since its the latest version released just 7 days ago from now I didn't found any tutorial for the same, Now because there are changes made in this version of BottomNavigationView 's showBadge method we cannot use that method. I've tried calling getBadge and getOrCreateBadge method over instance of BottomNavigationView . BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav); if (bottomNavigationView.getBadge(3) ==

java.lang.IllegalArgumentException: This component requires that you specify a valid android:textAppearance attribute

百般思念 提交于 2019-11-26 23:18:48
问题 I have a com.google.android.material.button.MaterialButton component in one of my layout file and I get this error when I am using the latest version of the Material Components library (com.google.android.material:material:1.0.0-alpha3): java.lang.IllegalArgumentException: This component requires that you specify a valid android:textAppearance attribute. It wasn't present in 1.0.0-alpha1. Is this a bug in the library or should I just specify a textAppearance attribute from now? 回答1: Does your

MaterialComponents theme alert dialog buttons

感情迁移 提交于 2019-11-26 23:01:07
问题 Recently I switched from support library to com.google.android.material:material:1.0.0 But now I have a problem, in this pages there's a note https://github.com/material-components/material-components-android/blob/master/docs/getting-started.md Note: Using a Material Components theme enables a custom view inflater which replaces default components with their Material counterparts. Currently, this only replaces Button XML components with MaterialButton. And the theme I am using Theme

MaterialDatePicker not working on Android

主宰稳场 提交于 2019-11-26 21:55:20
问题 I want to change the date picker of my project to the date picker provided by the Material Components for Android, but it is not working. This is the code I've tried: MaterialDatePicker.Builder<Long> builder = MaterialDatePicker.Builder.datePicker(); MaterialDatePicker<Long> picker = builder.build(); picker.show(getSupportFragmentManager(), picker.toString()); This is how it looked like: An this is how it should've looked like: Can anybody tell me what's missing? Thanks 回答1: With the Material

How to display badge for a menuItem of BottomNavigationView of material library (version 1.1.0-alpha08)?

可紊 提交于 2019-11-26 17:50:00
问题 I just want to add badge for a menuItem of BottomNavigationView in my app. I'm using BottomNavigationView of Material Components library(version 1.1.0-alpha08) since its the latest version released just 7 days ago from now I didn't found any tutorial for the same, Now because there are changes made in this version of BottomNavigationView 's showBadge method we cannot use that method. I've tried calling getBadge and getOrCreateBadge method over instance of BottomNavigationView .

Android - make an arrow shape with xml

时间秒杀一切 提交于 2019-11-26 17:38:41
问题 I want to make a button for my shape like this one Is there a way to do this with xml ? Like setting some points, in my case I have 5.. 回答1: What you need is to create a shape xml file in your project's drawable-xxx folder and then use this shape as background for a button. Here is the shape file called arrow_shape.xml : <?xml version="1.0" encoding="UTF-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <!-- Colored rectangle--> <item> <shape android:shape=

Android material chip component crashing app. Unable to inflate xml

 ̄綄美尐妖づ 提交于 2019-11-26 14:41:53
问题 Tried Chip component from both support library com.google.android.support:design:28.0.0-rc01 and material com.google.android.material:material:1.0.0-rc01 StackTrace android.view.InflateException: Binary XML file line #72: Binary XML file line #72: Error inflating class com.google.android.material.chip.Chip at android.view.LayoutInflater.inflate(LayoutInflater.java:551) at android.view.LayoutInflater.inflate(LayoutInflater.java:429)` Layout <com.google.android.material.chip.Chip android:id="@

Material Design not styling alert dialogs

為{幸葍}努か 提交于 2019-11-26 12:15:36
问题 I\'ve added the appCompat material design to my app and it seems that the alert dialogs are not using my primary, primaryDark, or accent colors. Here is my base style: <style name=\"MaterialNavyTheme\" parent=\"@style/Theme.AppCompat.Light.DarkActionBar\"> <item name=\"colorPrimary\">@color/apptheme_color</item> <item name=\"colorPrimaryDark\">@color/apptheme_color_dark</item> <item name=\"colorAccent\">@color/apptheme_color</item> <item name=\"android:textColorPrimary\">@color/action_bar

Round corner for BottomSheetDialogFragment

試著忘記壹切 提交于 2019-11-26 12:13:07
问题 i have an custom BttomSheetDialogFragment and i want to have round corners in top of Bottom View this is my Custom class that inflating my layout that i want to appear from bottom View mView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mView = inflater.inflate(R.layout.charge_layout, container, false); initChargeLayoutViews(); return mView; } and also i have this xml resource file as background : <shape xmlns:android=\"http:/