Using windowTranslucentStatus with CollapsingToolbarLayout

There has now been an update to the design library. I’m guessing that the issue posted above was a bug. If you update the design library to the latest version this issue no longer occurs. I have now removed all fitsSystemWindows=”true” except for the ImageView (as that needs to display under the status bar). I … Read more

NestedScrollView and CoordinatorLayout. Issue on Scrolling

This can also be observed in the cheesesquare demo when removing all but one card in the details fragment. I was able to solve this (for now) using this class: https://gist.github.com/EmmanuelVinas/c598292f43713c75d18e <android.support.v4.widget.NestedScrollView android:layout_width=”match_parent” android:layout_height=”match_parent” app:layout_behavior=”com.evs.demo.layout.FixedScrollingViewBehavior”> ….. </android.support.v4.widget.NestedScrollView>

Scroll behavior in nested RecyclerView with horizontal scroll

As requested here is the solution I found good enough so far: In my case I have a nestedScrollView with 4 RecyclerViews set to scroll horizontally inside. For each of those RecyclerViews I have done this programatically: restaurantsRecylerView.setHasFixedSize(true); restaurantsRecylerView.setNestedScrollingEnabled(false); You probably don’t want the fixedSize, not sure if it will make any difference, my list … Read more

How to get Adview below Viewpager in CoordinatorLayout

You can add ViewPager and AdView inside RelativeLayout and specify android:layout_above=”@+id/adView” property to ViewPager so that adView doesn’t block the ViewPager contents. <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:ads=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”com.candyx.testapp.Activity”> <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_content” android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_above=”@+id/adView”> <android.support.design.widget.AppBarLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”@drawable/main_button_background”> <android.support.v7.widget.Toolbar xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”?attr/actionBarSize” app:layout_scrollFlags=”scroll|enterAlways”/> <android.support.design.widget.TabLayout android:id=”@+id/tabs” android:layout_width=”match_parent” android:layout_height=”wrap_content” app:tabMode=”scrollable” app:tabGravity=”fill” app:tabIndicatorColor=”@color/colorTabIndicator” app:tabIndicatorHeight=”3dp”/> … Read more

CoordinatorLayout inside another CoordinatorLayout

I know it’s an old question. But I searched a long time to include an CoordinatorLayout in a fragment, which is in another CoordinatorLayout. I modified the answer of dev.bmax a little bit to call both coordinator layouts and call the attached behaviors of both layouts. So here is my solution. @SuppressWarnings(“unused”) public class NestedCoordinatorLayout … Read more

ListView not expanding inside NestedScrollView

you can fix it when you add addtribute android:fillViewport=”true” in android.support.v4.widget.NestedScrollView 🙂 . This my code. <android.support.v4.widget.NestedScrollView android:layout_width=”match_parent” android:layout_height=”match_parent” android:scrollbars=”none” app:layout_behavior=”@string/appbar_scrolling_view_behavior” android:fillViewport=”true” > <ListView android:id=”@+id/list_myContent” android:layout_width=”match_parent” android:layout_height=”match_parent” android:scrollbars=”vertical” > </ListView> </android.support.v4.widget.NestedScrollView>

CoordinatorLayout with RecyclerView And Collapsing header

You can achieve it by having this 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:layout_height=”match_parent”> <android.support.design.widget.AppBarLayout android:layout_width=”match_parent” android:layout_height=”wrap_content”> <android.support.design.widget.CollapsingToolbarLayout android:layout_width=”match_parent” android:layout_height=”match_parent” app:layout_scrollFlags=”scroll|exitUntilCollapsed”> <!– HEADER –> <RelativeLayout … app:layout_collapseMode=”parallax”> ….. </RelativeLayout> <android.support.v7.widget.Toolbar android:layout_width=”match_parent” android:layout_height=”?attr/actionBarSize” app:layout_collapseMode=”pin” /> </android.support.design.widget.CollapsingToolbarLayout> <!– IF YOU WANT TO KEEP “Choose Item” always on top of the RecyclerView, put this TextView here <TextView android:layout_width=”match_parent” android:layout_height=”wrap_content” … Read more

Where should ‘app:layout_behavior’ be set?

Check this link: https://developer.android.com/reference/android/support/design/widget/AppBarLayout.html AppBarLayout also requires a separate scrolling sibling in order to know when to scroll. The binding is done through the AppBarLayout.ScrollingViewBehavior class, meaning that you should set your scrolling view’s behavior to be an instance of AppBarLayout.ScrollingViewBehavior. A string resource containing the full class name is available. They mentioned about that, … Read more

tech