Facing issue in Scrolling Android Tv

91 Views Asked by At

In my layout there are 2 component recyclerview and verical grid . basically i have to scroll them both vertically but it is not working as expected using scrollview and as well using nestedscrollview as above part is cropped

please help

<?xml version="1.0" encoding="utf-8"?>
 <layout 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">

<ScrollView
    android:fillViewport="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:focusable="true">

<androidx.constraintlayout.widget.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:gravity="center">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rv"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:orientation="horizontal"
        android:paddingStart="0dp"
        android:paddingEnd="40dp"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        app:layout_constraintDimensionRatio="h,9:4"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@id/vg" />

    <LinearLayout
        android:id="@+id/llIndicator"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginBottom="15dp"
        android:focusable="true"
        android:gravity="center_horizontal"
        android:orientation="horizontal"
        app:layout_constraintBottom_toBottomOf="@id/rv"
        app:layout_constraintEnd_toEndOf="@id/rv"
        app:layout_constraintStart_toStartOf="@id/rv" />

    <androidx.leanback.widget.VerticalGridView
        android:id="@+id/vg"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:padding="16dp"
        app:focusOutEnd="true"
        app:focusOutFront="true"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/rv"
        app:numberOfColumns="1" />


</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

ss:- using scrollview

above rv is getting cropped

enter image description here

0

There are 0 best solutions below