material-components

Material Design Components select menu not rendering correctly for web

南笙酒味 提交于 2019-12-11 06:35:18
问题 I'm trying to add a basic MDC select menu to my website. But it's not quite right—the right of the box shows the MDC arrow along with the normal HTML one, and the words are placed too close to the menu label (seen here). HTML part— <div class="mdc-select mdc-select--box day-select"> <select class="mdc-select__native-control" required> <option value="" disabled selected></option> <option value="grains"> Bread, Cereal, Rice, and Pasta </option> <option value="vegetables"> Vegetables </option>

Bottom App Bar slide up/down on navigating with fragments (Navigation Architecture Components)

流过昼夜 提交于 2019-12-11 05:18:51
问题 I was having a look at the Bottom App Bar and there is a nice feature to hide it on scroll app:hideOnScroll="true" . The problem it that I cannot figure it out how to slide it up or down progmatically when the fragments are being navigated to and from . For example, overview of a setup: on MainActivity has the navigation host fragment and it is hosting a MainFragment and a DetailFragment . The MainFragment has a RecyclerView , which on scroll, will hide the Bottom App Bar . On clicking any

how to put a button in an editText [closed]

老子叫甜甜 提交于 2019-12-10 11:48:33
问题 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 3 months ago . I am making a chat application and I wanted to put a button in an editText to enable the sending of Media files. I don't know how to go about it. Tried to make the vector asset in the editText clickable but it is not going 回答1: You can use the official TextInputLayout component.

Why was material design lite(MDL) deprecated with MDC?

淺唱寂寞╮ 提交于 2019-12-10 02:04:01
问题 which of the 3 high-level goals did MDL fail: Production-ready components consumable in an a-la-carte fashion Best-in-class performance and adherence to the Material Design guidelines Seamless integration with other JS frameworks and libraries Or were there some other reasons behind deprecating MDL? 回答1: One of the core team members for MDC Web here. We have a migration guide if you're curious about switching from MDL to MDC Web. One thing we accomplished by moving to MDC Web was a new

What is AppBar vs ToolBar?

喜你入骨 提交于 2019-12-09 14:20:28
问题 All the material-ui examples show Toolbar inside Appbar. Why not just Appbar? What's the difference between the two? https://material.io/design/components/ does not have Toolbar component, only "App bars: top". https://material.io/develop/web/components/toolbar/ says "The existing MDCToolbar component and styles will be removed in a future release" So will material-ui Toolbar go away eventually? 回答1: I was looking at the default CSS properties produced by each component. The main purpose of

Can't use android:background with button from the new material components

天大地大妈咪最大 提交于 2019-12-08 17:40:23
问题 I'm using the new material components com.google.android.material:material with android x but I can't set a custom background to the button. I know that I can use app:backgroundTint to change the color but the default background has some padding that I want to get rid of, and the old way of using android:background to set my own background but this is no longer working. I looked at the docs but can't find any mention to this change. 回答1: The documentation for the MaterialButton class says: Do

MDCSnackbarFoundation Class usage

随声附和 提交于 2019-12-08 17:11:31
问题 How do I use MDCSnackbarFoundation ? with MDCSnackbar This documentation is not clear enough to get an idea. https://github.com/material-components/material-components-web/tree/master/packages/mdc-snackbar#using-the-foundation-class This is my code and I need to bind MDCSnackbarFoundation for it. logger = new MDCSnackbar($selector[0]); Thanks 回答1: At first you have to have a Node.js server. And then you have to install a package snackbar for Node.js like follows: npm install @material

customize Bounding box stroke in TextInputLayout.OutlinedBox

痴心易碎 提交于 2019-12-05 00:51:37
问题 I'm trying to change box Stroke Color of com.google.android.material.textfield.TextInputLayout while not focused but there is no attribute for that this is my TextInputLayout code <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="36dp" android:layout_marginTop="38dp" android:layout_marginEnd="36dp" android:textColorHint=

How to center icon in a MaterialButton which has no text?

廉价感情. 提交于 2019-12-04 19:27:19
问题 I'm using the latest version of the com.google.android.material:material library (i.e. 1.1.0-alpha03 ) and I have a MaterialButton defined with an icon and no text as follows: I was hoping the MaterialButton would be rendered as a square with the icon centred within it but instead the MaterialButton is rendered as follows: If I change the iconGravity value to "textStart" the MaterialButton is rendered as follows: This is a slight improvement to the positioning of the icon but the icon is

No ripples for MaterialCardView

不羁的心 提交于 2019-12-04 17:23:13
问题 Are there no ripples on the new MaterialCardView ? I used CardView with android:clickable="true" and android:foreground="?android:attr/selectableItemBackground" which worked fine but with the new MaterialCardView there are no ripples at all 😰. Other View s etc. keep working but I want my card to be clickable (with ripple as feedback). 回答1: This is a bug with MaterialCardView . It's overriding the foreground after it's created. I've filled a bug. It should be fixed to show a ripple if the card