material-components

Apply style to Alert Dialogs

泄露秘密 提交于 2020-01-24 20:20:08
问题 I decided to try material alert dialogs on android. The problem I am having is when I try to apply some styles. Checking the docs, I found this: <item name="materialAlertDialogTheme">@style/ThemeOverlay.MaterialComponents.MaterialAlertDialog</item> So I decided to try this: <style name="BaseTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar"> <item name="materialAlertDialogTheme">@style/Theme.App.MaterialDialogAlert</item> </style> <style name="Theme.App.MaterialDialogAlert" parent=

How to programmatically select BottomNavigationBar Tab in Flutter instead of built in onTap callback?

♀尐吖头ヾ 提交于 2020-01-24 03:51:23
问题 I have been working with BottomNavigationBar in the flutter but I am not able to select a Tab programmatically outside of onTap callback of BottomNavigationBar. Following code with onTap callback [Which is working] return new BottomNavigationBar( items: <BottomNavigationBarItem>[ _bottomNavigationItem(Icons.account_circle, DrawerTitles.CONTACTS), _bottomNavigationItem(Icons.delete, DrawerTitles.DELETED_CONTACTS), _bottomNavigationItem(Icons.list, DrawerTitles.LOGS), ], onTap: (int index) {

I want to import design library in androidx 29 version(latest version)

我与影子孤独终老i 提交于 2020-01-24 01:57:13
问题 Below image clarify my question. I was try multiples of times to import design library in android studio lastest version 29 (android x) but library does'nt work kindly tell me the design library for androidx 29. 回答1: You can use : - implementation 'com.google.android.material:material:1.0.0' library in androidx for design. 回答2: The library androidx.design:design:1.0.0 doesn't exist . You have to use the Material Components library. Material Components for Android is a drop-in replacement for

What is alternative of AppCompat.Button.Borderless in MaterialComponents?

偶尔善良 提交于 2020-01-16 05:26:30
问题 Because of some requirement in my project, I must use MaterialComponents, so my previous UI is became messy, and I need to change it. previous Image with AppCompat: new Image with MaterialComponents: Code: <style name="ButtonBorderless" parent="Base.Widget.AppCompat.Button.Borderless"> <item name="android:minHeight">0dp</item> <item name="android:minWidth">0dp</item> <item name="android:textSize">14sp</item> </style> MainStyle: <style name="DayTheme" parent="Theme.MaterialComponents.Light

ImageView with only one rounded corner

拜拜、爱过 提交于 2020-01-14 06:21:08
问题 I'm trying to make one rounded corner of ImageView like in the picture below but with bottom right corner. Tried using background shape but it's not working at all. All images loaded by Glide. Should i use something like ViewOutlineProvider ? Is there are an efficient way to do this? Thanks! <shape xmlns:android="http://schemas.android.com/apk/res/android" > <corners android:radius="2dp" android:bottomRightRadius="20dp" android:bottomLeftRadius="0dp" android:topLeftRadius="0dp" android

how to set materialButton icon to the center

你。 提交于 2020-01-12 13:53:36
问题 I am using supportLibrary = "28.0.0-beta01" version. Here is my code in .xml file: <android.support.design.button.MaterialButton android:layout_width="match_parent" android:layout_height="wrap_content" app:icon="@drawable/ic_my_orders" app:iconGravity="textStart" android:gravity="center"/> To my code icon of the drawable locating left side of the button. I want to set button to the center. I want to achieve this result Edit I don't need to any custom views or hard coded things. If this is a

how to set materialButton icon to the center

谁说我不能喝 提交于 2020-01-12 13:51:09
问题 I am using supportLibrary = "28.0.0-beta01" version. Here is my code in .xml file: <android.support.design.button.MaterialButton android:layout_width="match_parent" android:layout_height="wrap_content" app:icon="@drawable/ic_my_orders" app:iconGravity="textStart" android:gravity="center"/> To my code icon of the drawable locating left side of the button. I want to set button to the center. I want to achieve this result Edit I don't need to any custom views or hard coded things. If this is a

how to set materialButton icon to the center

好久不见. 提交于 2020-01-12 13:50:35
问题 I am using supportLibrary = "28.0.0-beta01" version. Here is my code in .xml file: <android.support.design.button.MaterialButton android:layout_width="match_parent" android:layout_height="wrap_content" app:icon="@drawable/ic_my_orders" app:iconGravity="textStart" android:gravity="center"/> To my code icon of the drawable locating left side of the button. I want to set button to the center. I want to achieve this result Edit I don't need to any custom views or hard coded things. If this is a

window.autoInit in Rails using material-components-web and webpacker

可紊 提交于 2020-01-06 07:01:44
问题 I'm using Rails 5.1.4 with the code below. I have confirmed that the material.js file is being processed and the material-components-web module is downloaded and discovered. Why is mdc undefined when calling window.mdc.autoInit() ? // app/javascript/packs/material.js import 'material-components-web' // app/views/layouts/application.html.eeb <html> <head> <%= javascript_pack_tag 'material' %> </head> <body> <script>window.mdc.autoInit();</script> </body> </html> I have tried importing

Configure Webpack to resolve relative paths

两盒软妹~` 提交于 2020-01-05 08:52:42
问题 I am trying to implement Material Web Components into my Web App as per Material Component Web's Getting Started Guide. I was able to successfully set up Webpack (V3) to load the SASS for a web component. This was after running into a problem with the include path. I was able to resolve this by adding this line to my webpack.config.js . { loader: 'sass-loader', options: { includePaths: ['./node_modules'] } } However, I wasn't as successful compiling the JS. The component in question is