info: update documentation
Update the general documentation for the app.
This commit is contained in:
@@ -176,7 +176,7 @@ class HomeFragment : ViewBindingFragment<FragmentHomeBinding>(), Toolbar.OnMenuI
|
||||
homeModel.updateCurrentSort(
|
||||
unlikelyToBeNull(
|
||||
homeModel
|
||||
.getSortForDisplay(unlikelyToBeNull(homeModel.currentTab.value))
|
||||
.getSortForDisplay(homeModel.currentTab.value)
|
||||
.ascending(item.isChecked)))
|
||||
}
|
||||
else -> {
|
||||
@@ -185,7 +185,7 @@ class HomeFragment : ViewBindingFragment<FragmentHomeBinding>(), Toolbar.OnMenuI
|
||||
homeModel.updateCurrentSort(
|
||||
unlikelyToBeNull(
|
||||
homeModel
|
||||
.getSortForDisplay(unlikelyToBeNull(homeModel.currentTab.value))
|
||||
.getSortForDisplay(homeModel.currentTab.value)
|
||||
.assignId(item.itemId)))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.oxycblt.auxio.ui.SyncBackingData
|
||||
import org.oxycblt.auxio.util.formatDuration
|
||||
import org.oxycblt.auxio.util.launch
|
||||
import org.oxycblt.auxio.util.logEOrThrow
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
|
||||
/**
|
||||
* A [HomeListFragment] for showing a list of [Album]s.
|
||||
@@ -54,7 +53,7 @@ class AlbumListFragment : HomeListFragment<Album>() {
|
||||
}
|
||||
|
||||
override fun getPopup(pos: Int): String? {
|
||||
val album = unlikelyToBeNull(homeModel.albums.value)[pos]
|
||||
val album = homeModel.albums.value[pos]
|
||||
|
||||
// Change how we display the popup depending on the mode.
|
||||
return when (homeModel.getSortForDisplay(DisplayMode.SHOW_ALBUMS)) {
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.oxycblt.auxio.ui.SyncBackingData
|
||||
import org.oxycblt.auxio.util.formatDuration
|
||||
import org.oxycblt.auxio.util.launch
|
||||
import org.oxycblt.auxio.util.logEOrThrow
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
|
||||
/**
|
||||
* A [HomeListFragment] for showing a list of [Artist]s.
|
||||
@@ -54,7 +53,7 @@ class ArtistListFragment : HomeListFragment<Artist>() {
|
||||
}
|
||||
|
||||
override fun getPopup(pos: Int): String? {
|
||||
val artist = unlikelyToBeNull(homeModel.artists.value)[pos]
|
||||
val artist = homeModel.artists.value[pos]
|
||||
|
||||
// Change how we display the popup depending on the mode.
|
||||
return when (homeModel.getSortForDisplay(DisplayMode.SHOW_ARTISTS)) {
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.oxycblt.auxio.ui.SyncBackingData
|
||||
import org.oxycblt.auxio.util.formatDuration
|
||||
import org.oxycblt.auxio.util.launch
|
||||
import org.oxycblt.auxio.util.logEOrThrow
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
|
||||
/**
|
||||
* A [HomeListFragment] for showing a list of [Genre]s.
|
||||
@@ -54,7 +53,7 @@ class GenreListFragment : HomeListFragment<Genre>() {
|
||||
}
|
||||
|
||||
override fun getPopup(pos: Int): String? {
|
||||
val genre = unlikelyToBeNull(homeModel.genres.value)[pos]
|
||||
val genre = homeModel.genres.value[pos]
|
||||
|
||||
// Change how we display the popup depending on the mode.
|
||||
return when (homeModel.getSortForDisplay(DisplayMode.SHOW_GENRES)) {
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.oxycblt.auxio.ui.SyncBackingData
|
||||
import org.oxycblt.auxio.util.formatDuration
|
||||
import org.oxycblt.auxio.util.launch
|
||||
import org.oxycblt.auxio.util.logEOrThrow
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
|
||||
/**
|
||||
* A [HomeListFragment] for showing a list of [Song]s.
|
||||
@@ -53,7 +52,7 @@ class SongListFragment : HomeListFragment<Song>() {
|
||||
}
|
||||
|
||||
override fun getPopup(pos: Int): String? {
|
||||
val song = unlikelyToBeNull(homeModel.songs.value)[pos]
|
||||
val song = homeModel.songs.value[pos]
|
||||
|
||||
// Change how we display the popup depending on the mode.
|
||||
// Note: We don't use the more correct individual artist name here, as sorts are largely
|
||||
|
||||
@@ -35,7 +35,6 @@ import org.oxycblt.auxio.playback.state.PlaybackStateManager
|
||||
import org.oxycblt.auxio.playback.state.RepeatMode
|
||||
import org.oxycblt.auxio.settings.SettingsManager
|
||||
import org.oxycblt.auxio.util.logE
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
|
||||
/**
|
||||
* The ViewModel that provides a UI frontend for [PlaybackStateManager].
|
||||
@@ -194,15 +193,14 @@ class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback, MusicStore
|
||||
|
||||
/** Remove a queue item using it's recyclerview adapter index. */
|
||||
fun removeQueueDataItem(adapterIndex: Int) {
|
||||
val index =
|
||||
adapterIndex + (playbackManager.queue.size - unlikelyToBeNull(_nextUp.value).size)
|
||||
val index = adapterIndex + (playbackManager.queue.size - _nextUp.value.size)
|
||||
if (index in playbackManager.queue.indices) {
|
||||
playbackManager.removeQueueItem(index)
|
||||
}
|
||||
}
|
||||
/** Move queue items using their recyclerview adapter indices. */
|
||||
fun moveQueueDataItems(adapterFrom: Int, adapterTo: Int): Boolean {
|
||||
val delta = (playbackManager.queue.size - unlikelyToBeNull(_nextUp.value).size)
|
||||
val delta = (playbackManager.queue.size - _nextUp.value.size)
|
||||
val from = adapterFrom + delta
|
||||
val to = adapterTo + delta
|
||||
if (from in playbackManager.queue.indices && to in playbackManager.queue.indices) {
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.oxycblt.auxio.playback.state.PlaybackStateManager
|
||||
import org.oxycblt.auxio.playback.state.RepeatMode
|
||||
import org.oxycblt.auxio.settings.SettingsManager
|
||||
import org.oxycblt.auxio.util.logD
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
|
||||
/**
|
||||
* The component managing the [MediaSessionCompat] instance.
|
||||
@@ -122,8 +121,7 @@ class MediaSessionComponent(private val context: Context, private val player: Pl
|
||||
}
|
||||
|
||||
if (song.album.year != null) {
|
||||
metadata.putString(
|
||||
MediaMetadataCompat.METADATA_KEY_DATE, unlikelyToBeNull(song.album.year).toString())
|
||||
metadata.putString(MediaMetadataCompat.METADATA_KEY_DATE, song.album.year.toString())
|
||||
}
|
||||
|
||||
// Normally, android expects one to provide a URI to the metadata instance instead of
|
||||
|
||||
@@ -44,6 +44,8 @@ import org.oxycblt.auxio.util.logEOrThrow
|
||||
* @author OxygenCobalt
|
||||
*
|
||||
* TODO: Make comparators static instances
|
||||
*
|
||||
* TODO: Separate sort mode and ascending state
|
||||
*/
|
||||
sealed class Sort(open val isAscending: Boolean) {
|
||||
protected abstract val sortIntCode: Int
|
||||
|
||||
Reference in New Issue
Block a user