material-components

Navigation drawer rounded corner background for items

ε祈祈猫儿з 提交于 2021-02-06 12:11:08
问题 I want to have a rounded corner for the items in navigation drawer like this : it's an example of material design in material.io website is it possible ? 回答1: Just use the app:itemShapeAppearanceOverlay attribute: <com.google.android.material.navigation.NavigationView app:itemShapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Nav" ...> with: <style name="ShapeAppearanceOverlay.Nav" parent=""> <item name="cornerFamily">rounded</item> <item name="cornerSize">8dp</item> </style> 回答2: First, I

ActionBar background with MaterialComponents theme

扶醉桌前 提交于 2021-01-27 05:29:33
问题 I want to customize my ActionBar. My Theme looks as below: <style name="AppTheme" parent="Theme.MaterialComponents.DayNight"> <item name="actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@style/ThemeOverlay.MaterialComponents.ActionBar"> <item name="background">@drawable/actionBarBackground</item> </style> In values folder: <drawable name="actionBarBackground">#FFFFFFFF</drawable> In values-night folder: <drawable name="actionBarBackground">#FF000000<

Smooth animation between tabs when using selector - Android

荒凉一梦 提交于 2021-01-20 19:45:25
问题 I would like to get the background of the tab animated smoothly to the selected position (just like the default tabIndicator animates between tabs). Here is how my TabLayout looks like <android.support.design.widget.TabLayout android:layout_marginTop="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tabLayout" app:tabBackground="@drawable/tab_selector" app:tabTextColor="@color/white" android:background="@drawable/tab_layout_bg" app

Smooth animation between tabs when using selector - Android

半腔热情 提交于 2021-01-20 19:44:58
问题 I would like to get the background of the tab animated smoothly to the selected position (just like the default tabIndicator animates between tabs). Here is how my TabLayout looks like <android.support.design.widget.TabLayout android:layout_marginTop="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tabLayout" app:tabBackground="@drawable/tab_selector" app:tabTextColor="@color/white" android:background="@drawable/tab_layout_bg" app

popup menu background color change not working

岁酱吖の 提交于 2021-01-05 10:24:40
问题 i am begineer in android. I want to popup menu background color change.I try this code for background color change but its not working for me.i don't know why not working this code. <!--popup menu item style--> <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.MaterialComponents.Light"> <item name="android:textColor">@color/colorWhite</item> <item name="android:popupBackground">@color/colorBlack</item> <item name="actionOverflowMenuStyle">@style/CMOptionsMenu</item> <item name="android

popup menu background color change not working

只谈情不闲聊 提交于 2021-01-05 10:22:04
问题 i am begineer in android. I want to popup menu background color change.I try this code for background color change but its not working for me.i don't know why not working this code. <!--popup menu item style--> <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.MaterialComponents.Light"> <item name="android:textColor">@color/colorWhite</item> <item name="android:popupBackground">@color/colorBlack</item> <item name="actionOverflowMenuStyle">@style/CMOptionsMenu</item> <item name="android

How do I use MDCSlider in JavaScript?

寵の児 提交于 2020-12-15 05:21:48
问题 I have created an DOM element for an MDC slider (https://material.io/develop/web/components/sliders). It looks nice (except for the colors). And it works, but I really have no idea how to initialize it. I import MDC from the CDN. I can't understand from the documentation how to do the initialization. This is one version that works: setTimeout(() => { slider = new mdc.slider.MDCSlider(eltSlider) }); Without setTimeout it does not work. I have tried using a Promise instead and wait a second.

How to use data attributes with Material Design React?

依然范特西╮ 提交于 2020-12-08 06:53:59
问题 I recently started using Material Design React, but I have just come across that data-someField does propagate the value to the dataset map. Example: <Input data-role=‘someValue’ onChange={this.onChange} /> onChange = e =>{ const role = e.target.dataset.role const role2 = e.currentTarget.dataset.role } Both roles in the onChange handler are undefined. This doesn’t happen if I change the Input tag to a regular html input. Any ideas why Material Design doesn’t allow data attributes or if there

How to use data attributes with Material Design React?

蹲街弑〆低调 提交于 2020-12-08 06:53:03
问题 I recently started using Material Design React, but I have just come across that data-someField does propagate the value to the dataset map. Example: <Input data-role=‘someValue’ onChange={this.onChange} /> onChange = e =>{ const role = e.target.dataset.role const role2 = e.currentTarget.dataset.role } Both roles in the onChange handler are undefined. This doesn’t happen if I change the Input tag to a regular html input. Any ideas why Material Design doesn’t allow data attributes or if there