
/**
 * This file is automatically generated by wheat-build.
 * Do not modify this file -- YOUR CHANGES WILL BE ERASED!
 */

package x7c1.linen.res.layout;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.view.View;
import android.support.v7.widget.Toolbar;
import android.support.v7.widget.RecyclerView;
import x7c1.wheat.ancient.resource.ViewHolderProvider;
import x7c1.wheat.ancient.resource.ViewHolderProviderFactory;
import x7c1.linen.R;
import x7c1.linen.glue.res.layout.SettingChannelSourcesLayout;

public class SettingChannelSourcesLayoutProvider implements ViewHolderProvider<SettingChannelSourcesLayout> {

    private final LayoutInflater inflater;

    public SettingChannelSourcesLayoutProvider(Context context){
        this.inflater = LayoutInflater.from(context);
    }

    public SettingChannelSourcesLayoutProvider(LayoutInflater inflater){
        this.inflater = inflater;
    }

    @Override
    public int layoutId(){
        return R.layout.setting_channel_sources_layout;
    }

    @Override
    public SettingChannelSourcesLayout inflateOn(ViewGroup parent){
        return inflate(parent, false);
    }

    @Override
    public SettingChannelSourcesLayout inflate(ViewGroup parent, boolean attachToRoot){
        View view = inflater.inflate(R.layout.setting_channel_sources_layout, parent, attachToRoot);
        return factory().createViewHolder(view);
    }

    @Override
    public SettingChannelSourcesLayout inflate(){
        return inflate(null, false);
    }

    public static ViewHolderProviderFactory<SettingChannelSourcesLayout> factory(){
        return new ViewHolderProviderFactory<SettingChannelSourcesLayout>() {
            @Override
            public ViewHolderProvider<SettingChannelSourcesLayout> create(LayoutInflater inflater){
                return new SettingChannelSourcesLayoutProvider(inflater);
            }
            @Override
            public ViewHolderProvider<SettingChannelSourcesLayout> create(Context context){
                return new SettingChannelSourcesLayoutProvider(context);
            }
            @Override
            public SettingChannelSourcesLayout createViewHolder(View view){
                return new SettingChannelSourcesLayout(
                    view,
                    (android.support.v7.widget.Toolbar) view.findViewById(R.id.setting_channel_sources_layout__toolbar),
                    (android.support.v7.widget.RecyclerView) view.findViewById(R.id.setting_channel_sources_layout__source_list)
                );
            }
        };
    }
}
