use of com.google.samples.apps.topeka.databinding.ItemCategoryBinding in project android-topeka by googlesamples.
the class CategoryAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
ItemCategoryBinding binding = holder.getBinding();
Category category = mCategories.get(position);
binding.setCategory(category);
binding.executePendingBindings();
setCategoryIcon(category, binding.categoryIcon);
holder.itemView.setBackgroundColor(getColor(category.getTheme().getWindowBackgroundColor()));
binding.categoryTitle.setTextColor(getColor(category.getTheme().getTextPrimaryColor()));
binding.categoryTitle.setBackgroundColor(getColor(category.getTheme().getPrimaryColor()));
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mOnItemClickListener.onClick(v, holder.getAdapterPosition());
}
});
}
Aggregations