android-design-library

TextInputLayout not showing EditText hint before user focus on it

北城以北 提交于 2019-11-26 07:24:51
问题 I am using recently released Android Design Support Library to show floating label with EditTexts. But i am facing the problem that the Hint on the EditText is not showing when UI is rendered, but i see the Hint after i focus on the EditTexts. My Layout is as follows: <?xml version=\"1.0\" encoding=\"utf-8\"?> <FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" android:layout_width=\"match_parent\" android:layout_height=\"match_parent\"> <FrameLayout android:layout_width

How to customize item background and item text color inside NavigationView?

安稳与你 提交于 2019-11-26 06:18:48
问题 I wanna achieve something like this shown in the Material Design Docs. colorControlHighlight is used for the Background on checked items. I need to customize: background unchecked text color checked text color unchecked 回答1: NavigationDrawer (NavigationView) has three options for configuration of checked/selected items. app:itemIconTint="@color/menu_text_color" //icon color app:itemTextColor="@color/menu_text_color" //text color app:itemBackground="@drawable/menu_background_color" /

How to change the new TabLayout indicator color and height

£可爱£侵袭症+ 提交于 2019-11-26 06:15:28
问题 I was playing around with the new android.support.design.widget.TabLayout , and found a problem, in the class definition, there are no methods to change the indicator color, and default height. Doing some research, found that the default indicator color is taken from the AppTheme. Specifically from here: <item name=\"colorAccent\">#FF4081</item> Now, in my case, if I change the colorAccent , it will affect all the other views which uses this value as background color, for example ProgressBar

How to add footer to NavigationView - Android support design library?

十年热恋 提交于 2019-11-26 05:57:45
问题 How can I set footer settings and profile items to NavitationView ? to looks like the Inbox by email navigation drawer. The NavitationView items are inflated by menu resource, but I don\'t know how to set bottom items to a menu resource, or how can I set a custom view to NavigationView or an bottom offset? I have tried putting this <LinearLayout...> as footer view, but on small screens the footer puts over the items and I cant scroll the menu, I have tried to set a footer padding to

NavigationView and custom Layout

ぐ巨炮叔叔 提交于 2019-11-26 05:17:03
问题 I\'m using the Designs Support Libraries NavigationView like this: <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/drawer_layout\" android:layout_height=\"match_parent\" android:layout_width=\"match_parent\" android:fitsSystemWindows=\"true\"> <!-- put your main layout here --> <include layout=\"@layout/drawer_main_layout\"/> <android.support.design.widget

Flinging with RecyclerView + AppBarLayout

本秂侑毒 提交于 2019-11-26 04:02:35
问题 I am using the new CoordinatorLayout with AppBarLayout and CollapsingToolbarLayout. Below AppBarLayout, I have a RecyclerView with a list of content. I have verified that fling scrolling works on the RecyclerView when I am scrolling up and down the list. However, I would also like the AppBarLayout to smoothly scroll during expansion. When scrolling up to expand the CollaspingToolbarLayout, scrolling immediately stops once lifting your finger off the screen. If you scroll up in a quick motion,

Android - footer scrolls off screen when used in CoordinatorLayout

心不动则不痛 提交于 2019-11-26 03:49:37
问题 I have an AppBarLayout that scrolls off screen when scrolling a RecyclerView . Below the RecyclerView there is a RelativeLayout that is a footer. The footer is shown only after scrolling up - it behave like it has layout_scrollFlags=\"scroll|enterAlways\" but it doesn\'t have any scroll flags - is it a bug or am I doing something wrong? I want it to be always visible before scroll after scroll Update opened a google issue on this - it was marked \'WorkingAsIntended\' this still doesn\'t help

How to create a simple divider in the new NavigationView?

冷暖自知 提交于 2019-11-26 03:35:45
问题 Google introduced the NavigationView in the Design Support Library version 22.2.0 with which you can create a drawer very easily using a menu resource. How can I create a simple divider line between two items? Grouping the items didn\'t work. Creating a sub items section does create a divider line, but it requires a title, which I don\'t want. Any help would be appreciated. 回答1: All you need to do is define a group with an unique ID , I have checked the implementation if group has different

FloatingActionButton example with Support Library

痴心易碎 提交于 2019-11-26 00:39:41
问题 Recently, I read these posts: Android Design Support Library Android Support Library, revision 22.2.0 FloatingActionButton But, none of them give me a detail example about creating a new FloatingActionButton . So hard to understand, I ask this question. Can anyone give me an example about it? Any help much be appreciated. Thanks in advance. EDIT I just found some issues on FloatingActionButton (FAB), and I want to improve another answer. See my answer below. 回答1: So in your build.gradle file,

How to change the floating label color of TextInputLayout

旧街凉风 提交于 2019-11-26 00:35:52
问题 With reference to the new TextInputLayout released by Google, how do I change the floating label text color? Setting colorControlNormal , colorControlActivated , colorControlHighLight in styles does not help. This is what I have now: 回答1: Try The Below Code It Works In Normal State <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/TextLabel"> <android.support.v7.widget.AppCompatEditText android:layout