MultiTypeTemplates

Introduction: An intellij idea plugin to generate MultiType Item and ItemViewBinder easily.
More: Author   ReportBugs   
Tags:

An intellij idea plugin for Android to generate MultiType Item and ItemViewBinder easily.

Obtaining & Installation

Usage

Right-click your package/directory - New - MultiType Item, then inputs your name of Item to generate Item and ItemViewBinder files and codes.

Example: If you input "Category", it will generate the Category.java and CategoryViewBinder.java:

public class Category {

}
public class CategoryViewBinder extends ItemViewBinder<Category, CategoryViewBinder.ViewHolder> {

    @NonNull @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View root = inflater.inflate(R.layout.item_category, parent, false);
        return new ViewHolder(root);
    }


    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull Category category) {

    }


    static class ViewHolder extends RecyclerView.ViewHolder {

        ViewHolder(View itemView) {
            super(itemView);
        }
    }
}

Action

You could generate inner "Item & ItemViewBinder" codes by MultiType action:

Thanks

  • drakeet/MultiType An Android library to create multiple item types list views easily and flexibly
Android 开发经验分享
随手点击下面广告支持本站吧
 
Android 开发经验分享