I am using CollapsingToolbarLayout in my app and everything working great except displaying toolbar icons when the CollapsingToolbarLayout collapse.These menu items, they are showing correctly when the CollapsingToolbarLayout expand. But getting hide when the CollapsingToolbarLayout collapse. I want to show them even when it is in the collapse position.
My xml....
<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="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.ViewDetailsActivity">
<android.support.design.widget.AppBarLayout
android:id="#+id/MyAppbar"
android:layout_width="match_parent"
android:layout_height="#dimen/_180sdp"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapse_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/material_deep_teal_500"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="#+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="pin" />
<com.tbuonomo.viewpagerdotsindicator.DotsIndicator
android:id="#+id/dots_indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:gravity="bottom|center"
android:padding="#dimen/_8sdp"
app:dotsColor="#color/white"
app:dotsCornerRadius="#dimen/_6sdp"
app:dotsSize="#dimen/_8sdp"
app:dotsSpacing="#dimen/_2sdp"
app:dotsWidthFactor="2"
app:progressMode="true" />
</RelativeLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/MyToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="parallax" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
android:background="#ffffff"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="#+id/fullLinearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="#dimen/_4sdp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="#dimen/_2sdp"
android:weightSum="3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="bottom">
<TextView
android:id="#+id/priceTxt"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="#font/quicksand_medium"
android:gravity="bottom"
android:textColor="#color/black"
android:textSize="#dimen/_16ssp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="bottom">
<TextView
android:id="#+id/bedTxt"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="#+id/typeTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="#dimen/_2sdp"
android:paddingTop="#dimen/_1sdp"
android:paddingEnd="#dimen/_2sdp"
android:paddingBottom="#dimen/_1sdp"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
<TextView
android:id="#+id/addressTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="#dimen/_2sdp"
android:paddingTop="#dimen/_1sdp"
android:paddingEnd="#dimen/_2sdp"
android:paddingBottom="#dimen/_2sdp"
android:textSize="#dimen/_12ssp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_5sdp">
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/details_spin_kit"
style="#style/SpinKitView.FadingCircle"
android:layout_width="#dimen/_40sdp"
android:layout_height="#dimen/_40sdp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:padding="#dimen/_5sdp"
app:SpinKit_Color="#color/colorAccent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:text="Facts"
android:textColor="#color/black"
android:textSize="#dimen/_16ssp"
android:textStyle="bold"
tools:fontFamily="#font/raleway" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_4sdp"
android:baselineAligned="false"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:text="Reference"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:text="RERA permit No."
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:text="Type"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:text="Bedrooms"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:text="Bathrooms"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:text="Price"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:text="Area"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="#+id/txtRef"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtRera"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtBedRooms"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtBathrooms"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtPrice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtArea"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_5sdp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:text="Amenities"
android:textColor="#color/black"
android:textSize="#dimen/_16ssp"
android:textStyle="bold"
tools:fontFamily="#font/raleway" />
<android.support.v7.widget.RecyclerView
android:id="#+id/amenityRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_2sdp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_5sdp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:text="About the area"
android:textColor="#color/black"
android:textSize="#dimen/_16ssp"
android:textStyle="bold"
tools:fontFamily="#font/raleway" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_4sdp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:text="Region"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:text="City"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:text="District"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="#+id/txtCity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtDistrict"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtProvince"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:padding="#dimen/_2sdp"
android:textColor="#color/black"
android:textSize="#dimen/_12ssp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_100sdp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/raleway"
android:text="Property description"
android:textColor="#color/black"
android:textSize="#dimen/_16ssp"
android:textStyle="bold"
tools:fontFamily="#font/raleway" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/_4sdp">
<WebView
android:id="#+id/descriptionWebView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<LinearLayout
android:id="#+id/commLinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#drawable/layout_shadow"
android:gravity="bottom"
android:weightSum="3">
<LinearLayout
android:id="#+id/layoutEmail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/_2sdp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:padding="#dimen/_2sdp">
<ImageView
android:layout_width="match_parent"
android:layout_height="#dimen/_20sdp"
android:src="#drawable/email" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="EMAIL"
android:textColor="#F84242"
android:textSize="#dimen/_8ssp" />
</LinearLayout>
<LinearLayout
android:id="#+id/layoutSms"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/_2sdp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:padding="#dimen/_2sdp">
<ImageView
android:layout_width="match_parent"
android:layout_height="#dimen/_20sdp"
android:src="#drawable/sms" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="SMS"
android:textColor="#F84242"
android:textSize="#dimen/_8ssp" />
</LinearLayout>
<LinearLayout
android:id="#+id/layoutCaller"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/_2sdp"
android:layout_weight="1"
android:autoLink="phone"
android:gravity="center"
android:orientation="vertical"
android:padding="#dimen/_2sdp">
<ImageView
android:layout_width="match_parent"
android:layout_height="#dimen/_20sdp"
android:src="#drawable/call" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="CALL"
android:textColor="#F84242"
android:textSize="#dimen/_8ssp" />
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
Add this line to your toolbar
app:layout_collapseMode="pin"
Your toolbar should look like this:
<android.support.v7.widget.Toolbar
android:id="#+id/MyToolbar"
app:layout_collapseMode="pin"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="parallax" />
Related
I want to use scrollview inside linearlayout and want to scroll particular this layout but it is not working.this is my code
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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:scrollbars="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="#layout/activity_custom_action_bar" />
<LinearLayout
android:id="#+id/ll_client_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/dp15"
android:background="#drawable/rounded_layout_white"
android:orientation="horizontal"
android:padding="#dimen/dp5"
android:weightSum="1">
<ImageView
android:layout_width="#dimen/dp0"
android:layout_height="match_parent"
android:layout_weight="0.1"
android:src="#drawable/img_user_icon" />
<TextView
android:id="#+id/tv_client_name"
android:layout_width="#dimen/dp0"
android:layout_height="match_parent"
android:layout_weight="0.9"
android:gravity="left|center"
android:padding="#dimen/dp10"
android:text=""
android:textColor="#color/colorLightBlue"
android:textSize="#dimen/dp12"
android:textStyle="bold"
/>
</LinearLayout>
<ProgressBar
android:id="#+id/progressBar"
android:layout_width="match_parent"
android:layout_height="#dimen/dp50"
android:theme="#style/AppTheme.WhiteAccent"
android:visibility="visible" />
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ListView
android:id="#+id/lst_client_scheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/dp10"
android:layout_marginTop="#dimen/dp20"
android:layout_marginRight="#dimen/dp10"
android:background="#color/colorGray"
android:dividerHeight="0sp"
android:scrollbars="vertical"
android:visibility="visible"></ListView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="#dimen/dp300"
android:layout_marginLeft="#dimen/dp10"
android:layout_marginTop="#dimen/dp10"
android:layout_marginRight="#dimen/dp10"
android:background="#android:color/darker_gray"
android:orientation="vertical">
<TextView
android:id="#+id/tv_summary_date"
android:layout_width="match_parent"
android:layout_height="#dimen/dp25"
android:layout_marginTop="#dimen/dp20"
android:background="#android:color/darker_gray"
android:gravity="center"
android:text=""
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12" />
<View
android:layout_width="match_parent"
android:layout_height="#dimen/dp2"
android:background="#color/colorWhite" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="1">
<LinearLayout
android:layout_width="#dimen/dp0"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:gravity="center"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="#dimen/dp30"
android:gravity="right"
android:text="Total Amount Invested"
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_total_invst_amt"
android:layout_width="wrap_content"
android:layout_height="#dimen/dp40"
android:layout_marginTop="#dimen/dp5"
android:background="#drawable/corner_border"
android:gravity="center|right"
android:padding="#dimen/dp5"
android:text="9,857.51"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/dp5"
android:gravity="right"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="#dimen/dp30"
android:gravity="right"
android:text="Total Current Amount"
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_total_Curr_val"
android:layout_width="wrap_content"
android:layout_height="#dimen/dp40"
android:layout_marginTop="#dimen/dp5"
android:background="#drawable/corner_border"
android:gravity="center|right"
android:padding="#dimen/dp5"
android:text="9,857.51"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="#dimen/dp2"
android:layout_height="match_parent"
android:layout_marginLeft="#dimen/dp3"
android:background="#color/colorWhite" />
<LinearLayout
android:layout_width="#dimen/dp0"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:gravity="top"
android:orientation="vertical"
android:weightSum="5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="0.5"
android:gravity="right|center"
android:padding="#dimen/dp5"
android:text="Total Gain/Loss ST"
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_total_gl_St"
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="0.5"
android:gravity="center|right"
android:padding="#dimen/dp5"
android:text=""
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="#dimen/dp2"
android:background="#color/colorWhite" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="0.5"
android:gravity="right|center"
android:padding="#dimen/dp5"
android:text="Total Gain/Loss LT"
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_total_gl_lt"
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="0.5"
android:gravity="center|right"
android:padding="#dimen/dp5"
android:text=""
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="#dimen/dp2"
android:background="#color/colorWhite" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="0.5"
android:gravity="right|center"
android:padding="#dimen/dp5"
android:text="Total Dividend Reinvest"
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_total_div_amt"
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="0.5"
android:gravity="center|right"
android:padding="#dimen/dp5"
android:text=""
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="#dimen/dp2"
android:background="#color/colorWhite" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="0.5"
android:gravity="right|center"
android:padding="#dimen/dp5"
android:text="Total Ret ABS"
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_ret_abs"
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="0.5"
android:gravity="center|right"
android:padding="#dimen/dp5"
android:text=""
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="#dimen/dp2"
android:background="#color/colorWhite" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="1"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="0.5"
android:gravity="right|center"
android:padding="#dimen/dp5"
android:text="Total Weg. CAGR"
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_weg_cagr"
android:layout_width="match_parent"
android:layout_height="#dimen/dp0"
android:layout_weight="0.5"
android:gravity="center|right"
android:padding="#dimen/dp5"
android:text=""
android:textColor="#color/colorWhite"
android:textSize="#dimen/dp12"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</LinearLayout>
</ScrollView>
How I modify this code to scroll layout? I want to scroll particular layout inside the main linear layout.is it fine? guide me over this.is this code is ok?
How I use scroll view inside the linear layout.
You can put your nested scroll view in parent.
Use NestedScrollView inside another scrolling view
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
</android.support.v4.widget.NestedScrollView>
Surround the layout which you want to make scrollable with ScrollView and set orientation to vertical or vertical.In your code,remove nested scroll view and try once
I am trying to show the layout properly but sometimes it's not showing properly I don't know what is happening i'll try but don't find any problem.
output that i am getting sometimes
when i scroll it's work fine again please help me why I am getting this output sometimes
this is my layout resource file :
<?xml version="1.0" encoding="utf-8"?>
<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"
tools:context=".activity.MainActivity"
android:background="#color/white">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:id="#+id/appbar"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:id="#+id/ctolbar"
android:fitsSystemWindows="true"
app:contentScrim="#color/colorPrimary"
app:expandedTitleMargin="5dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/_200sdp"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/layout_top"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="#+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<me.relex.circleindicator.CircleIndicator
android:id="#+id/indicator"
android:layout_width="match_parent"
android:layout_height="#dimen/_48sdp"
android:layout_gravity="bottom"
app:ci_animator="#animator/indicator_animator"
app:ci_animator_reverse="#animator/indicator_animator_reverse"
app:ci_drawable="#drawable/black_radius_square"
app:ci_height="#dimen/_4sdp"
app:ci_margin="#dimen/_6sdp"
android:layout_marginBottom="#dimen/_5sdp"
app:ci_width="#dimen/_10sdp"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
</RelativeLayout>
<!--<View
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_gravity="bottom"
android:background="#drawable/scrim"/>-->
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:textSize="#dimen/_2sdp"
android:textColor="#4D212121"
android:text="MM" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:id="#+id/nested"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:layout_marginBottom="#dimen/_45sdp"
app:behavior_overlapTop="#dimen/_34sdp"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/lnmain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:layout_marginTop="#dimen/_15sdp"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/rlsearch"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true">
<EditText
android:id="#+id/editsearch"
android:layout_width="match_parent"
android:layout_height="#dimen/_40sdp"
android:background="#drawable/search_edittext"
android:hint="Search Events"
android:shadowColor = "#39ffff"
android:focusableInTouchMode="true"
android:maxLength="100"
android:paddingLeft="#dimen/_10sdp"
android:paddingRight="#dimen/_10sdp"
android:layout_marginRight="#dimen/_5sdp"
android:layout_marginLeft="#dimen/_5sdp"
android:textColor="#color/black"
android:singleLine="true"
android:imeOptions="actionDone"
android:drawableRight="#drawable/ic_search_black_24dp"
android:layout_marginBottom="#dimen/_5sdp"/>
</RelativeLayout>
<LinearLayout
android:id="#+id/lnweekend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvweekend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Popular This Weekend"/>
<TextView
android:id="#+id/tvweekendviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvweekend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/lnevents"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvevents"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Popular Events"/>
<TextView
android:id="#+id/tveventsviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvevents"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/lnconcert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvconsert"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Trending Concerts"/>
<TextView
android:id="#+id/tvconsertviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvconcert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/lnsport"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvsport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Trending Sports"/>
<TextView
android:id="#+id/tvsportviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvsports"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
<!--<android.support.v7.widget.RecyclerView
android:id="#+id/rvsports"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:scrollbars="horizontal" />-->
</LinearLayout>
<LinearLayout
android:id="#+id/lntheater"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvtheater"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Trending Theater"/>
<TextView
android:id="#+id/tvtheaterviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvtheater"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
<!--<android.support.v7.widget.RecyclerView
android:id="#+id/rvtheater"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:scrollbars="horizontal" />-->
</LinearLayout>
<LinearLayout
android:id="#+id/lnother"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvother"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Trending Other"/>
<TextView
android:id="#+id/tvotherviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvother"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
<!--<android.support.v7.widget.RecyclerView
android:id="#+id/rvother"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:scrollbars="horizontal" />-->
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textSize="#dimen/_2sdp"
android:textColor="#4D212121"
android:text="MM" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<ProgressBar
android:visibility="gone"
android:id="#+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:layout_gravity="center"
android:indeterminateTint="#color/colorPrimary"
android:layout_centerVertical="true" />
<io.saeid.fabloading.LoadingView
android:id="#+id/loading_view_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:mfl_onclickLoading="true"
android:layout_gravity="center"
android:visibility="visible"
android:scaleX="1"
android:scaleY="1"
app:mfl_duration="400"
app:mfl_repeat="100" />
<LinearLayout
android:id="#+id/lnloading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:layout_marginTop="#dimen/_80sdp"
android:visibility="visible"
android:orientation="horizontal">
<TextView
android:id="#+id/tvloading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/loading"
android:textColor="#color/black"
android:layout_marginRight="#dimen/_5sdp"
android:textStyle="bold"
android:textSize="#dimen/_10sdp"/>
<com.bhargavms.dotloader.DotLoader
android:layout_width="wrap_content"
android:layout_height="#dimen/_10sdp"
app:dot_radius="#dimen/_2sdp"
app:color_array="#array/dot_colors"
android:layout_gravity="bottom"
app:number_of_dots="3"/>
</LinearLayout>
<RelativeLayout
android:id="#+id/rlerror"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_gravity="center">
<ImageView
android:id="#+id/imgerror"
android:layout_width="#dimen/_125sdp"
android:layout_height="#dimen/_125sdp"
android:visibility="visible"
android:layout_centerHorizontal="true"
android:background="#drawable/no_conncectionp" />
<TextView
android:id="#+id/tverror"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
android:textColor="#color/black"
android:textStyle="bold"
android:layout_centerHorizontal="true"
android:textSize="#dimen/_18sdp"
android:layout_marginTop="#dimen/_10sdp"
android:layout_below="#id/imgerror"
android:text="Whoops" />
<TextView
android:id="#+id/tvstatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
android:textColor="#color/text"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/_10sdp"
android:layout_gravity="center_horizontal"
android:textSize="#dimen/album_title"
android:layout_below="#id/tverror"
android:text="No Data" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/bottomnavigation"
android:layout_width="match_parent"
android:layout_height="#dimen/_45sdp"
android:layout_gravity="bottom"
android:layout_alignParentBottom="true">
<com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
android:id="#+id/bottomNavViewBar"
android:layout_width="match_parent"
android:layout_height="#dimen/_43sdp"
android:layout_alignParentBottom="true"
android:background="#android:color/white"
app:itemIconTint="#color/selector_item_primary_color"
app:itemTextColor="#color/selector_item_primary_color"
app:menu="#menu/bottom_navigation_menu_3" />
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
I tried everything but i don't understand why is this happening.
try using putting an anchor to your nestedscrollview
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/nested"
android:layout_marginBottom="#dimen/_45sdp"
app:behavior_overlapTop="#dimen/_34sdp"
app:layout_anchor="#id/appbar"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
and why your CollapsingToolbarLayout have height=matchparent
I am trying to show the layout properly but sometimes it's not showing properly I don't know what is happening i'll try but don't find any problem.
output that i am getting some times
when i scroll it's work fine again please help me why I am getting this output sometimes
this is my layout resource file :
<?xml version="1.0" encoding="utf-8"?>
<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"
tools:context=".activity.MainActivity"
android:background="#color/white">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:id="#+id/appbar"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:id="#+id/ctolbar"
android:fitsSystemWindows="true"
app:contentScrim="#color/colorPrimary"
app:expandedTitleMargin="5dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/_200sdp"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/layout_top"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="#+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<me.relex.circleindicator.CircleIndicator
android:id="#+id/indicator"
android:layout_width="match_parent"
android:layout_height="#dimen/_48sdp"
android:layout_gravity="bottom"
app:ci_animator="#animator/indicator_animator"
app:ci_animator_reverse="#animator/indicator_animator_reverse"
app:ci_drawable="#drawable/black_radius_square"
app:ci_height="#dimen/_4sdp"
app:ci_margin="#dimen/_6sdp"
android:layout_marginBottom="#dimen/_5sdp"
app:ci_width="#dimen/_10sdp"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
</RelativeLayout>
<!--<View
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_gravity="bottom"
android:background="#drawable/scrim"/>-->
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:textSize="#dimen/_2sdp"
android:textColor="#4D212121"
android:text="MM" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:id="#+id/nested"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:layout_marginBottom="#dimen/_45sdp"
app:behavior_overlapTop="#dimen/_34sdp"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/lnmain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:layout_marginTop="#dimen/_15sdp"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/rlsearch"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true">
<EditText
android:id="#+id/editsearch"
android:layout_width="match_parent"
android:layout_height="#dimen/_40sdp"
android:background="#drawable/search_edittext"
android:hint="Search Events"
android:shadowColor = "#39ffff"
android:focusableInTouchMode="true"
android:maxLength="100"
android:paddingLeft="#dimen/_10sdp"
android:paddingRight="#dimen/_10sdp"
android:layout_marginRight="#dimen/_5sdp"
android:layout_marginLeft="#dimen/_5sdp"
android:textColor="#color/black"
android:singleLine="true"
android:imeOptions="actionDone"
android:drawableRight="#drawable/ic_search_black_24dp"
android:layout_marginBottom="#dimen/_5sdp"/>
</RelativeLayout>
<LinearLayout
android:id="#+id/lnweekend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvweekend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Popular This Weekend"/>
<TextView
android:id="#+id/tvweekendviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvweekend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/lnevents"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvevents"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Popular Events"/>
<TextView
android:id="#+id/tveventsviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvevents"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/lnconcert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvconsert"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Trending Concerts"/>
<TextView
android:id="#+id/tvconsertviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvconcert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/lnsport"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvsport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Trending Sports"/>
<TextView
android:id="#+id/tvsportviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvsports"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
<!--<android.support.v7.widget.RecyclerView
android:id="#+id/rvsports"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:scrollbars="horizontal" />-->
</LinearLayout>
<LinearLayout
android:id="#+id/lntheater"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvtheater"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Trending Theater"/>
<TextView
android:id="#+id/tvtheaterviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvtheater"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
<!--<android.support.v7.widget.RecyclerView
android:id="#+id/rvtheater"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:scrollbars="horizontal" />-->
</LinearLayout>
<LinearLayout
android:id="#+id/lnother"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="#dimen/_10sdp"
android:layout_marginLeft="#dimen/_10sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_marginBottom="#dimen/_5sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_10sdp"
android:orientation="horizontal">
<TextView
android:id="#+id/tvother"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:textSize="#dimen/_15sdp"
android:textColor="#color/black"
android:text="Trending Other"/>
<TextView
android:id="#+id/tvotherviewmore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="1"
android:layout_gravity="right|center_vertical"
android:textColor="#color/text"
android:textSize="#dimen/_10sdp"
android:text="#string/more"/>
</LinearLayout>
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="#+id/rvother"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_ms_per_inch="#dimen/normal_speed"
app:msrv_snap_count="1" />
<!--<android.support.v7.widget.RecyclerView
android:id="#+id/rvother"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:scrollbars="horizontal" />-->
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textSize="#dimen/_2sdp"
android:textColor="#4D212121"
android:text="MM" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<ProgressBar
android:visibility="gone"
android:id="#+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:layout_gravity="center"
android:indeterminateTint="#color/colorPrimary"
android:layout_centerVertical="true" />
<io.saeid.fabloading.LoadingView
android:id="#+id/loading_view_repeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:mfl_onclickLoading="true"
android:layout_gravity="center"
android:visibility="visible"
android:scaleX="1"
android:scaleY="1"
app:mfl_duration="400"
app:mfl_repeat="100" />
<LinearLayout
android:id="#+id/lnloading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:layout_marginTop="#dimen/_80sdp"
android:visibility="visible"
android:orientation="horizontal">
<TextView
android:id="#+id/tvloading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/loading"
android:textColor="#color/black"
android:layout_marginRight="#dimen/_5sdp"
android:textStyle="bold"
android:textSize="#dimen/_10sdp"/>
<com.bhargavms.dotloader.DotLoader
android:layout_width="wrap_content"
android:layout_height="#dimen/_10sdp"
app:dot_radius="#dimen/_2sdp"
app:color_array="#array/dot_colors"
android:layout_gravity="bottom"
app:number_of_dots="3"/>
</LinearLayout>
<RelativeLayout
android:id="#+id/rlerror"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_gravity="center">
<ImageView
android:id="#+id/imgerror"
android:layout_width="#dimen/_125sdp"
android:layout_height="#dimen/_125sdp"
android:visibility="visible"
android:layout_centerHorizontal="true"
android:background="#drawable/no_conncectionp" />
<TextView
android:id="#+id/tverror"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
android:textColor="#color/black"
android:textStyle="bold"
android:layout_centerHorizontal="true"
android:textSize="#dimen/_18sdp"
android:layout_marginTop="#dimen/_10sdp"
android:layout_below="#id/imgerror"
android:text="Whoops" />
<TextView
android:id="#+id/tvstatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
android:textColor="#color/text"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/_10sdp"
android:layout_gravity="center_horizontal"
android:textSize="#dimen/album_title"
android:layout_below="#id/tverror"
android:text="No Data" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/bottomnavigation"
android:layout_width="match_parent"
android:layout_height="#dimen/_45sdp"
android:layout_gravity="bottom"
android:layout_alignParentBottom="true">
<com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
android:id="#+id/bottomNavViewBar"
android:layout_width="match_parent"
android:layout_height="#dimen/_43sdp"
android:layout_alignParentBottom="true"
android:background="#android:color/white"
app:itemIconTint="#color/selector_item_primary_color"
app:itemTextColor="#color/selector_item_primary_color"
app:menu="#menu/bottom_navigation_menu_3" />
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
Please help me I don't know what is wrong with this please suggest me.
Any help would be highly appreciated
please check your NestedScrollView view it's working or not
Below is my xml some of layout is below which is not fit on screen so I have applied ScrollView on parent LinearLayout that linear layout is applied with weight but when I am trying to scroll that layout its not scrolling. Can any one suggest me where and what I am doing wrong why ScrollView is not working on weight LinearLayout ?
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="2"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="#dimen/baseline_grid_7x"
android:paddingRight="#dimen/baseline_grid_7x"
android:paddingTop="#dimen/baseline_grid_7x">
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
app:adapter="#{imageSlideradapter}"
app:currentItem="#{landingLoginViewModel.currentPage}"
android:addOnPageChangeListener="#{landingLoginViewModel.pageChangeListener}"/>
<TextView
android:id="#+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/indicator"
android:fontFamily="sans-serif"
android:gravity="center_horizontal"
android:lineSpacingExtra="#dimen/text_land_spacing"
android:paddingTop="#dimen/layout_padding_top"
android:text="#string/label_businesscard_title"
android:textColor="#3e4360"
android:textSize="#dimen/businees_card_textmessage_size"
android:textStyle="normal" />
<com.viewpagerindicator.CirclePageIndicator
android:id="#+id/indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:paddingTop="#dimen/padding_top_15dp"
app:centered="true"
app:fillColor="#1ebad6"
app:radius="#{landingLoginViewModel.pagerIndicatorCircle}"
app:pageColor="#c6caca"
app:snap="false" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="#dimen/baseline_grid_2.5x"
android:paddingRight="#dimen/baseline_grid_2.5x"
android:paddingTop="#dimen/baseline_grid_5x">
<android.support.v7.widget.AppCompatButton
android:id="#+id/btn_signin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/buttonbackroudnd"
android:onClick="#{()->landingLoginViewModel.onSignIn()}"
android:text="#string/label_sign_in"
android:textColor="#ffffff" />
<android.support.v7.widget.AppCompatButton
android:id="#+id/btn_signup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_signin"
android:layout_marginTop="#dimen/baseline_grid_3.5x"
android:background="#drawable/roundbuttonborder"
android:onClick="#{()->landingLoginViewModel.onSignUp()}"
android:text="#string/label_sign_up"
android:textColor="#00becc" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/oRtextLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_signup"
android:layout_marginTop="#dimen/baseline_grid_5.5x"
android:fontFamily="sans-serif"
android:gravity="center"
android:text="#string/label_or"
android:textColor="#8998a7"
android:textSize="14sp"
android:textStyle="normal"
/>
<LinearLayout
android:id="#+id/linearlayout4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/oRtextLabel"
android:gravity="center"
android:onClick="#{()->landingLoginViewModel.onFacebook()}"
android:orientation="horizontal"
android:layout_marginTop="#dimen/baseline_grid_5x">
<ImageView
android:layout_width="#dimen/baseline_grid_3.5x"
android:layout_height="#dimen/baseline_grid_3.5x"
android:src="#drawable/fb_icon" />
<android.support.v7.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:gravity="center_horizontal"
android:paddingLeft="#dimen/baseline_grid_1x"
android:text="#string/label_fcebook"
android:textColor="#465892"
android:textSize="#dimen/baseline_grid_2x"
android:textStyle="normal"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>
ScrollView is working, please check below layout
Note : changed widgets, heights and paddings and have fixed height for RelativeLayout to check ScrollView
<ScrollView
android:id="#+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="2">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="500dp"
android:paddingLeft="7dp"
android:paddingRight="7dp"
android:paddingTop="7dp">
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="#+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/indicator"
android:fontFamily="sans-serif"
android:gravity="center_horizontal"
android:lineSpacingExtra="5dp"
android:paddingTop="5dp"
android:text="label_businesscard_title"
android:textColor="#3e4360"
android:textSize="5dp"
android:textStyle="normal" />
<android.support.v4.view.ViewPager
android:id="#+id/indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:paddingTop="15dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="500dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="5dp">
<Button
android:id="#+id/btn_signin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="label_sign_in"
android:textColor="#ffffff" />
<Button
android:id="#+id/btn_signup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_signin"
android:layout_marginTop="5dp"
android:text="label_sign_up"
android:textColor="#00becc" />
<TextView
android:id="#+id/oRtextLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_signup"
android:layout_marginTop="7dp"
android:fontFamily="sans-serif"
android:gravity="center"
android:text="label_or"
android:textColor="#8998a7"
android:textSize="14sp"
android:textStyle="normal" />
<LinearLayout
android:id="#+id/linearlayout4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/oRtextLabel"
android:layout_marginTop="5dp"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/ic_launcher_background" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:gravity="center_horizontal"
android:paddingLeft="5dp"
android:text="label_fcebook"
android:textColor="#465892"
android:textSize="16dp"
android:textStyle="normal" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>
Replace your xml with this one:
<RelativeLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:weightSum="2"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
xmlns:android="http://schemas.android.com/apk/res/android">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="2"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="#dimen/baseline_grid_7x"
android:paddingRight="#dimen/baseline_grid_7x"
android:paddingTop="#dimen/baseline_grid_7x">
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
app:adapter="#{imageSlideradapter}"
app:currentItem="#{landingLoginViewModel.currentPage}"
android:addOnPageChangeListener="#{landingLoginViewModel.pageChangeListener}"/>
<TextView
android:id="#+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/indicator"
android:fontFamily="sans-serif"
android:gravity="center_horizontal"
android:lineSpacingExtra="#dimen/text_land_spacing"
android:paddingTop="#dimen/layout_padding_top"
android:text="#string/label_businesscard_title"
android:textColor="#3e4360"
android:textSize="#dimen/businees_card_textmessage_size"
android:textStyle="normal" />
<com.viewpagerindicator.CirclePageIndicator
android:id="#+id/indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:paddingTop="#dimen/padding_top_15dp"
app:centered="true"
app:fillColor="#1ebad6"
app:radius="#{landingLoginViewModel.pagerIndicatorCircle}"
app:pageColor="#c6caca"
app:snap="false" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="#dimen/baseline_grid_2.5x"
android:paddingRight="#dimen/baseline_grid_2.5x"
android:paddingTop="#dimen/baseline_grid_5x">
<android.support.v7.widget.AppCompatButton
android:id="#+id/btn_signin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/buttonbackroudnd"
android:onClick="#{()->landingLoginViewModel.onSignIn()}"
android:text="#string/label_sign_in"
android:textColor="#ffffff" />
<android.support.v7.widget.AppCompatButton
android:id="#+id/btn_signup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_signin"
android:layout_marginTop="#dimen/baseline_grid_3.5x"
android:background="#drawable/roundbuttonborder"
android:onClick="#{()->landingLoginViewModel.onSignUp()}"
android:text="#string/label_sign_up"
android:textColor="#00becc" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/oRtextLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_signup"
android:layout_marginTop="#dimen/baseline_grid_5.5x"
android:fontFamily="sans-serif"
android:gravity="center"
android:text="#string/label_or"
android:textColor="#8998a7"
android:textSize="14sp"
android:textStyle="normal"
/>
<LinearLayout
android:id="#+id/linearlayout4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/oRtextLabel"
android:gravity="center"
android:onClick="#{()->landingLoginViewModel.onFacebook()}"
android:orientation="horizontal"
android:layout_marginTop="#dimen/baseline_grid_5x">
<ImageView
android:layout_width="#dimen/baseline_grid_3.5x"
android:layout_height="#dimen/baseline_grid_3.5x"
android:src="#drawable/fb_icon" />
<android.support.v7.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:gravity="center_horizontal"
android:paddingLeft="#dimen/baseline_grid_1x"
android:text="#string/label_fcebook"
android:textColor="#465892"
android:textSize="#dimen/baseline_grid_2x"
android:textStyle="normal"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>
I have ViewPager:-
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="wrap_content"
android:background="#color/white_color">
<include
android:id="#+id/includeLayout"
layout="#layout/toolbar_main_user_pic" />
<!-- <android.support.v4.widget.NestedScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_above="#+id/footer"
android:layout_below="#+id/includeLayout">
<android.support.design.widget.CoordinatorLayout
android:id="#+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="#dimen/_180sdp">
<RelativeLayout
android:id="#+id/rr"
android:layout_width="match_parent"
android:layout_height="#dimen/_150sdp"
android:background="#000000">
<ImageView
android:id="#+id/img_bg"
android:layout_width="match_parent"
android:layout_height="#dimen/_150sdp"
android:alpha="0.6"
android:scaleType="centerCrop"
android:src="#drawable/car_img" />
<TextView
android:id="#+id/txt_name"
style="#style/Textview_red_11sp_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="#dimen/_5sdp"
android:layout_marginLeft="#dimen/_100sdp"
android:text="#string/deafult_user_name"
android:textColor="#color/white_color" />
<Button
style="#style/ButtonBackground"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="#dimen/_10sdp"
android:layout_marginRight="#dimen/_10sdp"
android:minHeight="0dp"
android:padding="#dimen/_5sdp"
android:text="#string/partecipate" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="#dimen/_5sdp"
android:layout_marginLeft="#dimen/_90sdp"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:layout_width="#dimen/_18sdp"
android:layout_height="#dimen/_18sdp"
android:src="#mipmap/web" />
<TextView
style="#style/Textview_darkgray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="#dimen/_5sdp"
android:text="#string/public_text" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:layout_width="#dimen/_18sdp"
android:layout_height="#dimen/_18sdp"
android:src="#mipmap/approved" />
<TextView
style="#style/Textview_darkgray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="#dimen/_5sdp"
android:text="#string/approved"
android:textSize="#dimen/_10sdp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="#dimen/_18sdp"
android:layout_height="#dimen/_18sdp"
android:src="#mipmap/shareimage" />
<TextView
style="#style/Textview_darkgray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="#dimen/_5sdp"
android:text="#string/share" />
</LinearLayout>
</LinearLayout>
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/user_icon"
android:layout_width="#dimen/_70sdp"
android:layout_height="#dimen/_70sdp"
android:layout_marginLeft="#dimen/_15sdp"
android:src="#mipmap/profile_default"
app:civ_border_color="#color/gray_background_color"
app:civ_border_overlay="true"
app:civ_border_width="#dimen/_5sdp"
app:layout_anchor="#+id/img_bg"
app:layout_anchorGravity="bottom" />
</android.support.design.widget.CoordinatorLayout>
<View
android:id="#+id/view"
android:layout_width="match_parent"
android:layout_height="#dimen/_2sdp"
android:background="#color/gray_background_color" />
<android.support.design.widget.TabLayout
android:id="#+id/tab_host"
style="#style/Tablayout_style" />
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</LinearLayout>
<!-- </android.support.v4.widget.NestedScrollView>-->
<LinearLayout
android:id="#+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<include layout="#layout/bottom_menu_layout" />
</LinearLayout>
<!--</LinearLayout>-->
</RelativeLayout>
Here my viewpager fragment layout:-
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_10sdp"
android:background="#color/white_color"
android:orientation="vertical"
android:paddingLeft="#dimen/_10sdp"
android:layout_marginBottom="#dimen/_10sdp">
<!--<include
layout="#layout/community_fragment_event_moreinfo"></include>-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/img_cal_icon"
android:layout_width="#dimen/_15sdp"
android:layout_height="#dimen/_15sdp"
android:src="#mipmap/timesmall" />
<TextView
android:id="#+id/txt_date"
style="#style/Textview_darkgray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_toRightOf="#+id/img_cal_icon"
android:text="31 November - 02 December" />
<TextView
android:id="#+id/txt_date_details"
style="#style/Textview_gray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_date"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_toRightOf="#+id/img_cal_icon"
android:text="#string/from_december_to_december" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_10sdp">
<ImageView
android:id="#+id/img_location_icon"
android:layout_width="#dimen/_15sdp"
android:layout_height="#dimen/_15sdp"
android:src="#mipmap/location" />
<TextView
android:id="#+id/txt_circuit"
style="#style/Textview_darkgray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_toRightOf="#+id/img_location_icon"
android:text="#string/sepang_international_circuit" />
<TextView
android:id="#+id/txt_circuit_details"
style="#style/Textview_gray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_circuit"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_toRightOf="#+id/img_location_icon"
android:text="#string/sepang_circuit_details" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_10sdp">
<ImageView
android:id="#+id/img_group_icon"
android:layout_width="#dimen/_15sdp"
android:layout_height="#dimen/_15sdp"
android:src="#drawable/group_gray" />
<TextView
android:id="#+id/txt_group"
style="#style/Textview_darkgray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_toRightOf="#+id/img_group_icon"
android:text="#string/pilots" />
<TextView
android:id="#+id/txt_pilots_count"
style="#style/Textview_red_11sp_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_toRightOf="#+id/txt_group"
android:text="231" />
<TextView
android:id="#+id/txt_dets"
style="#style/Textview_darkgray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/txt_pilots_count"
android:text="#string/dets" />
<TextView
android:id="#+id/txt_friends"
style="#style/Textview_darkgray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/txt_dets"
android:text="#string/friends_dets" />
<TextView
android:id="#+id/txt_friends_count"
style="#style/Textview_red_11sp_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_toRightOf="#+id/txt_friends"
android:text="4" />
<TextView
android:id="#+id/txt_friends_out_of"
style="#style/Textview_darkgray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/txt_friends_count"
android:text="/231" />
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_group"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_toRightOf="#+id/img_group_icon" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_10sdp">
<ImageView
android:id="#+id/img_organized_icon"
android:layout_width="#dimen/_15sdp"
android:layout_height="#dimen/_15sdp"
android:src="#mipmap/organized" />
<TextView
android:id="#+id/txt_organized"
style="#style/Textview_darkgray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_toRightOf="#+id/img_organized_icon"
android:text="#string/organized_by" />
<TextView
android:id="#+id/txt_car_name"
style="#style/Textview_red_11sp_bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_organized"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_toRightOf="#+id/img_organized_icon"
android:text="#string/lambnorghini" />
<TextView
android:id="#+id/txt_club_name"
style="#style/Textview_gray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_car_name"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_toRightOf="#+id/img_organized_icon"
android:text="#string/officials_valentino_rossis_club" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rr_dollor_amt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_10sdp">
<ImageView
android:id="#+id/img_dollor_icon"
android:layout_width="#dimen/_15sdp"
android:layout_height="#dimen/_15sdp"
android:src="#mipmap/price" />
<TextView
style="#style/Textview_darkgray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="#dimen/_5sdp"
android:layout_toRightOf="#+id/img_dollor_icon"
android:text="#string/dollor_amt" />
</RelativeLayout>
<View
android:id="#+id/view"
android:layout_width="match_parent"
android:layout_height="#dimen/_2sdp"
android:layout_marginTop="#dimen/_5sdp"
android:background="#color/gray_background_color" />
<TextView
style="#style/Textview_darkgray_11sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_10sdp"
android:text="#string/details" />
<TextView
style="#style/Textview_gray_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/lorem_ipsum" />
<!-- <LinearLayout
android:id="#+id/add_post_info_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_10sdp"
android:background="#color/gray_background_color"
android:orientation="horizontal">
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/user_profile_img"
android:layout_width="#dimen/_50sdp"
android:layout_height="#dimen/_50sdp"
android:src="#mipmap/profile_default" />
<EditText
android:id="#+id/post_edittext"
style="#style/Textview_gray_11sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/_10sdp"
android:gravity="top|left"
android:hint="#string/whats_happening_right"
android:lines="3" />
</LinearLayout>
<RelativeLayout
android:id="#+id/add_post_ll"
android:layout_width="match_parent"
android:layout_height="#dimen/_30sdp"
android:layout_below="#+id/add_post_info_ll"
android:background="#color/white_color"
android:gravity="center|left"
android:layout_marginBottom="#dimen/_10sdp"
android:padding="#dimen/_5sdp">
<ImageView
android:id="#+id/flag_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:padding="#dimen/_5sdp"
android:src="#mipmap/flag" />
<ImageView
android:id="#+id/car_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/flag_icon"
android:padding="#dimen/_5sdp"
android:src="#mipmap/car" />
<ImageView
android:id="#+id/trophy_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/car_icon"
android:padding="#dimen/_5sdp"
android:src="#mipmap/trophy" />
<ImageView
android:id="#+id/timer_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/trophy_icon"
android:padding="#dimen/_5sdp"
android:src="#mipmap/timer" />
<ImageView
android:id="#+id/sun_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/timer_icon"
android:padding="#dimen/_5sdp"
android:src="#mipmap/sun" />
<ImageView
android:id="#+id/gallery_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/sun_icon"
android:padding="#dimen/_5sdp"
android:src="#mipmap/gallery" />
<ImageView
android:id="#+id/smiley_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/gallery_icon"
android:padding="#dimen/_5sdp"
android:src="#mipmap/amiley" />
<TextView
android:id="#+id/post_tv"
style="#style/Textview_white_11sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="#dimen/_10sdp"
android:background="#drawable/button_back"
android:paddingBottom="#dimen/_3sdp"
android:paddingLeft="#dimen/_10sdp"
android:paddingRight="#dimen/_10sdp"
android:paddingTop="#dimen/_3sdp"
android:text="#string/post" />
</RelativeLayout>-->
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</LinearLayout>
[![][1]][1]
I want to scroll header as well when viewpager content scrolls.I tried using Nested ScrollView on both screens but didn't get any success.Can anyone help me solve this problem.Thanks in advance.