1) The toolbar is not displayed.
First of all, you need to determine which toolbar you want to use in your activity class:
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar);
Modify existing xml code:
<android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorPrimary" app:title="@string/app_name" app:layout_collapseMode="parallax"> </android.support.v7.widget.Toolbar>
in
<android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" //set initial height app:popupTheme="@style/ThemeOverlay.AppCompat.Light" //this might be also useful app:title="@string/app_name" app:layout_collapseMode="parallax" />
2) Collapsing the toolbar does not collapse at all.
Has your activity been used correctly. Install on your AppBarLayout :
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
like in this example: include_list_viewpager.xml
3) Viewpager and FAB are also not visible if placed inside nestedScrollView.
There is no reason for this. Adding these lines:
android:layout_marginTop="?attr/actionBarSize" app:layout_behavior="@string/appbar_scrolling_view_behavior"
Up ViewPager should be enough.
Both of these must be direct children of the CoordinatorLayout .
Follow this example: http://blog.nkdroidsolutions.com/collapsing-toolbar-with-tabs-android-example/
If you are new to Material Design or feel a little lost with some of his behavior, I highly recommend checking out the Chris Banes Material Design cheesequare design cheesequare : https://github.com/chrisbanes/cheesesquare/
Hope this helps