I am using a NestedScrollView and inside that, I am having some edit text and buttons and then a RecyclerView. When I open the activity all the items start fetching from the server using the PageKeyedDataSource and the RecyclerView scrolls very slowly and in the end the app show ANR.
I have looked this issue in the GitHub repo of android-architecture-components and found that SmartNestedScrollView can solve the problem but when I use SmartNestedScrollView then only a small portion of my recycler view scrolls.
https://github.com/googlesamples/android-architecture-components/issues/215
LayoutFile.xml
<?xml version="1.0" encoding="utf-8"?>
<com.magtappofficial.app.utilities.SmartNestedScrollView
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"
android:layout_margin="16dp"
tools:context=".ui.Home">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_width="0px"
android:layout_height="0px"/>
<EditText.../>
<ImageView.../>
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/newsProgress"
android:layout_marginTop="16dp"
app:layout_constraintTop_toBottomOf="@+id/exclusiveForYou"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/newsRecycler"
android:layout_marginTop="16dp"
app:layout_constraintTop_toBottomOf="@+id/exclusiveForYou"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.magtappofficial.app.utilities.SmartNestedScrollView>
Can Anyone Please tell me what else can I do?