package tellh.com.gitclub.presentation.view.adapter.viewbinder;
import android.view.View;
import android.widget.TextView;
import tellh.com.gitclub.R;
import tellh.com.gitclub.model.entity.File;
import tellh.com.recyclertreeview_lib.TreeNode;
import tellh.com.recyclertreeview_lib.TreeViewBinder;
/**
* Created by tlh on 2016/10/1 :)
*/
public class FileNodeBinder extends TreeViewBinder<FileNodeBinder.ViewHolder> {
@Override
public ViewHolder provideViewHolder(View itemView) {
return new ViewHolder(itemView);
}
@Override
public void bindView(ViewHolder holder, int position, TreeNode node) {
File fileNode = (File) node.getContent();
holder.tvName.setText(fileNode.fileName);
}
@Override
public int getLayoutId() {
return R.layout.item_file;
}
public static class ViewHolder extends TreeViewBinder.ViewHolder {
TextView tvName;
public ViewHolder(View rootView) {
super(rootView);
this.tvName = (TextView) rootView.findViewById(R.id.tv_name);
}
}
}