all: format
This commit is contained in:
@@ -22,12 +22,10 @@ import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.yield
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.detail.list.DiscDivider
|
||||
import org.oxycblt.auxio.detail.list.DiscHeader
|
||||
@@ -302,8 +300,8 @@ constructor(
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a new [currentSong] from it's [Music.UID]. [currentSong] will
|
||||
* be updated to align with the new [Song].
|
||||
* Set a new [currentSong] from it's [Music.UID]. [currentSong] will be updated to align with
|
||||
* the new [Song].
|
||||
*
|
||||
* @param uid The UID of the [Song] to load. Must be valid.
|
||||
*/
|
||||
@@ -504,9 +502,7 @@ constructor(
|
||||
})
|
||||
}
|
||||
|
||||
private fun refreshAudioInfo(song: Song) {
|
||||
|
||||
}
|
||||
private fun refreshAudioInfo(song: Song) {}
|
||||
|
||||
private inline fun <T : MusicParent> refreshDetail(
|
||||
detail: Detail<T>?,
|
||||
|
||||
@@ -20,7 +20,6 @@ package org.oxycblt.auxio.detail
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.text.format.Formatter
|
||||
import android.view.LayoutInflater
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.fragment.app.activityViewModels
|
||||
@@ -29,13 +28,8 @@ import androidx.navigation.fragment.navArgs
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.databinding.DialogSongDetailBinding
|
||||
import org.oxycblt.auxio.detail.list.SongProperty
|
||||
import org.oxycblt.auxio.detail.list.SongPropertyAdapter
|
||||
import org.oxycblt.auxio.list.adapter.UpdateInstructions
|
||||
import org.oxycblt.auxio.music.resolve
|
||||
import org.oxycblt.auxio.music.resolveNames
|
||||
import org.oxycblt.auxio.playback.formatDurationMs
|
||||
import org.oxycblt.auxio.playback.replaygain.formatDb
|
||||
import org.oxycblt.auxio.ui.ViewBindingMaterialDialogFragment
|
||||
import org.oxycblt.auxio.util.collectImmediately
|
||||
import org.oxycblt.auxio.util.concatLocalized
|
||||
@@ -75,59 +69,70 @@ class SongDetailDialog : ViewBindingMaterialDialogFragment<DialogSongDetailBindi
|
||||
}
|
||||
|
||||
private fun updateSong(song: Song?) {
|
||||
// if (song == null) {
|
||||
L.d("No song to show, navigating away")
|
||||
findNavController().navigateUp()
|
||||
return
|
||||
// }
|
||||
//
|
||||
// if (info != null) {
|
||||
// val context = requireContext()
|
||||
// detailAdapter.update(
|
||||
// buildList {
|
||||
// add(SongProperty(R.string.lbl_name, song.zipName(context)))
|
||||
// add(SongProperty(R.string.lbl_album, song.album.zipName(context)))
|
||||
// add(SongProperty(R.string.lbl_artists, song.artists.zipNames(context)))
|
||||
// add(SongProperty(R.string.lbl_genres, song.genres.resolveNames(context)))
|
||||
// song.date?.let { add(SongProperty(R.string.lbl_date, it.resolve(context))) }
|
||||
// song.track?.let {
|
||||
// add(SongProperty(R.string.lbl_track, getString(R.string.fmt_number, it)))
|
||||
// }
|
||||
// song.disc?.let {
|
||||
// val formattedNumber = getString(R.string.fmt_number, it.number)
|
||||
// val zipped =
|
||||
// if (it.name != null) {
|
||||
// getString(R.string.fmt_zipped_names, formattedNumber, it.name)
|
||||
// } else {
|
||||
// formattedNumber
|
||||
// }
|
||||
// add(SongProperty(R.string.lbl_disc, zipped))
|
||||
// }
|
||||
// add(SongProperty(R.string.lbl_path, song.path.resolve(context)))
|
||||
// // info.format.resolveName(context)?.let {
|
||||
// // add(SongProperty(R.string.lbl_format, it))
|
||||
// // }
|
||||
// add(
|
||||
// SongProperty(
|
||||
// R.string.lbl_size, Formatter.formatFileSize(context, song.size)))
|
||||
// add(SongProperty(R.string.lbl_duration, song.durationMs.formatDurationMs(true)))
|
||||
// info.bitrateKbps?.let {
|
||||
// add(SongProperty(R.string.lbl_bitrate, getString(R.string.fmt_bitrate, it)))
|
||||
// }
|
||||
// info.sampleRateHz?.let {
|
||||
// add(
|
||||
// SongProperty(
|
||||
// R.string.lbl_sample_rate, getString(R.string.fmt_sample_rate, it)))
|
||||
// }
|
||||
// song.replayGainAdjustment.track?.let {
|
||||
// add(SongProperty(R.string.lbl_replaygain_track, it.formatDb(context)))
|
||||
// }
|
||||
// song.replayGainAdjustment.album?.let {
|
||||
// add(SongProperty(R.string.lbl_replaygain_album, it.formatDb(context)))
|
||||
// }
|
||||
// },
|
||||
// UpdateInstructions.Replace(0))
|
||||
// }
|
||||
// if (song == null) {
|
||||
L.d("No song to show, navigating away")
|
||||
findNavController().navigateUp()
|
||||
return
|
||||
// }
|
||||
//
|
||||
// if (info != null) {
|
||||
// val context = requireContext()
|
||||
// detailAdapter.update(
|
||||
// buildList {
|
||||
// add(SongProperty(R.string.lbl_name, song.zipName(context)))
|
||||
// add(SongProperty(R.string.lbl_album, song.album.zipName(context)))
|
||||
// add(SongProperty(R.string.lbl_artists,
|
||||
// song.artists.zipNames(context)))
|
||||
// add(SongProperty(R.string.lbl_genres,
|
||||
// song.genres.resolveNames(context)))
|
||||
// song.date?.let { add(SongProperty(R.string.lbl_date,
|
||||
// it.resolve(context))) }
|
||||
// song.track?.let {
|
||||
// add(SongProperty(R.string.lbl_track,
|
||||
// getString(R.string.fmt_number, it)))
|
||||
// }
|
||||
// song.disc?.let {
|
||||
// val formattedNumber = getString(R.string.fmt_number, it.number)
|
||||
// val zipped =
|
||||
// if (it.name != null) {
|
||||
// getString(R.string.fmt_zipped_names, formattedNumber,
|
||||
// it.name)
|
||||
// } else {
|
||||
// formattedNumber
|
||||
// }
|
||||
// add(SongProperty(R.string.lbl_disc, zipped))
|
||||
// }
|
||||
// add(SongProperty(R.string.lbl_path, song.path.resolve(context)))
|
||||
// // info.format.resolveName(context)?.let {
|
||||
// // add(SongProperty(R.string.lbl_format, it))
|
||||
// // }
|
||||
// add(
|
||||
// SongProperty(
|
||||
// R.string.lbl_size, Formatter.formatFileSize(context,
|
||||
// song.size)))
|
||||
// add(SongProperty(R.string.lbl_duration,
|
||||
// song.durationMs.formatDurationMs(true)))
|
||||
// info.bitrateKbps?.let {
|
||||
// add(SongProperty(R.string.lbl_bitrate,
|
||||
// getString(R.string.fmt_bitrate, it)))
|
||||
// }
|
||||
// info.sampleRateHz?.let {
|
||||
// add(
|
||||
// SongProperty(
|
||||
// R.string.lbl_sample_rate,
|
||||
// getString(R.string.fmt_sample_rate, it)))
|
||||
// }
|
||||
// song.replayGainAdjustment.track?.let {
|
||||
// add(SongProperty(R.string.lbl_replaygain_track,
|
||||
// it.formatDb(context)))
|
||||
// }
|
||||
// song.replayGainAdjustment.album?.let {
|
||||
// add(SongProperty(R.string.lbl_replaygain_album,
|
||||
// it.formatDb(context)))
|
||||
// }
|
||||
// },
|
||||
// UpdateInstructions.Replace(0))
|
||||
// }
|
||||
}
|
||||
|
||||
private fun <T : Music> T.zipName(context: Context): String {
|
||||
|
||||
Reference in New Issue
Block a user