Created
November 6, 2018 10:59
-
-
Save EmmanuelGuther/1b72554c7b46a37e5b7b0b506efe5380 to your computer and use it in GitHub Desktop.
how to break a loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run breaker@{ | |
collectionModified.forEach { itC -> | |
when { | |
!itC.checked && selectedCount >= 3 -> {maxSizeListener(); return@breaker} | |
else -> { | |
when { | |
itC.id == category.id -> { | |
itC.checked = itemView.switchCategorySelector.isChecked | |
when { | |
!itemView.switchCategorySelector.isChecked -> itC.subCategories?.map { it.checked = false } | |
else -> { | |
} | |
} | |
} | |
else -> { | |
} | |
} | |
clickListenerCategory(collectionModified.toList()) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment