android - Horizontal recyclerview with current item scaled and next item displayed a bit -
i'm trying make horizontal recyclerview 1 in this image, screenshot on left
i managed horizontal part, next , previews cards not being displayed.
here's xml recyclerview
<android.support.v7.widget.recyclerview android:id="@+id/rv_cards" android:layout_width="match_parent" android:layout_height="wrap_content" android:cliptopadding="false" android:orientation="horizontal" android:requiresfadingedge="horizontal" app:layoutmanager="android.support.v7.widget.linearlayoutmanager" tools:listitem="@layout/recyclerview_card_row" />
here's recyclerview_card_row.xml
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="match_parent" android:cliptopadding="false" android:orientation="vertical" android:padding="10dp"> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/rounded_qicard_accent" android:elevation="5dp" android:orientation="vertical"> <linearlayout android:layout_width="match_parent" android:layout_height="200dp" android:background="@drawable/qicard_card" android:gravity="bottom" android:layoutdirection="ltr" android:orientation="vertical" android:padding="10dp"> <textview android:id="@+id/tv_card_number" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_marginbottom="5dp" android:layout_margintop="5dp" android:background="@null" android:gravity="center" android:hint="* * * * * * * * * * * * 6968" android:textsize="20sp" /> </linearlayout> </linearlayout>
and here's activity code recyclerview
rv_cards = (recyclerview) findviewbyid(r.id.rv_cards); rv_cards.sethasfixedsize(true); rv_cards.setlayoutmanager(new linearlayoutmanager(this, linearlayoutmanager.horizontal, false)); snaphelper snaphelper = new linearsnaphelper(); snaphelper.attachtorecyclerview(rv_cards);
Comments
Post a Comment