diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/CategoryAdapter.java b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/CategoryAdapter.java index fdceebd1..e6c3077c 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/CategoryAdapter.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/CategoryAdapter.java @@ -15,9 +15,8 @@ import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import java.util.List; -import butterknife.BindView; -import butterknife.ButterKnife; import it.niedermann.owncloud.notes.R; +import it.niedermann.owncloud.notes.databinding.ItemCategoryBinding; import it.niedermann.owncloud.notes.model.NavigationAdapter.NavigationItem; import it.niedermann.owncloud.notes.util.NoteUtil; @@ -52,25 +51,25 @@ public class CategoryAdapter extends RecyclerView.Adapter listener.onCategoryAdded()); + categoryViewHolder.getIcon().setImageDrawable(wrapDrawable); + categoryViewHolder.getCategoryWrapper().setOnClickListener((v) -> listener.onCategoryAdded()); break; } case clearItemId: { - categoryViewHolder.icon.setImageDrawable(context.getResources().getDrawable(category.icon)); - categoryViewHolder.categoryWrapper.setOnClickListener((v) -> listener.onCategoryCleared()); + categoryViewHolder.getIcon().setImageDrawable(context.getResources().getDrawable(category.icon)); + categoryViewHolder.getCategoryWrapper().setOnClickListener((v) -> listener.onCategoryCleared()); break; } default: { - categoryViewHolder.icon.setImageDrawable(context.getResources().getDrawable(category.icon)); - categoryViewHolder.categoryWrapper.setOnClickListener((v) -> listener.onCategoryChosen(category.label)); + categoryViewHolder.getIcon().setImageDrawable(context.getResources().getDrawable(category.icon)); + categoryViewHolder.getCategoryWrapper().setOnClickListener((v) -> listener.onCategoryChosen(category.label)); } } - categoryViewHolder.category.setText(NoteUtil.extendCategory(category.label)); + categoryViewHolder.getCategory().setText(NoteUtil.extendCategory(category.label)); if (category.count > 0) { - categoryViewHolder.count.setText(String.valueOf(category.count)); + categoryViewHolder.getCount().setText(String.valueOf(category.count)); } else { - categoryViewHolder.count.setVisibility(View.GONE); + categoryViewHolder.getCount().setVisibility(View.GONE); } } @@ -80,21 +79,27 @@ public class CategoryAdapter extends RecyclerView.Adapter