android-design-library

What is CoordinatorLayout?

梦想的初衷 提交于 2019-11-27 09:49:39
问题 Just had a look at the demo app of new Android support design library. It's provided by Chris Banes on github. Throught the app, CoordinatorLayout is used Heavily. Also, many of the support design library classes such as FloatingActionButton , SnackBar , AppBarLayout etc. behaves differently when used inside CoordinatorLayout . Can someone please shed some lights on what is CoordinatorLayout and how it is different from other ViewGroup s in android, or at least provide correct path towards

Android CollapsingToolbarLayout collapse Listener

时光怂恿深爱的人放手 提交于 2019-11-27 09:10:34
问题 I am using CollapsingToolBarLayout alongside with AppBarLayout and CoordinatorLayout , and they are working Fine altogether. I set my Toolbar to be fixed when I scroll up, I want to know if there is a way to change the title text of the Toolbar, when CollapsingToolBarLayout it is collapsed. Wrapping up, I want two different titles when scrolled and when expanded . Thank you all in advance 回答1: I share the full implementation, based on @Frodio Beggins and @Nifhel code: public abstract class

CollapsingToolbarLayout setTitle() does not update unless collapsed

我的梦境 提交于 2019-11-27 08:01:27
With the new Design Library, we're supposed to set the toolbar title on the CollapsingToolbarLayout , not the Toolbar itself(at least when using the collapsing toolbar). But setTitle() only updates the title in the following specific circumstances: 1) When the CollapsingToolbarLayout does not have a title yet 2) At the moment the CollapsingToolbarLayout becomes fully collapsed 3) At the moment the CollapsingToolbarLayout starts to expand What I'm actually trying to do is make the title become an EditText when fully expanded, allowing the user to give his/her character a name, which then

Android design support library with Theme.Material

点点圈 提交于 2019-11-27 07:12:02
问题 I would like to use the new design support library in my application beginning with the API 21. I want to use Theme.Material style but it's work only with Theme.AppCompat style. When I use Theme.Material, android return this error: error inflating class android.support.design.widget.textinputlayout" How can I resolve it ? Thank you in advance Ps: Sorry for my bad english, i'm french. UPDATE: Here is my code styles.xml <style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">

CoordinatorLayout using the ViewPager's RecyclerView

北城余情 提交于 2019-11-27 06:43:53
I am using the view CoordinatorLayout from android.support.design . I want to attach the app:layout_behavior to the fragment's RecyclerView ? In the example given by Google, they only attach it in the RecyclerView of the same XML file where the CoordinatorLayout was attached. Is there a way to attach CoordinatorLayout to the fragment's RecyclerView within the ViewPager ? The sample is in this blog post at Android Developers blog. androholic Chris Banes has posted a sample on Github which shows exactly what you want to do. Here is the xml file that defines how one can indirectly attach a

onClick method not working properly after NestedScrollView scrolled

╄→гoц情女王★ 提交于 2019-11-27 06:33:56
I used NestedScrollView with CoordinatorLayout to enable scroll animation for Toolbar (by app:layout_scrollFlags="scroll|enterAlways"). NestedScrollView contain the LinearLayout as the root child, I put the 2 TextViews into LinearLayout to enable expand/collapse animation. The one was set Visible and other one was set to Gone. And switching visibility by onClick event of LinearLayout Normally, everything work as expected but when I scrolled the NestedScrollView the onClick event not working properly. I need double click after scroll to get expand/collapse animation Does anyone have same

FloatingActionButton, square button below API level 17

丶灬走出姿态 提交于 2019-11-27 06:10:03
问题 I am using android.support.design.widget.FloatingActionButton from the new Design Support library 22.2.0, in my layout file. It is working fine but it shows a square button below API level 17 回答1: This is known by Google and will be fix soon in the next version of the Design Support Library, see this issue: FAB Appears as a square on API 16. It should only concern API 16. The workaround, proposed in the same thread, is to add app:borderWidth="0dp" to your FAB. 回答2: Finally the issue has been

how to change color of TextinputLayout's label and edittext underline android

梦想的初衷 提交于 2019-11-27 05:56:07
I am using android design library's TextinputLayout . But couldn't customize the hint color, label color and the underline color of EditText inside TextinputLayout . Please help. Pankaj Arora To change bottom line color, you can use this in your app theme: <item name="colorControlNormal">#c5c5c5</item> <item name="colorControlActivated">@color/accent</item> <item name="colorControlHighlight">@color/accent</item> For more info, Check THIS THREAD . To change floating label color <style name="TextAppearance.App.TextInputLayout" parent="@android:style/TextAppearance"> <item name="android:textColor

NestedScrollView and CoordinatorLayout. Issue on Scrolling

久未见 提交于 2019-11-27 05:24:06
问题 I have a strange issue with the CoordinatorLayout and the NestedScrollView (with the design support library 22.2.0) Using a content smaller than NestedScrollView I should have a fixed content. However trying to scroll up and down the content I can obtain that the content is displaced and never again in their own place. Here a little sample: Here the code: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas

CoordinatorLayout with RecyclerView & CollapsingToolbarLayout

夙愿已清 提交于 2019-11-27 05:09:01
问题 I've been attempting to implement a CollapsingToolbar with a RecyclerView using the small amount of guidance here: http://android-developers.blogspot.co.uk/2015/05/android-design-support-library.html and the project here: https://github.com/chrisbanes/cheesesquare, and I currently have the following layout: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main