Minimal playback
This commit is contained in:
parent
80070f4174
commit
3e7f11c588
14 changed files with 405 additions and 12 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue