detail: add duration indicator to playlist
Add a duration indicator alongside the song count in the playlist detail header.
This commit is contained in:
parent
949a9c879c
commit
d0444bb41d
3 changed files with 8 additions and 2 deletions
|
@ -25,6 +25,7 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.databinding.ItemDetailHeaderBinding
|
||||
import org.oxycblt.auxio.music.Playlist
|
||||
import org.oxycblt.auxio.playback.formatDurationMs
|
||||
import org.oxycblt.auxio.util.context
|
||||
import org.oxycblt.auxio.util.getPlural
|
||||
import org.oxycblt.auxio.util.inflater
|
||||
|
@ -71,7 +72,10 @@ private constructor(private val binding: ItemDetailHeaderBinding) :
|
|||
isVisible = true
|
||||
text =
|
||||
if (playlist.songs.isNotEmpty()) {
|
||||
binding.context.getPlural(R.plurals.fmt_song_count, playlist.songs.size)
|
||||
binding.context.getString(
|
||||
R.string.fmt_two,
|
||||
binding.context.getPlural(R.plurals.fmt_song_count, playlist.songs.size),
|
||||
playlist.durationMs.formatDurationMs(true))
|
||||
} else {
|
||||
binding.context.getString(R.string.def_song_count)
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class AddToPlaylistDialog :
|
|||
private val footerAdapter = NewPlaylistFooterAdapter(this)
|
||||
|
||||
override fun onConfigDialog(builder: AlertDialog.Builder) {
|
||||
builder.setTitle(R.string.lbl_playlist_add).setNegativeButton(R.string.lbl_cancel, null)
|
||||
builder.setTitle(R.string.lbl_playlists).setNegativeButton(R.string.lbl_cancel, null)
|
||||
}
|
||||
|
||||
override fun onCreateBinding(inflater: LayoutInflater) =
|
||||
|
|
|
@ -33,6 +33,8 @@ import org.oxycblt.auxio.music.info.Name
|
|||
* Implements the fuzzy-ish searching algorithm used in the search view.
|
||||
*
|
||||
* @author Alexander Capehart
|
||||
*
|
||||
* TODO: Add playlists
|
||||
*/
|
||||
interface SearchEngine {
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue