Skip to content

Instantly share code, notes, and snippets.

@EmmanuelGuther
Created November 6, 2018 10:59
Show Gist options
  • Save EmmanuelGuther/1b72554c7b46a37e5b7b0b506efe5380 to your computer and use it in GitHub Desktop.
Save EmmanuelGuther/1b72554c7b46a37e5b7b0b506efe5380 to your computer and use it in GitHub Desktop.
how to break a loop
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