Search in sources :

Example 1 with UiGenre

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();
    }
}
Also used : Filter(butter.droid.provider.base.filter.Filter) Genre(butter.droid.provider.base.filter.Genre) UiGenre(butter.droid.ui.main.genre.list.model.UiGenre)

Example 2 with UiGenre

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);
    }
}
Also used : UiGenre(butter.droid.ui.main.genre.list.model.UiGenre)

Example 3 with UiGenre

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());
}
Also used : UiGenre(butter.droid.ui.main.genre.list.model.UiGenre)

Aggregations

UiGenre (butter.droid.ui.main.genre.list.model.UiGenre)3 Filter (butter.droid.provider.base.filter.Filter)1 Genre (butter.droid.provider.base.filter.Genre)1