I want to use in imageview above a recyclerview in home feed to show some pin some specific images. And when the user start scrolling the image get scrolled and he can continue scrolling in the recyclerview. I use the below code to implement but the recyclerview scrolling become very very slow is there any way to solve that?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".Fragments.HomeFragment">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
app:cardCornerRadius="4dp"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/pin_img"
android:layout_width="match_parent"
android:layout_height="300dp"
android:visibility="gone" />
</androidx.cardview.widget.CardView>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/recycler_view_home">
</androidx.recyclerview.widget.RecyclerView>
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_gravity="center"
android:id="@+id/progress_bar"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView> </RelativeLayout>
question from:
https://stackoverflow.com/questions/65838249/add-a-scrollable-imageview-and-recyclerview-in-one-layout 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…