material-design

How to disable padding on TextInputLayout?

笑着哭i 提交于 2019-12-09 02:28:00
问题 There appears to be left padding automatically added when using a TextInputLayout to wrap an EditText as you can see in the screenshot below. There is no padding added to the EditText in the layout XML, but when the view is rendered there appears to be left padding on the EditText . You can see this when comparing the TextView below the TextInputLayout . How do I disable this left padding from being added? Thank you! 回答1: TextInputLayout is a LinearLayout , so you should be able to specify a

How to Implement 'Data Tables' (material design component) in android?

℡╲_俬逩灬. 提交于 2019-12-09 02:20:25
问题 I have gone through this new design specifications https://www.google.com/design/spec/components/data-tables.html#data-tables-interaction How can we implement all these Structure, Interactions in android. I haven't found enough documents describing this implementation. Is this only a design language specification. Any helpful documents? Thanks The official document says that "Data tables usually appear in desktop enterprise products." But I am curious about the implementation. Is it not a

Flutter FilterChip Avatar Selected Style

烈酒焚心 提交于 2019-12-08 22:19:32
问题 I'm using FilterChip with a CircleAvatar for avatar, but the selected state has a nasty rectangle that I can't seem to find any reference for. How do I remove it? Code: child: FilterChip( avatar: CircleAvatar( backgroundColor: category.color ), label: Text(category.name), selected: badCategoryIds.contains(category.id), onSelected: (bool value) { if (value) { badCategoryIds.add(category.id); } else { badCategoryIds.remove(category.id); } categoryChoiceCallback(badCategoryIds); }, ) Result: How

How to add search button on toolbar in material design

坚强是说给别人听的谎言 提交于 2019-12-08 19:18:59
问题 I am trying to add search button on left side of settings pop up but i am not able to add in toolbar. Here is my code of menu.xml : <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context="com.example.materialtheme.MainActivity" > <item android:id="@+id/action_search" android:icon="@drawable/ic_launcher" android:menuCategory="secondary" android:showAsAction="ifRoom" android:title="@string/action_search"/> <item android:id="

Styling a Spinner, appcompat, material

蹲街弑〆低调 提交于 2019-12-08 17:42:18
问题 So my app theme extends from AppCompat's Material Light theme with Dark Action Bar. I applied an accent color. Now I am trying to use a Spinner on a dark backround and because of the theme, the spinner has a dark gray arrow which changes to accent color when pressed. How can I make this spinner's arrow white so that it is prominent on a dark background? Here's the image of the Spinner: 回答1: If you want to apply same spinner style app wide, then in your values/styles.xml , override

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

CollapsingToolbarLayout sometimes leaves white space below [duplicate]

十年热恋 提交于 2019-12-08 15:45:19
问题 This question already has an answer here : CollapsingToolbarLayout doesn't work well with NestedScrollView (1 answer) Closed 11 months ago . I have a problem. Here are the screenshots: And here is the code: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawerLayout" android:layout_width="match_parent" android:layout_height="match

Android API 21 changes my custom button background

ぐ巨炮叔叔 提交于 2019-12-08 15:20:37
I am testing out my app for API21 on Android! Unfortunately, my buttons seem weird - there is some kind of background color added. The background images did not change - they are completely transparent except for the border. (The different text and size is due to the screenshot). Here you see the buttons before and since API 21: http://imgur.com/9EEcl0o,yVEnJkI#0 I already tried android:elevation="0dp" and android:background="@android:color/transparent". Anybody knows why my buttons change? Thank you very much! layout.xml: <Button android:id="@+id/sm_achievements_btn" android:layout_width=

Selection Box around android.support.v7.widget.SwitchCompat

寵の児 提交于 2019-12-08 15:11:33
问题 I am trying to mimic the new material design switch in my app and the switchcompat works pretty well. The only problem is a grey selection box appears around the switch on touch and really takes away from the clean look. Is this something I can remove? 回答1: Use: <android.support.v7.widget.SwitchCompat ... android:background="@null" /> 来源: https://stackoverflow.com/questions/27999583/selection-box-around-android-support-v7-widget-switchcompat