@Override
  public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item) {
    if (!(item instanceof GridButton)) return;
    GridButton gridItem = (GridButton) item;

    ((ViewHolder) viewHolder).setItem(gridItem);

    // Log.d(TAG, "onBindViewHolder");
    ((ViewHolder) viewHolder).mCardView.setTitleText(gridItem.getText());
    ((ViewHolder) viewHolder).updateCardViewImage(gridItem.getImageIndex());
  }
Ejemplo n.º 2
0
 public String getPrimaryImageUrl(int maxHeight) {
   switch (type) {
     case BaseItem:
     case LiveTvProgram:
     case LiveTvRecording:
       return Utils.getPrimaryImageUrl(
           baseItem, TvApp.getApplication().getApiClient(), true, preferParentThumb, maxHeight);
     case Person:
       return Utils.getPrimaryImageUrl(person, TvApp.getApplication().getApiClient(), maxHeight);
     case User:
       return Utils.getPrimaryImageUrl(user, TvApp.getApplication().getLoginApiClient());
     case Chapter:
       return chapterInfo.getImagePath();
     case LiveTvChannel:
       return Utils.getPrimaryImageUrl(channelInfo, TvApp.getApplication().getApiClient());
     case Server:
       return "android.resource://tv.emby.embyatv/" + R.drawable.server;
     case GridButton:
       return "android.resource://tv.emby.embyatv/" + gridButton.getImageIndex();
     case SearchHint:
       return !Utils.IsEmpty(searchHint.getPrimaryImageTag())
           ? Utils.getImageUrl(
               searchHint.getItemId(),
               ImageType.Primary,
               searchHint.getPrimaryImageTag(),
               TvApp.getApplication().getApiClient())
           : !Utils.IsEmpty(searchHint.getThumbImageItemId())
               ? Utils.getImageUrl(
                   searchHint.getThumbImageItemId(),
                   ImageType.Thumb,
                   searchHint.getThumbImageTag(),
                   TvApp.getApplication().getApiClient())
               : null;
   }
   return null;
 }