I try to design card like youtube kids as you can see in image below
without using ConstraintLayout
but I cant find any layout can do something like this
I try to design card like youtube kids as you can see in image below
without using ConstraintLayout
but I cant find any layout can do something like this
So you want to use recyclerview with vertically placed cards? Use linear layout. Otherwise you should really specify what your problem is.
Do you want to show a view similar to stack? or do you want it to be functional like as of Tinder, with swipe actions, because in Youtube it is implemented as a view which can only be clicked but cannot be swiped.
Then go for coordinator layout. If you only want a static view.
For reference, you can check this
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_margin="10dp"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="@+id/image_1"
android:layout_width="match_parent"
android:layout_height="250dp"
app:layout_anchorGravity="bottom"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:layout_marginStart="15dp"
android:layout_gravity="bottom" />
<androidx.cardview.widget.CardView
android:id="@+id/image_2"
android:layout_width="match_parent"
android:layout_height="250dp"
app:layout_anchor="@+id/image_1"
app:layout_anchorGravity="bottom"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:layout_marginStart="10dp"
android:layout_gravity="bottom" />
<androidx.cardview.widget.CardView
android:id="@+id/image_3"
android:layout_width="match_parent"
android:layout_height="250dp"
android:scaleType="centerCrop"
app:layout_anchor="@+id/image_2"
app:layout_anchorGravity="bottom"
android:layout_marginEnd="15dp"
android:layout_marginBottom="15dp"
android:layout_marginStart="5dp"
android:layout_gravity="bottom" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>