Merged Jw -> (Qi Ying -> Harine)
This commit is contained in:
@@ -70,7 +70,7 @@ class BowlingCameraActivity : AppCompatActivity(), CameraXController.Callback {
|
||||
private lateinit var stepCounterUi: StepCounterUiController
|
||||
// class for FeedbackUI
|
||||
private lateinit var feedbackUI: FeedbackUI
|
||||
private val stepLabels = listOf(
|
||||
private val stepLabels = listOf<Int>(
|
||||
R.string.pose_phase_waiting,
|
||||
R.string.pose_phase_starting_stance,
|
||||
R.string.first_step,
|
||||
@@ -82,7 +82,7 @@ class BowlingCameraActivity : AppCompatActivity(), CameraXController.Callback {
|
||||
private var currentStepIndex = 0
|
||||
|
||||
private val permissionLauncher =
|
||||
registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { _ ->
|
||||
registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { _: Map<String, Boolean> ->
|
||||
val granted = CameraPermissions.allGranted(this)
|
||||
viewModel.onPermissionsResult(granted)
|
||||
if (granted) {
|
||||
@@ -220,7 +220,8 @@ class BowlingCameraActivity : AppCompatActivity(), CameraXController.Callback {
|
||||
}
|
||||
launch {
|
||||
viewModel.errorEvents.collect { message ->
|
||||
Toast.makeText(this@BowlingCameraActivity, message, Toast.LENGTH_LONG).show()
|
||||
Toast.makeText(this@BowlingCameraActivity, message, Toast.LENGTH_LONG)
|
||||
.show()
|
||||
}
|
||||
}
|
||||
launch {
|
||||
@@ -232,7 +233,12 @@ class BowlingCameraActivity : AppCompatActivity(), CameraXController.Callback {
|
||||
}
|
||||
}
|
||||
launch {
|
||||
viewModel.handRaiseProgress.collect { progress -> stepCounterUi.renderHandRaiseProgress(progress) }
|
||||
viewModel.handRaiseProgress.collect { progress ->
|
||||
stepCounterUi.renderHandRaiseProgress(
|
||||
progress
|
||||
)
|
||||
}
|
||||
}
|
||||
// Deliberately its own collector, independent of stepEvents
|
||||
// above -- delivery-phase feedback and step counting are
|
||||
// separate concerns (see PosePhaseDetector's class doc).
|
||||
|
||||
Reference in New Issue
Block a user