material-design

Unable to style action mode when using Toolbar

好久不见. 提交于 2019-12-28 12:28:11
问题 I'm not sure if this is a bug or somehow I'm not using the new Toolbar class properly. I'm able to successfully theme the ActionBar directly using one of the available themes. This also allows me to theme the ActionMode. Everything works perfect as expected. Here is how I'm doing that. <style name="Theme.ActionBar" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="actionModeBackground">@drawable/action_mode_background</item> </style> Now I'm looking for a little more

Change the TextInputLayout outline color

…衆ロ難τιáo~ 提交于 2019-12-28 07:59:59
问题 I'm trying to customize a TextInputLayout with material style. I managed to set the focused state to the colors I want: Using <com.google.android.material.textfield.TextInputLayout style="@style/LoginTextInputLayoutStyle" android:theme="@style/LoginTextInputLayoutStyle" android:textColorHint="#fff" app:boxStrokeColor="#fff" .....> <EditText ... where the style is: <style name="LoginTextInputLayoutStyle" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"> <item name=

How can I be notified when a Snackbar has dismissed itself?

China☆狼群 提交于 2019-12-28 04:55:09
问题 I'm using a Snackbar from the com.android.support:design:22.2.0 library. I'm using it to undo deletions. To make my life easier, I'm going to make the UI look like things are actually deleted from the data source, and if the undo button in the snack bar is not pressed, actually perform the deletions from the data source. So, I want to know when the Snackbar is no longer visible, so it's safe to delete the items. I can call getView() on the Snackbar, but I'm not sure what listener I should be

Add elevation/shadow on toolbar for pre-lollipop devices

旧街凉风 提交于 2019-12-27 17:05:29
问题 I updated my android app to the new material design, but I also wanted to add some shadow or elevation to the Toolbar. There seem to be some (hacky) ways of doing it via images/9-patches, but I wonder if it can be done via the support libraries. (just like the CardView can have elevation) According to this answer on another question, this is possible by wrapping the Toolbar in a AppBarLayout , but this doesn't work for me. My layout: <?xml version="1.0" encoding="utf-8"?> <android.support

Add elevation/shadow on toolbar for pre-lollipop devices

亡梦爱人 提交于 2019-12-27 17:04:00
问题 I updated my android app to the new material design, but I also wanted to add some shadow or elevation to the Toolbar. There seem to be some (hacky) ways of doing it via images/9-patches, but I wonder if it can be done via the support libraries. (just like the CardView can have elevation) According to this answer on another question, this is possible by wrapping the Toolbar in a AppBarLayout , but this doesn't work for me. My layout: <?xml version="1.0" encoding="utf-8"?> <android.support

use Toolbar instead Actionbar, but can not replace success

て烟熏妆下的殇ゞ 提交于 2019-12-25 16:38:35
问题 I try to use Toolbar instead of Actionbar,but get the error like: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xjtu.wangshuai.one/com.xjtu.wangshuai.onemore.searchandscanqrcode.SearchActivity}: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead. at android.app.ActivityThread.performLaunchActivity

Navigation Drawer below Tool bar in Material Design [duplicate]

送分小仙女□ 提交于 2019-12-25 16:25:19
问题 This question already has answers here : How do I make DrawerLayout to display below the Toolbar? (6 answers) Closed 3 years ago . I want my drawer to open from the left below the tool bar. But, according to Material Design aspects that's not good. But still I want to do that. Here I have changed my XML file. ---Relative Layout -----Tool bar -----Drawer -------container -------drawer List here is my XML file. My app crashes when it opens. I don't know where I made a mistake and XML doesn't

Mousedown and Click conflict on Firefox

北城以北 提交于 2019-12-25 15:18:13
问题 I try to simulate the Paper Ripple Effect by using MAWButton plugin (https://github.com/yuhua-chen/MAWButton) and JQuery Color plugin (https://github.com/jquery/jquery-color) . Basically, the effect did not work on Firefox. Here is the Demo -> http://jsfiddle.net/2txszd46/4/ //https://github.com/yuhua-chen/MAWButton/blob/master/js/mawbutton.js (function($) { $.fn.ripple = function(options) { var settings = $.extend({ speed: 333, // ms transitionEnd: function() {} // callback when transition

Mousedown and Click conflict on Firefox

六眼飞鱼酱① 提交于 2019-12-25 15:17:32
问题 I try to simulate the Paper Ripple Effect by using MAWButton plugin (https://github.com/yuhua-chen/MAWButton) and JQuery Color plugin (https://github.com/jquery/jquery-color) . Basically, the effect did not work on Firefox. Here is the Demo -> http://jsfiddle.net/2txszd46/4/ //https://github.com/yuhua-chen/MAWButton/blob/master/js/mawbutton.js (function($) { $.fn.ripple = function(options) { var settings = $.extend({ speed: 333, // ms transitionEnd: function() {} // callback when transition

How to set Material design list to behave like getmdl-select dropdown (respond to keyboard arrows and tab)

[亡魂溺海] 提交于 2019-12-25 12:12:21
问题 The standard material design select list (dropdown) support accessibility. I can get to the dropdown with a TAB (keyboard), navigate the list items with the arrows (keyboard) and by pressing again on tab it will navigate to other component on the screen. Means, the behavior is: TAB navigate between the components on the screen and arrows navigate between the items in the list. Example: <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label getmdl-select getmdl-select__fix