Posts Tagged ‘CoordinatorLayout’

Hello Droids šŸ™‚

Want to makeĀ Profile screen more smooth with use of CoordinatorLayout?

Like this one :
device-2017-03-10-153458

Check out my snippet :Ā https://bitbucket.org/snippets/rahul_devdigital/Leng7

Which works like :

 

Keep coding!

Advertisements

Hello all,

After getting so many +1 over stackoverflow for my answer on the question :Ā How to use RecyclerView inside NestedScrollView?

You can add RecyclerView without adding it into NestedScrollView. How? Here is the trick:

<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:layout_width="match_parent"
 android:layout_height="match_parent" android:fitsSystemWindows="true">

<android.support.design.widget.AppBarLayout android:layout_height="wrap_content"
 android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay">

 <android.support.v7.widget.Toolbar
 android:layout_width="match_parent"
 android:layout_height="?attr/actionBarSize"
 android:background="?attr/colorPrimary"
 app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
 app:layout_behavior="@string/appbar_scrolling_view_behavior"
 android:layout_width="match_parent"
 android:layout_height="wrap_content" />
</android.support.design.widget.CoordinatorLayout>

The key thing here is :

 app:layout_behavior="@string/appbar_scrolling_view_behavior" 

Have fun! Keep Coding!