mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
fix: fixed the bug that was causing one ImageFragment testcase to fail.
This commit is contained in:
parent
1823f8359c
commit
e95cd14321
1 changed files with 17 additions and 15 deletions
|
|
@ -233,21 +233,6 @@ class ImageFragment :
|
|||
onChangeSwitchState(isChecked)
|
||||
_switchState.value = isChecked
|
||||
}
|
||||
|
||||
viewLifecycleOwner.lifecycleScope.launch {
|
||||
repeatOnLifecycle(Lifecycle.State.STARTED) {
|
||||
combine(
|
||||
imageAdapter.currentImagesCount,
|
||||
switchState
|
||||
) { imageCount, isChecked ->
|
||||
imageCount to isChecked
|
||||
}.collect { (imageCount, isChecked) ->
|
||||
binding?.allImagesUploadedOrMarked?.isVisible =
|
||||
!isChecked && imageCount == 0 && (switch?.isVisible == true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
selectorRV = binding?.selectorRv
|
||||
loader = binding?.loader
|
||||
progressLayout = binding?.progressLayout
|
||||
|
|
@ -267,6 +252,23 @@ class ImageFragment :
|
|||
return binding?.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
viewLifecycleOwner.lifecycleScope.launch {
|
||||
repeatOnLifecycle(Lifecycle.State.STARTED) {
|
||||
combine(
|
||||
imageAdapter.currentImagesCount,
|
||||
switchState
|
||||
) { imageCount, isChecked ->
|
||||
imageCount to isChecked
|
||||
}.collect { (imageCount, isChecked) ->
|
||||
binding?.allImagesUploadedOrMarked?.isVisible =
|
||||
!isChecked && imageCount == 0 && (switch?.isVisible == true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun onChangeSwitchState(checked: Boolean) {
|
||||
if (checked) {
|
||||
showAlreadyActionedImages = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue