Do not cast findViewById to View

This commit is contained in:
Yan Zhulanow
2015-03-20 19:44:41 +03:00
parent 2061e390b4
commit c40598b3e9
3 changed files with 11 additions and 10 deletions
@@ -135,7 +135,8 @@ public abstract class AndroidUIXmlProcessor(protected val project: Project) {
}
private fun KotlinStringWriter.writeSyntheticProperty(receiver: String, widget: AndroidWidget, stubCall: String) {
val body = arrayListOf("return $stubCall as ${widget.className}")
val cast = if (widget.className == "View") ":" else "as"
val body = arrayListOf("return $stubCall $cast ${widget.className}")
val type = widget.className
writeImmutableExtensionProperty(receiver,
name = widget.id,