Implement the Shuffle view and Adapter
masterTo use Shuffle, declare the com.meetic.shuffle.Shuffle view in your XML layout and then provide a Shuffle.Adapter in your Java code to manage the cards.
XML Layout:
<com.meetic.shuffle.Shuffle
android:id="@+id/shuffle"
android:layout_width="match_parent"
android:layout_height="200dp"
/>Java Implementation:
Shuffle shuffle = (Shuffle)findViewById(R.id.shuffle);
shuffle.setShuffleAdapter(new Shuffle.Adapter(){
@Override
public Shuffle.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int type) {
// Inflate and return your ViewHolder
}
@Override
public void onBindViewHolder(final Shuffle.ViewHolder viewHolder, int position) {
// Bind data to the ViewHolder
}
@Override
public int getItemCount() {
// Return total number of items
}
});Shuffle shuffle = (Shuffle)findViewById(R.id.shuffle);
shuffle.setShuffleAdapter(new Shuffle.Adapter(){
@Override
public Shuffle.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int type) {
}
@Override
public void onBindViewHolder(final Shuffle.ViewHolder viewHolder, int position) {
}
@Override
public int getItemCount() {
return 0;
}
});