Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing veil skeletons in a RecyclerView with multiple view types (layouts) #10

Open
itabdullah1 opened this issue Jan 23, 2020 · 1 comment

Comments

@itabdullah1
Copy link

Is your feature request related to a problem?

How to implement veil skeletons in a RecyclerView with multiple view types? Currently VeilRecyclerFrameView accepts only one VeilLayout. How to add one VeilLayout for each view types ?
For example I use 7 different layouts in my RecyclerView as below:

    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {

        if (viewType == 0) {
            View view = inflater.inflate(R.layout.item_content_settings, parent, false);
            return new MyViewHolder(view);
        } else if (viewType == 1) {
            View view = inflater.inflate(R.layout.item_edit_delete_settings, parent, false);
            return new EditDeleteItemHolder(view);
        } else if (viewType == 2) {
            View view = inflater.inflate(R.layout.item_addnew_settings, parent, false);
            return new AddItemHolder(view);
        } else if (viewType == 3) {
            View view = inflater.inflate(R.layout.item_content_none_settings, parent, false);
            return new NoneHolder(view);
        } else if (viewType == 4) {
            View view = inflater.inflate(R.layout.item_email_id_settings, parent, false);
            return new EmailHolder(view);
        } else if (viewType == 5) {
            View view = inflater.inflate(R.layout.item_delete_data, parent, false);
            return new DeleteDataHolder(view);
        } else {
            View view = inflater.inflate(R.layout.button_save_settings, parent, false);
            return new SaveButtonHolder(view);
        }
    }

Thanks.

@DroidPulkit
Copy link

Looking for this feature in all shimmer lib, looks like we need to create something custom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants