You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.
Internally for our project I have written a simple Kotlin DSL to make dealing with state change events in media controller callbacks simpler and easier to write/read.
As an example, the DSL allows you to do things like the following:
val canceler = session.whenSession { // start configuring a listener for a media session
stateChanges { state ->// whenever the state changes...
configureUIForState(state) // ...update the UI for the new state
}
startsPlaying { // when playing state is entered...
onStartPlaying() //...handle it
}
metadataChanges { metadata ->// when metadata for the session changes...
setupUI(metadata) // ...update the UI
}
positionChanges { position ->// when media position changes...
updateSeekProgress(position) // ...update seek progress
}
}
// ... some time later ...
canceler.stopListening() // stop listening to events
A first draft implementation (missing features that could be added and unit tests) is here
I'm wondering if you will consider this an appropriate addition to ktx and would like to get your feedback before I put more work into it.
I do however realize you are not yet supporting new APIs for the support library
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
Internally for our project I have written a simple Kotlin DSL to make dealing with state change events in media controller callbacks simpler and easier to write/read.
As an example, the DSL allows you to do things like the following:
A first draft implementation (missing features that could be added and unit tests) is here
I'm wondering if you will consider this an appropriate addition to ktx and would like to get your feedback before I put more work into it.
I do however realize you are not yet supporting new APIs for the support library
The text was updated successfully, but these errors were encountered: