コード例 #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();
 }