Library annotations (#638)
Populate album name / artist name / song counts across different view as "subtitle" that enriches the main info displayed in the title. This includes the notification, different list-based views, the main menu, the now-playing view, search result... For example, the included images show the added annotations highlighted with white underline     
This commit is contained in:
parent
d86a4991b6
commit
b0a4ffdcb5
14 changed files with 100 additions and 47 deletions
|
|
@ -23,6 +23,7 @@ import android.widget.TextView;
|
|||
import android.widget.Toast;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import com.kabouzeid.appthemehelper.ThemeStore;
|
||||
import com.kabouzeid.appthemehelper.util.ATHUtil;
|
||||
import com.kabouzeid.appthemehelper.util.NavigationViewUtil;
|
||||
|
|
@ -42,7 +43,9 @@ import com.kabouzeid.gramophone.ui.activities.base.AbsSlidingMusicPanelActivity;
|
|||
import com.kabouzeid.gramophone.ui.activities.intro.AppIntroActivity;
|
||||
import com.kabouzeid.gramophone.ui.fragments.mainactivity.folders.FoldersFragment;
|
||||
import com.kabouzeid.gramophone.ui.fragments.mainactivity.library.LibraryFragment;
|
||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||
import com.kabouzeid.gramophone.util.PreferenceUtil;
|
||||
|
||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -217,7 +220,7 @@ public class MainActivity extends AbsSlidingMusicPanelActivity {
|
|||
});
|
||||
}
|
||||
((TextView) navigationDrawerHeader.findViewById(R.id.title)).setText(song.title);
|
||||
((TextView) navigationDrawerHeader.findViewById(R.id.text)).setText(song.artistName);
|
||||
((TextView) navigationDrawerHeader.findViewById(R.id.text)).setText(MusicUtil.getSongInfoString(song));
|
||||
SongGlideRequest.Builder.from(Glide.with(this), song)
|
||||
.checkIgnoreMediaStore(this).build()
|
||||
.into(((ImageView) navigationDrawerHeader.findViewById(R.id.image)));
|
||||
|
|
|
|||
|
|
@ -132,7 +132,12 @@ public abstract class AbsPlayerFragment extends AbsMusicServiceFragment implemen
|
|||
}
|
||||
|
||||
protected String getUpNextAndQueueTime() {
|
||||
return getResources().getString(R.string.up_next) + " • " + MusicUtil.getReadableDurationString(MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.getPosition()));
|
||||
final long duration = MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.getPosition());
|
||||
|
||||
return MusicUtil.buildInfoString(
|
||||
getResources().getString(R.string.up_next),
|
||||
MusicUtil.getReadableDurationString(duration)
|
||||
);
|
||||
}
|
||||
|
||||
public abstract void onShow();
|
||||
|
|
|
|||
|
|
@ -568,7 +568,7 @@ public class CardPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
public void updateCurrentSong(Song song) {
|
||||
currentSong = song;
|
||||
currentSongViewHolder.title.setText(song.title);
|
||||
currentSongViewHolder.text.setText(song.artistName);
|
||||
currentSongViewHolder.text.setText(MusicUtil.getSongInfoString(song));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -603,7 +603,7 @@ public class CardPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
@Override
|
||||
public void updateCurrentSong(Song song) {
|
||||
fragment.toolbar.setTitle(song.title);
|
||||
fragment.toolbar.setSubtitle(song.artistName);
|
||||
fragment.toolbar.setSubtitle(MusicUtil.getSongInfoString(song));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -548,7 +548,7 @@ public class FlatPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
public void updateCurrentSong(Song song) {
|
||||
currentSong = song;
|
||||
currentSongViewHolder.title.setText(song.title);
|
||||
currentSongViewHolder.text.setText(song.artistName);
|
||||
currentSongViewHolder.text.setText(MusicUtil.getSongInfoString(song));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -576,7 +576,7 @@ public class FlatPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
@Override
|
||||
public void updateCurrentSong(Song song) {
|
||||
fragment.toolbar.setTitle(song.title);
|
||||
fragment.toolbar.setSubtitle(song.artistName);
|
||||
fragment.toolbar.setSubtitle(MusicUtil.getSongInfoString(song));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue