I have a Adapter. And I'm listing the data in a fragment. in a listing; 4 buttons, profile photo and text view. Can I just shuffling buttons with collection.shuffle();?
public class PostAdapter extends RecyclerView.Adapter<PostAdapter.ViewHolder> {
public Context mContext;
public List<Posts> mPosts;
private FirebaseUser firebaseUser;
public PostAdapter(Context mContext, List<Posts> mPosts) {
this.mContext = mContext;
this.mPosts = mPosts;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View view = LayoutInflater.from(mContext).inflate(R.layout.all_posts_layout, viewGroup, false );
return new PostAdapter.ViewHolder(view);
}
}