Utilisez la bibliothèque ci-dessous qui fonctionne parfaitement.
https://github.com/flschweiger/SwipeStack
fichier XML
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false">
<link.fls.swipestack.SwipeStack
android:id="@+id/swipeStack"
android:layout_width="320dp"
android:layout_height="240dp"
android:padding="32dp"/>
</FrameLayout>
code Adaptateur
public class SwipeStackAdapter extends BaseAdapter {
private List<String> mData;
public SwipeStackAdapter(List<String> data) {
this.mData = data;
}
@Override
public int getCount() {
return mData.size();
}
@Override
public String getItem(int position) {
return mData.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
convertView = getLayoutInflater().inflate(R.layout.card, parent, false);
TextView textViewCard = (TextView) convertView.findViewById(R.id.textViewCard);
textViewCard.setText(mData.get(position));
return convertView;
}
}
Je ne cherche pas cela peut être il est utile pour vous https: // github .com/M eetic/Shuffle/ –
@ Er.Arjunsaini Merci pour votre réponse laissez-moi évaluer ce lien –