예제 #1
0
 private static Cursor getCursorForQuery(
     Context paramContext, String paramString, long paramLong) {
   Cursor localCursor = null;
   String str2;
   switch ((int) paramLong) {
     default:
       String str1 = "Unexpected header id: " + paramLong;
       Log.wtf("MusicXdi", str1);
       return localCursor;
     case 1:
       str2 = "album";
     case 3:
     case 2:
     case 4:
   }
   while (true) {
     Uri localUri = MusicContent.Search.getSearchUri(paramString, str2);
     String[] arrayOfString1 = PROJECTION_SEARCH;
     Context localContext = paramContext;
     String[] arrayOfString2 = null;
     String str3 = null;
     localCursor =
         MusicUtils.query(localContext, localUri, arrayOfString1, null, arrayOfString2, str3);
     break;
     str2 = "artist";
     continue;
     str2 = "track";
     continue;
     str2 = "playlist";
   }
 }
예제 #2
0
 protected void bindViewToMediaListItem(
     View paramView, Context paramContext, Cursor paramCursor, long paramLong) {
   int i = 1;
   Document localDocument = MusicUtils.getDocument(paramView);
   long l = paramCursor.getLong(0);
   String str1 = paramCursor.getString(i);
   if (paramCursor.getInt(2) != 0) ;
   while (true) {
     localDocument.setId(l);
     localDocument.setArtistId(l);
     localDocument.setTitle(str1);
     localDocument.setArtistName(str1);
     Document.Type localType = Document.Type.ARTIST;
     localDocument.setType(localType);
     localDocument.setHasLocal(i);
     if (!paramCursor.isNull(4)) {
       String str2 = paramCursor.getString(4);
       localDocument.setArtistMetajamId(str2);
     }
     if (!paramCursor.isNull(3)) {
       String str3 = paramCursor.getString(3);
       localDocument.setArtUrl(str3);
     }
     if (!(paramView instanceof PlayCardView)) return;
     PlayCardView localPlayCardView = (PlayCardView) paramView;
     PlayCardView.ContextMenuDelegate localContextMenuDelegate =
         ArtistGridFragment.this.mCardsContextMenuDelegate;
     localPlayCardView.bind(localDocument, localContextMenuDelegate);
     return;
     int j = 0;
   }
 }
예제 #3
0
 private String getTrackArtist(Cursor paramCursor)
 {
   int i = this.mArtistIdx;
   String str = paramCursor.getString(i);
   if (MusicUtils.isUnknown(str))
     str = this.mUnknownArtist;
   return str;
 }
예제 #4
0
 private String getAlbum(Cursor paramCursor)
 {
   int i = this.mAlbumIdx;
   String str = paramCursor.getString(i);
   if (MusicUtils.isUnknown(str))
     str = this.mUnknownAlbum;
   return str;
 }
예제 #5
0
 private boolean isInInfiniteMixMode()
 {
   if (this.mIsInInfiniteMix == null)
   {
     if (MusicUtils.sService == null)
       break label35;
     Boolean localBoolean = Boolean.valueOf(MusicUtils.isInIniniteMixMode());
     this.mIsInInfiniteMix = localBoolean;
   }
   label35: for (boolean bool = this.mIsInInfiniteMix.booleanValue(); ; bool = false)
     return bool;
 }
예제 #6
0
 public void setVisibility(int paramInt) {
   super.setVisibility(paramInt);
   if (paramInt == 0) {
     PlaybackState localPlaybackState = MusicUtils.getPlaybackState();
     if (localPlaybackState == null) return;
     boolean bool1 = localPlaybackState.isPlaying();
     boolean bool2 = localPlaybackState.isStreaming();
     boolean bool3 = localPlaybackState.isPreparing();
     updatePlayState(bool1, bool2, bool3);
     return;
   }
   if (paramInt != 8) return;
   setPlayState(0);
 }
예제 #7
0
 private boolean isShowingNowPlaying()
 {
   if (this.mIsShowingNowPlaying == null)
   {
     if (this.mSongList == null)
       break label49;
     SongList localSongList1 = this.mSongList;
     SongList localSongList2 = MusicUtils.getNowPlayingList();
     Boolean localBoolean = Boolean.valueOf(localSongList1.equals(localSongList2));
     this.mIsShowingNowPlaying = localBoolean;
   }
   label49: for (boolean bool = this.mIsShowingNowPlaying.booleanValue(); ; bool = false)
     return bool;
 }
예제 #8
0
 public Document getDocument(int paramInt)
 {
   MusicUtils.assertUiThread();
   Document localDocument = new Document();
   if (paramInt >= 0)
   {
     int i = getCount();
     if (paramInt <= i);
   }
   else
   {
     Object[] arrayOfObject = new Object[2];
     Integer localInteger1 = Integer.valueOf(paramInt);
     arrayOfObject[0] = localInteger1;
     Integer localInteger2 = Integer.valueOf(getCount());
     arrayOfObject[1] = localInteger2;
     String str1 = String.format("Position out of range. pos=%d, count=%d", arrayOfObject);
     int j = Log.w("TrackListAdapter", str1);
   }
   while (true)
   {
     return localDocument;
     Cursor localCursor = getCursor();
     if ((localCursor != null) && (!localCursor.isClosed()) && (MusicUtils.hasCount(localCursor)))
     {
       int k = localCursor.getPosition();
       if (localCursor.moveToPosition(paramInt))
         populateDocumentFromCursor(localDocument, localCursor);
       if (!localCursor.moveToPosition(k))
       {
         String str2 = "Failed to restore the cursor to the original position: " + k;
         int m = Log.w("TrackListAdapter", str2);
       }
     }
   }
 }
예제 #9
0
 public void bindViewToMediaListItem(View paramView, Context paramContext, Cursor paramCursor, long paramLong)
 {
   ViewHolder localViewHolder = (ViewHolder)paramView.getTag();
   Document localDocument = localViewHolder.document;
   TrackListAdapter localTrackListAdapter = this;
   Cursor localCursor1 = paramCursor;
   localTrackListAdapter.populateDocumentFromCursor(localDocument, localCursor1);
   int i = this.mTitleIdx;
   CharArrayBuffer localCharArrayBuffer1 = localViewHolder.titleBuffer;
   Cursor localCursor2 = paramCursor;
   CharArrayBuffer localCharArrayBuffer2 = localCharArrayBuffer1;
   localCursor2.copyStringToBuffer(i, localCharArrayBuffer2);
   StatefulShadowTextView localStatefulShadowTextView1 = localViewHolder.title;
   char[] arrayOfChar = localViewHolder.titleBuffer.data;
   int j = localViewHolder.titleBuffer.sizeCopied;
   localStatefulShadowTextView1.setText(arrayOfChar, 0, j);
   boolean bool1 = this.mSongList instanceof SharedSongList;
   boolean bool2;
   label183: int n;
   label226: label248: boolean bool3;
   label277: boolean bool4;
   if (localViewHolder.contextMenu != null)
   {
     if (bool1)
       localViewHolder.contextMenu.setVisibility(4);
   }
   else
   {
     bool2 = isShowingNowPlaying();
     if (localViewHolder.play_indicator != null)
     {
       bool2 = false;
       if (canShowPlaybackIndicator())
       {
         if (!bool2)
           break label787;
         int k = paramCursor.getPosition();
         int m = this.mCurrentPlayPosition;
         if (k == m)
           break label781;
         bool2 = true;
         if ((!bool2) && (((this.mSongList instanceof PlaylistSongList)) || ((this.mSongList instanceof SelectedSongList))))
           bool2 = false;
       }
       PlayingIndicator localPlayingIndicator = localViewHolder.play_indicator;
       if (!bool2)
         break label839;
       n = 0;
       localPlayingIndicator.setVisibility(n);
       if (!bool2)
         break label846;
       localViewHolder.title.setTypeface(null, 1);
     }
     if (!UIStateManager.getInstance().isStreamingEnabled())
     {
       int i1 = this.mIsLocalIdx;
       if (paramCursor.getInt(i1) == 0)
         break label859;
     }
     bool3 = true;
     localViewHolder.isAvailable = bool3;
     int i2 = this.mHasRemoteIdx;
     if (paramCursor.getInt(i2) == 0)
       break label865;
     bool4 = true;
     label304: localViewHolder.hasRemote = bool4;
     StatefulShadowTextView localStatefulShadowTextView2 = localViewHolder.title;
     boolean bool5 = true;
     localStatefulShadowTextView2.setPrimaryAndOnline(bool5, bool3);
     if (localViewHolder.duration != null)
     {
       StatefulShadowTextView localStatefulShadowTextView3 = localViewHolder.duration;
       boolean bool6 = true;
       localStatefulShadowTextView3.setPrimaryAndOnline(bool6, bool3);
     }
     if (localViewHolder.artist != null)
     {
       StatefulShadowTextView localStatefulShadowTextView4 = localViewHolder.artist;
       boolean bool7 = false;
       localStatefulShadowTextView4.setPrimaryAndOnline(bool7, bool3);
     }
     if (localViewHolder.album != null)
     {
       StatefulShadowTextView localStatefulShadowTextView5 = localViewHolder.album;
       boolean bool8 = true;
       localStatefulShadowTextView5.setPrimaryAndOnline(bool8, bool3);
     }
     if (localViewHolder.year != null)
     {
       StatefulShadowTextView localStatefulShadowTextView6 = localViewHolder.year;
       boolean bool9 = true;
       localStatefulShadowTextView6.setPrimaryAndOnline(bool9, bool3);
     }
     if ((localViewHolder.year != null) && (this.mYearIdx >= 0))
     {
       int i3 = this.mYearIdx;
       int i4 = paramCursor.getInt(i3);
       if (i4 <= 0)
         break label871;
       StatefulShadowTextView localStatefulShadowTextView7 = localViewHolder.year;
       String str1 = Integer.toString(i4);
       localStatefulShadowTextView7.setText(str1);
       localViewHolder.year.setVisibility(0);
     }
     label504: if (localViewHolder.album != null)
     {
       StatefulShadowTextView localStatefulShadowTextView8 = localViewHolder.album;
       String str2 = localViewHolder.document.getAlbumName();
       localStatefulShadowTextView8.setText(str2);
     }
     if (localViewHolder.artist != null)
     {
       if (!this.mShowTrackArtist)
         break label883;
       StatefulShadowTextView localStatefulShadowTextView9 = localViewHolder.artist;
       String str3 = localViewHolder.document.getArtistName();
       localStatefulShadowTextView9.setText(str3);
       localViewHolder.artist.setVisibility(0);
     }
     label584: if (localViewHolder.duration != null)
     {
       int i5 = this.mDurationIdx;
       int i6 = paramCursor.getInt(i5) / 1000;
       StatefulShadowTextView localStatefulShadowTextView10 = localViewHolder.duration;
       Context localContext = getContext();
       long l1 = i6;
       String str4 = MusicUtils.makeTimeString(localContext, l1);
       localStatefulShadowTextView10.setText(str4);
     }
     if (localViewHolder.icon != null)
     {
       if ((this.mShowAlbumArt) && (!bool1))
         break label896;
       localViewHolder.icon.setVisibility(8);
     }
     label676: if (bool2)
     {
       if (!isInInfiniteMixMode())
         break label985;
       int i7 = paramCursor.getCount();
       int i8 = paramCursor.getPosition();
       ViewUtils.fadeViewForPosition(paramView, i7, i8, 4);
     }
   }
   while (true)
   {
     if (!this.mEditMode)
       break label995;
     int i9 = paramView.getPaddingLeft();
     int i10 = paramView.getPaddingTop();
     int i11 = paramView.getPaddingRight();
     int i12 = paramView.getPaddingBottom();
     Drawable localDrawable = this.mDragHandleBG;
     paramView.setBackgroundDrawable(localDrawable);
     paramView.setPadding(i9, i10, i11, i12);
     return;
     localViewHolder.contextMenu.setVisibility(0);
     break;
     label781: bool2 = false;
     break label183;
     label787: if (this.mCurrentAudioId == null)
       break label183;
     int i13 = this.mAudioIdIdx;
     long l2 = paramCursor.getLong(i13);
     long l3 = this.mCurrentAudioId.getId();
     if (l2 == l3);
     for (bool2 = true; ; bool2 = false)
       break;
     label839: n = 8;
     break label226;
     label846: localViewHolder.title.setTypeface(null, 0);
     break label248;
     label859: bool3 = false;
     break label277;
     label865: bool4 = false;
     break label304;
     label871: localViewHolder.year.setVisibility(4);
     break label504;
     label883: localViewHolder.artist.setVisibility(8);
     break label584;
     label896: localViewHolder.icon.setVisibility(0);
     localViewHolder.icon.setAvailable(bool3);
     if (!TextUtils.isEmpty(localViewHolder.document.getArtUrl()))
     {
       AsyncAlbumArtImageView localAsyncAlbumArtImageView1 = localViewHolder.icon;
       String str5 = localViewHolder.document.getArtUrl();
       localAsyncAlbumArtImageView1.setExternalAlbumArt(str5);
       break label676;
     }
     AsyncAlbumArtImageView localAsyncAlbumArtImageView2 = localViewHolder.icon;
     long l4 = localViewHolder.document.getAlbumId();
     localAsyncAlbumArtImageView2.setAlbumId(l4, null, null);
     break label676;
     label985: ViewUtils.setAlpha(paramView, 1.0F);
   }
   label995: paramView.setBackgroundDrawable(null);
 }