Skip to content

TypeScript code snippet – How to use mutliple layouts in recyclerview?

@Override
public int getItemViewType(int position) {
        if(user_id_array.get(position).equals(user_one))
            return 1;
        else if(user_id_array.get(position).equals(user_two))
            return 2;
        else
            return 3;
}
See also  Shuffle a list using Fisher-Yates algorithm in Python

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.