pawel.barszcz
01/25/2017, 9:12 PMit
?). Then it would look like (assuming that it
is of type Something
):
val animName = readAttribute(it, "name")
?: readAttribute(it, "id")
?: "animation_${mAnimationClipLibrary.size}”
where for example:
fun readAttribute(something: Something, attributeName: String): String? =
when (something.hasAttribute(attributeName)) {
true -> something.getAttribute(attributeName)
false -> null
}