miha-x64
04/24/2017, 10:49 AMcontrols.mapValues {
val ans = EnumSet.noneOf(NotificationTarget::class.java)
if (it.value.pushSwitch.isChecked) ans += NotificationTarget.PUSH
if (it.value.emailSwitch.isChecked) ans += NotificationTarget.EMAIL
ans
}
okkero
04/24/2017, 11:54 AMcontrols.mapValues {
EnumSet.copyOf(
listOf(
it.value.pushSwitch to NotificationTarget.PUSH,
it.value.emailSwitch to NotificationTarget.EMAIL
)
.filter { it.first.isChecked }
.map { it.second }
)
}
miha-x64
04/24/2017, 12:21 PMokkero
04/24/2017, 12:42 PMmiha-x64
04/24/2017, 12:44 PM