中文文档
- Simplify the use of registerForActivityResult.
- The user will no longer need to manage the call of registerForActivityResult in a specific life cycle.
- Support streaming call to avoid callback hell.
- In order to develop quickly, a SimpleLauncher is built-in. If it does not meet the requirements, please extend BaseLauncher.
- For more functions, please refer to the demo.
implementation("io.github.clistery:stream-arl:1.0.4")
val permissionsLauncher: PermissionsLauncher = bindLauncher(this)
val openMediaLauncher: SimpleLauncher<Array<String>, Uri> = simpleLauncher(ContractType.OpenDocument, this)
permissionsLauncher
.input(arrayOf(android.Manifest.permission.READ_EXTERNAL_STORAGE))
.next(openMediaLauncher)
.input(arrayOf("image/*"))
.checker { null != it }
.launch()
.onSuccess {
setResultTxt(it.toString())
}.onFailure {
setResultTxt(it.stackTraceToString())
}