use of butter.droid.ui.main.genre.list.model.UiGenre in project butter-android by butterproject.
the class MediaListPresenterImpl method onGenreChanged.
@Override
public void onGenreChanged(UiGenre genre) {
Genre g = genre.getGenre();
if (filter.getGenre() == null || !filter.getGenre().equals(g)) {
filter = new Filter(g, filter.getSorter(), filter.getQuery());
items.clear();
view.refreshAdapter();
}
}
use of butter.droid.ui.main.genre.list.model.UiGenre in project butter-android by butterproject.
the class GenreSelectionPresenterImpl method onGenreSelected.
@Override
public void onGenreSelected(int position) {
if (position != selectedGenrePosition) {
if (selectedGenrePosition >= 0) {
genres.get(selectedGenrePosition).setSelected(false);
view.notifyItemUpdated(selectedGenrePosition);
}
UiGenre genre = genres.get(position);
genre.setSelected(true);
selectedGenrePosition = position;
view.notifyItemUpdated(position);
parentPresenter.onGenreChanged(genre);
}
}
use of butter.droid.ui.main.genre.list.model.UiGenre in project butter-android by butterproject.
the class GenreAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
UiGenre item = getItem(position);
holder.itemView.setBackgroundColor(item.isSelected() ? selectedColor : normalColor);
holder.text1.setText(item.getLabel());
}