Minimal playback

This commit is contained in:
Damontecres 2025-09-22 17:02:32 -04:00
parent 80070f4174
commit 3e7f11c588
No known key found for this signature in database
14 changed files with 405 additions and 12 deletions

View file

@ -1,5 +1,7 @@
package com.github.damontecres.dolphin
import androidx.compose.ui.focus.FocusRequester
import timber.log.Timber
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
@ -10,3 +12,15 @@ fun CharSequence?.isNotNullOrBlank(): Boolean {
}
return !this.isNullOrBlank()
}
/**
* Try to call [FocusRequester.requestFocus], but catch & log the exception if something is not configured properly
*/
fun FocusRequester.tryRequestFocus(): Boolean =
try {
requestFocus()
true
} catch (ex: IllegalStateException) {
Timber.w(ex, "Failed to request focus")
false
}