ui: disable queue adding if no playback
If theres no playback going on, disable the play next/add to queue options, as they will have no effect. This mostly for QoL purposes.
This commit is contained in:
parent
e5901fa9e2
commit
47fca7819f
3 changed files with 11 additions and 6 deletions
|
@ -117,11 +117,10 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
window?.setDecorFitsSystemWindows(false)
|
||||
|
||||
// "Should we automatically acquire the insets we need and return them
|
||||
// whenever the user wants them?"
|
||||
// "Nah, let's make the user define what insets they want instead through
|
||||
// a barely-documented API that is not brought up in a single tutorial!"
|
||||
// "Great idea!"
|
||||
// Instead of automatically fetching these insets and exposing them,
|
||||
// the R+ SDK decides to make you specify the insets yourself with a barely
|
||||
// documented API that isn't even mentioned in any of the edge-to-edge
|
||||
// tutorials. Thanks android, very cool!
|
||||
binding.root.setOnApplyWindowInsetsListener { _, insets ->
|
||||
WindowInsets.Builder()
|
||||
.setInsets(
|
||||
|
|
|
@ -80,6 +80,12 @@ class ActionMenu(
|
|||
}
|
||||
|
||||
inflate(menuRes)
|
||||
|
||||
// Disable any queue options if we don't have anything playing.
|
||||
val queueEnabled = playbackModel.song.value != null
|
||||
menu.findItem(R.id.action_play_next)?.isEnabled = queueEnabled
|
||||
menu.findItem(R.id.action_queue_add)?.isEnabled = queueEnabled
|
||||
|
||||
setOnMenuItemClickListener { item ->
|
||||
onMenuClick(item.itemId)
|
||||
true
|
||||
|
|
|
@ -76,8 +76,8 @@ sh("git clone https://github.com/oxygencobalt/ExoPlayer.git " + exoplayer_path)
|
|||
os.chdir(exoplayer_path)
|
||||
sh("git checkout auxio")
|
||||
|
||||
print(INFO + "info:" + NC + " installing flac extension...")
|
||||
flac_ext_jni_path = os.path.join("extensions", "flac", "src", "main", "jni")
|
||||
print(INFO + "info:" + NC + " installing FLAC extension...")
|
||||
os.chdir(flac_ext_jni_path)
|
||||
sh('curl "https://ftp.osuosl.org/pub/xiph/releases/flac/flac-' + FLAC_VERSION + '.tar.xz" | tar xJ && mv "flac-' + FLAC_VERSION + '" flac')
|
||||
sh(ndk_path + "/ndk-build APP_ABI=all -j4")
|
||||
|
|
Loading…
Reference in a new issue