ConsecutiveScroller
ConsecutiveScroller copied to clipboard
Recycler Not working in wrap_content
<com.donkingliang.consecutivescroller.ConsecutiveScrollerLayout
android:id="@+id/scoreSection"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/_3sdp"
android:background="@drawable/white_rounded_background"
android:paddingVertical="@dimen/_8sdp"
app:autoAdjustHeightAtBottomView="true"
app:layout_constraintEnd_toStartOf="@id/teamOneButton"
app:layout_constraintHorizontal_weight="0.825"
app:layout_constraintStart_toStartOf="parent">
**First Header**
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:paddingVertical="@dimen/_8sdp"
app:layout_isSticky="true">
<TextView
android:id="@+id/txtOne"
style="@style/SubScoreCardStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:gravity="start"
android:text="Batter"
android:textColor="@color/blue_dark" />
<TextView
android:id="@+id/txtTwo"
style="@style/SubScoreCardStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:gravity="start"
android:text="Batter"
android:textColor="@color/blue_dark" />
</LinearLayout>
**First RecyclerView**
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvFirst"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/item_batter_score_layout"
android:fadingEdge="vertical"
android:fadingEdgeLength="@dimen/_8sdp"
/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/_24sdp" />
**Second Header**
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:paddingVertical="@dimen/_8sdp"
app:layout_isSticky="true">
<TextView
android:id="@+id/txtThree"
style="@style/SubScoreCardStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:gravity="start"
android:text="Bowler"
android:textColor="@color/blue_dark" />
<TextView
android:id="@+id/txtFour"
style="@style/SubScoreCardStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:gravity="start"
android:text="Batter"
android:textColor="@color/blue_dark" />
</LinearLayout>
**Second RecyclerView**
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvSecond"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdge="vertical"
android:fadingEdgeLength="@dimen/_8sdp"
tools:listitem="@layout/item_bowler_score_layout" />
</com.donkingliang.consecutivescroller.ConsecutiveScrollerLayout> ```
**Sorry for posting such a big code, but this is what I am using. I am using it inside the Constraint Layout in a half section. I am using the WRAP_CONTENT for both recycler view and it's item**, but nothing is showing up.
It works if I keep the recyclerview as **MATCH_PARENT**, but then if cause view problem as if I am having only 3 items in the recycler view than also it occupies the Full Parent size, and have to scroll the remaining blank space to reach the second recyclerview