예제 #1
0
  private void populateMoreInfoFromItem() {
    Res firstResource = content.getFirstResource();
    this.resourceUri = firstResource.getValue();
    this.mimeType = firstResource.getProtocolInfo().getContentFormatMimeType().toString();
    this.subtitle = this.mimeType;
    setDuration(firstResource);
    if (getMusicItem()) {
      this.musicItem = new MusicTrack((Item) this.content);
      this.subtitle = this.musicItem.getFirstArtist().getName();
      this.defaultResource = R.drawable.nocover_audio;
      this.type = "audio";
      return;
    }

    if (isAudioItemOrDerivative()) {
      this.defaultResource = R.drawable.nocover_audio;
      this.type = "audio";
      return;
    }
    if (isImageItemOrDerivative()) {
      this.defaultResource = R.drawable.ic_image_item;
      this.type = "image";
      return;
    }
    if (isVideoItemOrDerivative()) {
      this.defaultResource = R.drawable.nocover_audio;
      this.type = "video";
      return;
    }
  }
예제 #2
0
 public ContentItem(Item item, Service service) {
   this.service = service;
   this.content = item;
   this.className = content.getClass().getName();
   this.id = item.getId();
   this.isContainer = false;
   populateMoreInfoFromItem();
 }
예제 #3
0
 public List<Res> getRes() {
   return content.getResources();
 }
예제 #4
0
 @Override
 public String toString() {
   return content.getTitle();
 }
예제 #5
0
 @Override
 public int hashCode() {
   return content.hashCode();
 }