android-coordinatorlayout

ListView not expanding inside NestedScrollView

倾然丶 夕夏残阳落幕 提交于 2019-11-28 17:49:35
I am using CoordinatorLayout in my activity page. In that there is ListView below the app bar. But its not working when I use ListView instead of NestedScrollView . And if I put ListView inside NestedScrollView , ListView is not expanding For the CoordinatorLayout to work properly you need the scrolling child to implement NestedScrollingChild . Such classes are NestedScrollView and RecyclerView . To say it short - just use a RecyclerView for your scrolling content and it'll work correctly :) P.S. As a side note, I don't see a reason why you'd use a ListView anymore. I know it's a habit and it

Hide FloatingActionButton on scroll of RecyclerView

你离开我真会死。 提交于 2019-11-28 17:47:43
I want to hide/show FloatingActionButton on scroll of RecyclerView . My XML layout : <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v7.widget.RecyclerView android:id="@+id/recyclerview_eventlist" android:layout_width="match_parent" android:layout_height="match_parent" /> <android.support.design.widget.FloatingActionButton android:id="@+id/fab_createevent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/fab_margin" app:layout_anchor="@id

Show view when toolbar collapses

[亡魂溺海] 提交于 2019-11-28 17:22:36
问题 I have an activity with a CoordinatorLayout , AppBarLayout , CollapsingToolbarLayout and Toolbar . So, basically, a view that collapses when scrolling a RecyclerView . What I need to do is to show a custom view when the view of the expanded layout is hidden due to collapsing. This is my 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:layout_width="match_parent"

Android alphabetical fast scrollview in RecyclerView with Collapsing toolbar

会有一股神秘感。 提交于 2019-11-28 17:01:41
问题 In my application I have activity_main.xml like this:- <Coordinator Layout> <AppBarLayout> <CollapsingToolbarLayout> <ImageView/> <Toolbar/> </CollapsingToolbarLayout> </AppBarLayout> <RecyclerView/> </Coordinating Layout> Layout.xml ----->>> <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:ads="http://schemas.android.com/apk/res-auto" android:layout

Where should 'app:layout_behavior' be set?

老子叫甜甜 提交于 2019-11-28 16:43:28
Should it be set at the AppBarLayout sibling's parent or at the first Scrollable View inside its sibling? With Material Design for Android , there are Views that let us work with the behavior of the layout depending on its surroundings, one of them is the CoordinatorLayout , as this CodePath guide mentions: CoordinatorLayout extends the ability to accomplish many of the Google's Material Design scrolling effects. Currently, there are several ways provided in this framework that allow it to work without needing to write your own custom animation code. The one I'm interested in now is: Expanding

What is CoordinatorLayout?

北慕城南 提交于 2019-11-28 16:36:33
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 learning CoordinatorLayout . Here it is you are looking for. from docs the Design library introduces

How to set app:layout_scrollFlags for Toolbar programmatically

混江龙づ霸主 提交于 2019-11-28 16:35:54
问题 My app have a viewpager and 4 tabs, each tab have many fragment. But I just want my Toolbar scroll up/down while scrolling recyclerview in 2 specific tabs. But I don't know how to block Toolbar scroll for other tabs. I tried to import toolbar for each fragment but it seems I can't do it. Anyone have idea to solve this problem? 回答1: I'd strongly recommend against changing the scrolling flags based on what tab is selected - having the Toolbar automatically return (and the content move down)

CoordinatorLayout not drawing behind status bar even with windowTranslucentStatus and fitsSystemWindows

折月煮酒 提交于 2019-11-28 16:30:28
问题 I am trying to draw views behind the status bar like this: I tried to produce this effect with the recommended techniques, but I get this: It's clear from the screenshot that none of my app content is being drawn behind the status bar. What's interesting is that somehow, the Nav Drawer manages to draw behind the status bar: Stuff I did: Use support library widgets - CoordinatorLayout , AppBarLayout , Toolbar , DrawerLayout windowTranslucentStatus set to true in my app theme fitsSystemWindows

Overlaying content above AppBarLayout using new Material Design

无人久伴 提交于 2019-11-28 16:28:54
问题 I want to achieve something like that. (not the FAB or the Snackbar). How can i create a layout, overlaying the AppBarLayout? Like this! (For Example) Like Play Store: My AppBarLayout with CoordinatorLayout and NestedScrollView with RelativeLayout as content looks like this: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@

Toolbar in AppBarLayout is scrollable although RecyclerView has not enough content to scroll

只愿长相守 提交于 2019-11-28 16:03:36
Is it really intended that the Toolbar in a AppBarLayout is scrollable although the main container with the "appbar_scrolling_view_behavior" has not enough content to really scroll? What I have tested so far: When I use a NestedScrollView (with "wrap_content" attribute) as main container and a TextView as child, the AppBarLayout works properly and does not scroll. However, when I use a RecyclerView with only a few entries and the "wrap_content" attribute (so that there is no need to scroll), the Toolbar in the AppBarLayout is scrollable even though the RecyclerView never receives a scroll