メインコンテンツまでスキップ
For the complete documentation index, see llms.txt.

Camera State

Every time any camera property is changing UX Framework produces its new state. You may collect such information via Dash.controller.observeCameraState() flow.

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
Dash.controller
.observeCameraState()
.debounce(1000.milliseconds)
.collect(this) { cameraState ->
// do something with camera state
}
}
}
}
}

Be aware that camera state properties change often. It might be good to limit received calls with debounce() operator.

この{Type}は役に立ちましたか?