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.
Related
I have included a progress bar in my relative layout, but it is running behind the layout. Is there any way I can bring it in front show that it show when the page is loading.
[Sorry, I'm pasting whole XML file, cause I don't know where to put progress bar! as I'm newbie, I want you to help me. Sorry again!]
Code:
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/backgroundcolor"
tools:context="com.tekitsolutions.remindme.Activity.AddReminderActivity">
<!--TODO:-> Toolbar Layout-->
<androidx.appcompat.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/toolbarcolor"
android:minHeight="?attr/actionBarSize"
app:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:title="#string/title_add_reminder" />
<ScrollView
android:id="#+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_below="#id/toolbar">
<RelativeLayout
android:id="#+id/layout_relative"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="#layout/row_progress_bar" />
<!--TODO:-> Parent Layout-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="vertical"
android:paddingLeft="#dimen/activity_vertical_padding"
android:paddingRight="#dimen/activity_vertical_margin">
<!--TODO:-> Title & Category Layout-->
<RelativeLayout
android:id="#+id/layout_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="#dimen/view_margin_top">
<LinearLayout
style="#style/dialog_main_linear_layout_style"
android:padding="8dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/title"
style="#style/heading_textview_style1"
android:text="#string/heading_title"
android:textSize="#dimen/heading_text_size" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" *"
android:textColor="#color/colorRed"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/title_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
style="#style/vector_image_style"
android:tint="?attr/iconcolor"
app:srcCompat="#drawable/ic_view_heading" />
<EditText
android:id="#+id/et_title"
style="#style/text_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginEnd="100dp"
android:backgroundTint="#color/colorIconLightGray"
android:digits="0123456789 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ अआइईउऊऋएऐओऔकखगघङचछजझञाटठडढणतथदधनपफबभमयरलवशषसहक्षत्रज्ञ ा ि ी ु ू ृ े ै ो ौ ं ः "
android:imeOptions="actionNext"
android:singleLine="true"
android:maxLength="25"
android:maxLines="1"
android:textSize="17sp" />
</LinearLayout>
<!--TODO:-> Title error-->
<include
android:id="#+id/tv_title_error"
layout="#layout/row_error_textview" />
<RelativeLayout
android:id="#+id/layout_category"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Spinner
android:id="#+id/spin_list"
style="#style/Widget.AppCompat.Spinner.Underlined"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginEnd="8dp"
android:backgroundTint="?attr/iconcolor"
android:dropDownVerticalOffset="17dp"
android:spinnerMode="dropdown"
android:textSize="#dimen/input_text_size" />
<TextView
android:id="#+id/tv_selected_category"
style="#style/text_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_centerHorizontal="true"
android:layout_toLeftOf="#+id/circle_card1"
android:text="#string/hint_select_category"
android:textSize="#dimen/input_text_size" />
<androidx.cardview.widget.CardView
android:id="#+id/circle_card1"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:elevation="12dp"
android:innerRadius="0dp"
android:shape="ring"
android:thicknessRatio="0"
app:cardCornerRadius="13dp">
<ImageView
android:id="#+id/category_image"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:visibility="visible"
app:srcCompat="#drawable/ic_keyboard_arrow_down_black_24dp" />
<Button
android:id="#+id/custom_category_image"
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#drawable/bg_circle_btn"
android:text="A"
android:textColor="#color/colorWhite"
android:textSize="12dp"
android:visibility="gone"
app:srcCompat="#drawable/ic_navigate_next_black_24dp" />
</androidx.cardview.widget.CardView>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/colorDarkerGray" />
<!--TODO:-> Amount Layout-->
<RelativeLayout
android:id="#+id/layout_amount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/view_margin_top">
<LinearLayout
style="#style/dialog_main_linear_layout_style"
android:padding="8dp">
<TextView
style="#style/heading_textview_style"
android:text="#string/heading_amount"
android:textSize="#dimen/heading_text_size" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/iv_amount"
style="#style/vector_image_style"
android:tint="?attr/iconcolor"
app:srcCompat="#drawable/currency_inr" />
<EditText
android:id="#+id/et_amount"
style="#style/text_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:backgroundTint="#color/colorIconLightGray"
android:hint="0.00"
android:inputType="numberDecimal"
android:maxLength="7"
android:textSize="17sp" />
</LinearLayout>
<RelativeLayout
android:id="#+id/layout_payment_option"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible">
<TextView
android:id="#+id/tv_selected_payment_mode"
style="#style/text_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_toLeftOf="#+id/circle_card2"
android:gravity="end"
android:text="#string/select_payment"
android:textSize="#dimen/input_text_size" />
<androidx.cardview.widget.CardView
android:id="#+id/circle_card2"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:elevation="12dp"
android:innerRadius="0dp"
android:shape="ring"
android:thicknessRatio="0"
app:cardCornerRadius="13dp">
<ImageView
android:id="#+id/payment_image"
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#drawable/ic_keyboard_arrow_down_black_24dp"></ImageView>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/colorDarkerGray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:padding="8dp"
android:text="Select Date and Time"
style="#style/text_color"
android:textSize="16sp"
/>
<!--TODO:-> Due date Layout-->
<RelativeLayout
android:id="#+id/layout_due_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/view_margin_top">
<ImageView
android:id="#+id/iv_due_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="?attr/iconcolor"
app:srcCompat="#drawable/ic_icon_date" />
<RelativeLayout
android:id="#+id/date_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginBottom="8dp"
android:layout_toRightOf="#id/iv_due_date">
<TextView
style="#style/text_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/heading_due_date"
android:textSize="#dimen/heading_text_size" />
<TextView
android:id="#+id/tv_due_date"
style="#style/text_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="end"
android:layout_marginRight="12dp"
android:hint="YYYY-MM-DD"
android:textAlignment="textEnd"
android:textSize="#dimen/input_text_size" />
</RelativeLayout>
</RelativeLayout>
<!--TODO:-> Due date error-->
<include
android:id="#+id/tv_due_date_error"
layout="#layout/row_error_textview" />
<!--TODO:-> Alarm Layout-->
<RelativeLayout
android:id="#+id/layout_alarm_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/layout_due_date"
android:layout_marginTop="#dimen/view_margin_top"
android:layout_marginBottom="8dp">
<ImageView
android:id="#+id/iv_alarm_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="?attr/iconcolor"
app:srcCompat="#drawable/ic_icon_alarm" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#id/iv_alarm_time"
android:orientation="vertical">
<TextView
style="#style/text_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/heading_alarm_time"
android:textSize="#dimen/heading_text_size" />
<TextView
android:id="#+id/tv_alarm_time"
style="#style/text_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="end"
android:layout_marginRight="12dp"
android:hint="HH:MM"
android:textAlignment="textEnd"
android:textSize="#dimen/input_text_size" />
<TextView
android:id="#+id/tv_error_alarm_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Please select Alarm Time"
android:textColor="#color/colorRed"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
<!--TODO:-> Alarm error-->
<include
android:id="#+id/tv_time_error"
layout="#layout/row_error_textview" />
<RelativeLayout
android:id="#+id/frequency_layout"
style="#style/sub_relative_layout_style">
<TextView
style="#style/sub_text_view_style"
android:text="Alarm Frequency" />
<ImageView
android:id="#+id/collapse"
style="#style/visibilities_image_style"
android:layout_centerVertical="true"
android:visibility="visible"
app:srcCompat="#drawable/ic_keyboard_arrow_down_black_24dp" />
<ImageView
android:id="#+id/expand"
style="#style/visibilities_image_style"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:visibility="gone"
app:srcCompat="#drawable/ic_keyboard_arrow_up_black_24dp" />
</RelativeLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/colorDarkerGray" />
<!--TODO:-> Note Layout-->
<RelativeLayout
android:id="#+id/layout_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/layout_repeat"
android:layout_marginTop="#dimen/view_margin_top">
<ImageView
android:id="#+id/iv_note"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginLeft="8dp"
android:layout_marginRight="12dp"
android:tint="?attr/iconcolor"
app:srcCompat="#drawable/ic_keyboard_arrow_down_black_24dp" />
<LinearLayout
android:id="#+id/note_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_toLeftOf="#+id/iv_note"
android:orientation="horizontal">
<TextView
style="#style/text_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/heading_note"
android:textSize="#dimen/heading_text_size" />
<TextView
android:id="#+id/note_desc"
android:textColor="?attr/textcolor"
android:textSize="16sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:maxLines="4" />
</LinearLayout>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:background="#color/colorDarkerGray" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
row_progress_bar:
<?xml version="1.0" encoding="utf-8"?>
<ProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/progress_bar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:theme="#style/AppTheme.WhiteAccent"
android:visibility="gone" />
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
I have RecyclerView and LinearLayout in CoordinatorLayout. For RecyclerView scroll is working fine but i want above content to scroll in the screen. Please guide what changes i need to do or anything im doing wrong please guide me.
my activity_article_polls.xml
<?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"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="in.passionconnect.application.ArticlePolls">
<android.support.v7.widget.RecyclerView
android:id="#+id/landing_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="440dp"
android:clipToPadding="false"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/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>
<include layout="#layout/content_article_polls" />
</android.support.design.widget.CoordinatorLayout>
and my content_article_polls.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
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:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="in.passionconnect.application.ArticlePolls"
tools:showIn="#layout/activity_article_polls">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/landing_list"
android:orientation="vertical"
app:layout_scrollFlags="scroll|enterAlways">
<LinearLayout
android:id="#+id/layout_filters"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#color/colorPrimary"
android:gravity="center"
android:orientation="horizontal"
android:visibility="visible"
android:weightSum="3">
<CheckBox
android:id="#+id/chk_date"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:buttonTint="#ffffff"
android:text="Newest"
android:textColor="#color/white" />
<CheckBox
android:id="#+id/chk_random"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:buttonTint="#ffffff"
android:text="Random"
android:textColor="#color/white" />
<CheckBox
android:id="#+id/chk_popular"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:buttonTint="#ffffff"
android:text="Popularity"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:id="#+id/card_summary_read_more_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/card_background_gradient_overlay"
android:layout_width="match_parent"
android:layout_height="#dimen/landing_card_imageview_height"
android:adjustViewBounds="true"
android:background="#drawable/card_gradient_overlay"
android:scaleType="centerCrop" />
<TextView
android:id="#+id/article_poll_title"
style="#style/robobold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="left|bottom"
android:padding="10dp"
android:text="Top 3 Highest Grossing Hollywood Movies"
android:textColor="#color/white"
android:textSize="14sp" />
</FrameLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="10dp">
<in.passionconnect.application.view.RoundedImageView
android:id="#+id/card_author_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:padding="12dp"
android:scaleType="centerCrop"
android:src="#drawable/lion" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="10dp">
<TextView
android:id="#+id/article_author"
style="#style/robobold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="8"
android:text="Prasanth"
android:textColor="#color/dark_gray"
android:textSize="15sp" />
<TextView
android:id="#+id/article_author_desn"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="developer at varchas technologies"
android:textColor="#color/dark_gray"
android:textSize="12sp" />
<TextView
android:id="#+id/article_date"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="12th March 2016 06:09:06 PM"
android:textColor="#color/dark_gray"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="#+id/article_author_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/dark_gray"
android:visibility="invisible" />
<TextView
android:id="#+id/article_title_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/dark_gray"
android:visibility="invisible" />
</LinearLayout>
<TextView
android:id="#+id/txt_follow"
style="#style/robobold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:background="#drawable/follow_border"
android:padding="10dp"
android:text="Follow"
android:textColor="#b7492b"
android:textSize="15sp" />
<TextView
android:id="#+id/txt_unfollow"
style="#style/robobold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="center"
android:background="#drawable/follow_border"
android:padding="10dp"
android:text="Following"
android:textColor="#b7492b"
android:textSize="15sp"
android:visibility="gone" />
</RelativeLayout>
<TextView
android:id="#+id/card_summary"
style="#style/roboregular"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="2.5dp"
android:padding="10dp"
android:text="#string/card_summary"
android:textColor="#color/dark_gray"
android:textSize="16sp"
android:visibility="visible" />
</LinearLayout>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/landing_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
I have tried like also, only my recyclerview scroll. I want scroll the whole screen along with the recyclerview.
Thanks in Advance
Atlast i tried and fixed the scrolling problem. I have referred This link
Just setting the height to my Recyclerview android:minHeight="840dp"
content_article_polls.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
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:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="in.passionconnect.application.ArticlePolls"
tools:showIn="#layout/activity_article_polls">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/landing_list"
android:orientation="vertical"
app:layout_scrollFlags="scroll|enterAlways">
<LinearLayout
android:id="#+id/layout_filters"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#color/colorPrimary"
android:gravity="center"
android:orientation="horizontal"
android:visibility="visible"
android:weightSum="3">
<CheckBox
android:id="#+id/chk_date"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:buttonTint="#ffffff"
android:text="Newest"
android:textColor="#color/white" />
<CheckBox
android:id="#+id/chk_random"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:buttonTint="#ffffff"
android:text="Random"
android:textColor="#color/white" />
<CheckBox
android:id="#+id/chk_popular"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:buttonTint="#ffffff"
android:text="Popularity"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:id="#+id/card_summary_read_more_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/card_background_gradient_overlay"
android:layout_width="match_parent"
android:layout_height="#dimen/landing_card_imageview_height"
android:adjustViewBounds="true"
android:background="#drawable/card_gradient_overlay"
android:scaleType="centerCrop" />
<TextView
android:id="#+id/article_poll_title"
style="#style/robobold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="left|bottom"
android:padding="10dp"
android:text="Top 3 Highest Grossing Hollywood Movies"
android:textColor="#color/white"
android:textSize="14sp" />
</FrameLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="10dp">
<in.passionconnect.application.view.RoundedImageView
android:id="#+id/card_author_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:padding="12dp"
android:scaleType="centerCrop"
android:src="#drawable/lion" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="10dp">
<TextView
android:id="#+id/article_author"
style="#style/robobold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="8"
android:text="Prasanth"
android:textColor="#color/dark_gray"
android:textSize="15sp" />
<TextView
android:id="#+id/article_author_desn"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="developer at varchas technologies"
android:textColor="#color/dark_gray"
android:textSize="12sp" />
<TextView
android:id="#+id/article_date"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="12th March 2016 06:09:06 PM"
android:textColor="#color/dark_gray"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="#+id/article_author_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/dark_gray"
android:visibility="invisible" />
<TextView
android:id="#+id/article_title_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/dark_gray"
android:visibility="invisible" />
</LinearLayout>
<TextView
android:id="#+id/txt_follow"
style="#style/robobold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:background="#drawable/follow_border"
android:padding="10dp"
android:text="Follow"
android:textColor="#b7492b"
android:textSize="15sp" />
<TextView
android:id="#+id/txt_unfollow"
style="#style/robobold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="center"
android:background="#drawable/follow_border"
android:padding="10dp"
android:text="Following"
android:textColor="#b7492b"
android:textSize="15sp"
android:visibility="gone" />
</RelativeLayout>
<TextView
android:id="#+id/card_summary"
style="#style/roboregular"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="2.5dp"
android:padding="10dp"
android:text="#string/card_summary"
android:textColor="#color/dark_gray"
android:textSize="16sp"
android:visibility="visible" />
</LinearLayout>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/landing_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:minHeight="840dp"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<?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="in.passionconnect.application.ArticlePolls">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/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>
<include layout="#layout/content_article_polls" />
</android.support.design.widget.CoordinatorLayout>
And your other layout to be included should look as below:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView 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"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="in.passionconnect.application.ArticlePolls"
tools:showIn="#layout/activity_scrolling">
<RelativeLayout android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="#+id/landing_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="440dp"
android:clipToPadding="false"/>
<LinearLayout
android:layout_below="#+id/landing_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_scrollFlags="scroll|enterAlways">
<LinearLayout
android:id="#+id/layout_filters"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#color/colorPrimary"
android:gravity="center"
android:orientation="horizontal"
android:visibility="visible"
android:weightSum="3">
<CheckBox
android:id="#+id/chk_date"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:buttonTint="#ffffff"
android:text="Newest"
android:textColor="#color/white" />
<CheckBox
android:id="#+id/chk_random"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:buttonTint="#ffffff"
android:text="Random"
android:textColor="#color/white" />
<CheckBox
android:id="#+id/chk_popular"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:buttonTint="#ffffff"
android:text="Popularity"
android:textColor="#color/white" />
</LinearLayout>
<LinearLayout
android:id="#+id/card_summary_read_more_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/card_background_gradient_overlay"
android:layout_width="match_parent"
android:layout_height="#dimen/landing_card_imageview_height"
android:adjustViewBounds="true"
android:background="#drawable/card_gradient_overlay"
android:scaleType="centerCrop" />
<TextView
android:id="#+id/article_poll_title"
style="#style/robobold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="left|bottom"
android:padding="10dp"
android:text="Top 3 Highest Grossing Hollywood Movies"
android:textColor="#color/white"
android:textSize="14sp" />
</FrameLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="10dp">
<in.passionconnect.application.view.RoundedImageView
android:id="#+id/card_author_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:padding="12dp"
android:scaleType="centerCrop"
android:src="#drawable/lion" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="10dp">
<TextView
android:id="#+id/article_author"
style="#style/robobold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="8"
android:text="Author name"
android:textColor="#color/dark_gray"
android:textSize="15sp" />
<TextView
android:id="#+id/article_author_desn"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="author"
android:textColor="#color/dark_gray"
android:textSize="12sp" />
<TextView
android:id="#+id/article_date"
style="#style/roboregular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="12th March 2016 06:09:06 PM"
android:textColor="#color/dark_gray"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="#+id/txt_follow"
style="#style/robobold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:background="#drawable/follow_border"
android:padding="10dp"
android:text="Follow"
android:textColor="#b7492b"
android:textSize="15sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
This is my code
I need to Make it look like without Scrollview not stacking up
I can't make my LinearLayout xmlns:android to Scroll view because i doesn't want my toolbar to start moving around.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fillViewport="true"
android:gravity="center_horizontal"
android:orientation="vertical"
android:weightSum="1"
tools:context=".HistoryScreen">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="370dp"
android:layout_height="64dp"
android:background="#color/ColorPrimary"
android:minHeight="?attr/actionBarSize"
android:scrollbars="none">
<TextView
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/app_history"
android:textColor="#color/TitleColor"
android:textSize="22sp" />
</android.support.v7.widget.Toolbar>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/description_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="5"
android:text="#string/History3" />
<ImageButton
android:id="#+id/show"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text"
android:background="#drawable/arrow_down"
android:clickable="true" />
<View
android:id="#+id/view"
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_below="#+id/description_text"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/show"
android:background="#000" />
<ImageButton
android:id="#+id/hide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text"
android:background="#drawable/arrow_up"
android:clickable="true"
android:visibility="invisible" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/description_text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/description_text1"
android:maxLines="5"
android:text="#string/History2" />
<ImageButton
android:id="#+id/show1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text1"
android:background="#drawable/arrow_down"
android:clickable="true" />
<View
android:id="#+id/view1"
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_below="#+id/description_text1"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/show1"
android:background="#000" />
<ImageButton
android:id="#+id/hide1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text1"
android:background="#drawable/arrow_up"
android:clickable="true"
android:visibility="invisible" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/description_text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/description_text2"
android:maxLines="5"
android:text="#string/history4">
</TextView>
<ImageButton
android:id="#+id/show2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text2"
android:background="#drawable/arrow_down"
android:clickable="true" />
<View
android:id="#+id/view2"
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_below="#+id/description_text2"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/show2"
android:background="#000" />
<ImageButton
android:id="#+id/hide2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text2"
android:background="#drawable/arrow_up"
android:clickable="true"
android:visibility="invisible" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</LinearLayout>'
[1]: http://i.stack.imgur.com/bHtXq.png(Without ScrollView)
[2]: http://i.stack.imgur.com/YBcRz.png(With ScrollView)
Just change your RelativeLayout inside the ScrollView to LinearLayout with android:orientation="vertical" and it should work.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fillViewport="true"
android:gravity="center_horizontal"
android:orientation="vertical"
android:weightSum="1"
tools:context=".HistoryScreen">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="370dp"
android:layout_height="64dp"
android:background="#color/ColorPrimary"
android:minHeight="?attr/actionBarSize"
android:scrollbars="none">
<TextView
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/app_history"
android:textColor="#color/TitleColor"
android:textSize="22sp" />
</android.support.v7.widget.Toolbar>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/description_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="5"
android:text="#string/History3" />
<ImageButton
android:id="#+id/show"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text"
android:background="#drawable/arrow_down"
android:clickable="true" />
<View
android:id="#+id/view"
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_below="#+id/description_text"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/show"
android:background="#000" />
<ImageButton
android:id="#+id/hide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text"
android:background="#drawable/arrow_up"
android:clickable="true"
android:visibility="invisible" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/description_text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/description_text1"
android:maxLines="5"
android:text="#string/History2" />
<ImageButton
android:id="#+id/show1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text1"
android:background="#drawable/arrow_down"
android:clickable="true" />
<View
android:id="#+id/view1"
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_below="#+id/description_text1"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/show1"
android:background="#000" />
<ImageButton
android:id="#+id/hide1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text1"
android:background="#drawable/arrow_up"
android:clickable="true"
android:visibility="invisible" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/description_text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/description_text2"
android:maxLines="5"
android:text="#string/history4">
</TextView>
<ImageButton
android:id="#+id/show2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text2"
android:background="#drawable/arrow_down"
android:clickable="true" />
<View
android:id="#+id/view2"
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_below="#+id/description_text2"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/show2"
android:background="#000" />
<ImageButton
android:id="#+id/hide2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/description_text2"
android:background="#drawable/arrow_up"
android:clickable="true"
android:visibility="invisible" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</LinearLayout>