Text Camera Switch view positioning fixes.

This commit is contained in:
Alex Hart
2022-03-21 13:01:33 -03:00
committed by Greyson Parrelli
parent 782464f664
commit ef6e846512
3 changed files with 46 additions and 11 deletions

View File

@@ -74,14 +74,10 @@ class MediaSelectionActivity :
val cameraSwitch: View = findViewById(R.id.camera_switch)
textSwitch.setOnClickListener {
textSwitch.isSelected = true
cameraSwitch.isSelected = false
viewModel.sendCommand(HudCommand.GoToText)
}
cameraSwitch.setOnClickListener {
textSwitch.isSelected = false
cameraSwitch.isSelected = true
viewModel.sendCommand(HudCommand.GoToCapture)
}
@@ -103,8 +99,16 @@ class MediaSelectionActivity :
(supportFragmentManager.findFragmentByTag(NAV_HOST_TAG) as NavHostFragment).navController.addOnDestinationChangedListener { _, d, _ ->
when (d.id) {
R.id.mediaCaptureFragment -> textStoryToggle.visible = canDisplayStorySwitch()
R.id.textStoryPostCreationFragment -> textStoryToggle.visible = canDisplayStorySwitch()
R.id.mediaCaptureFragment -> {
textStoryToggle.visible = canDisplayStorySwitch()
textSwitch.isSelected = false
cameraSwitch.isSelected = true
}
R.id.textStoryPostCreationFragment -> {
textStoryToggle.visible = canDisplayStorySwitch()
textSwitch.isSelected = true
cameraSwitch.isSelected = false
}
else -> textStoryToggle.visible = false
}
}