playback: fix detail remember shuffle
Fix remember shuffle not working in the detail views.
This commit is contained in:
parent
8ed4ead4c8
commit
df435a12b8
3 changed files with 7 additions and 8 deletions
|
@ -100,19 +100,19 @@ class PlaybackViewModel(application: Application) :
|
||||||
|
|
||||||
/** Play a song from it's album. */
|
/** Play a song from it's album. */
|
||||||
fun playFromAlbum(song: Song) {
|
fun playFromAlbum(song: Song) {
|
||||||
playbackManager.play(song, song.album, settings, false)
|
playbackManager.play(song, song.album, settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Play a song from it's artist. */
|
/** Play a song from it's artist. */
|
||||||
fun playFromArtist(song: Song, artist: Artist) {
|
fun playFromArtist(song: Song, artist: Artist) {
|
||||||
check(artist.songs.contains(song)) { "Invalid input: Artist is not linked to song" }
|
check(artist.songs.contains(song)) { "Invalid input: Artist is not linked to song" }
|
||||||
playbackManager.play(song, artist, settings, false)
|
playbackManager.play(song, artist, settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Play a song from the specific genre that contains the song. */
|
/** Play a song from the specific genre that contains the song. */
|
||||||
fun playFromGenre(song: Song, genre: Genre) {
|
fun playFromGenre(song: Song, genre: Genre) {
|
||||||
check(genre.songs.contains(song)) { "Invalid input: Genre is not linked to song" }
|
check(genre.songs.contains(song)) { "Invalid input: Genre is not linked to song" }
|
||||||
playbackManager.play(song, genre, settings, false)
|
playbackManager.play(song, genre, settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -30,7 +30,6 @@ import org.oxycblt.auxio.BuildConfig
|
||||||
import org.oxycblt.auxio.util.isLandscape
|
import org.oxycblt.auxio.util.isLandscape
|
||||||
import org.oxycblt.auxio.util.logD
|
import org.oxycblt.auxio.util.logD
|
||||||
import org.oxycblt.auxio.util.logW
|
import org.oxycblt.auxio.util.logW
|
||||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auxio's one and only appwidget. This widget follows a more unorthodox approach, effectively
|
* Auxio's one and only appwidget. This widget follows a more unorthodox approach, effectively
|
||||||
|
@ -170,9 +169,9 @@ class WidgetProvider : AppWidgetProvider() {
|
||||||
|
|
||||||
val layout =
|
val layout =
|
||||||
candidates.maxByOrNull { it.height * it.width }
|
candidates.maxByOrNull { it.height * it.width }
|
||||||
?: unlikelyToBeNull(views.minOfOrNull { it.key.width * it.key.height })
|
?: views.minBy { it.key.width * it.key.height }.key
|
||||||
|
|
||||||
logD("Using widget layout $layout")
|
logD("Using widget layout $layout ${views.contains(layout)}")
|
||||||
updateAppWidget(id, views[layout])
|
updateAppWidget(id, views[layout])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.7.10'
|
ext.kotlin_version = '1.7.20'
|
||||||
ext.navigation_version = "2.5.2"
|
ext.navigation_version = "2.5.2"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -9,7 +9,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.3.0'
|
classpath "com.android.tools.build:gradle:7.3.1"
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigation_version"
|
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigation_version"
|
||||||
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.10.0"
|
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.10.0"
|
||||||
|
|
Loading…
Reference in a new issue