Android Extensions: Use Activity and Fragment supertypes in INVOKE_VIRTUAL calls instead of the user implementation class names

This commit is contained in:
Yan Zhulanow
2017-06-05 19:11:33 +03:00
parent d4b4bc71ee
commit a69f9729e0
12 changed files with 14 additions and 15 deletions
@@ -246,10 +246,10 @@ class AndroidExpressionCodegenExtension : ExpressionCodegenExtension {
when (containerOptions.classType) {
AndroidContainerType.ACTIVITY, AndroidContainerType.SUPPORT_FRAGMENT_ACTIVITY, AndroidContainerType.VIEW, AndroidContainerType.DIALOG -> {
loadId()
iv.invokevirtual(className, "findViewById", "(I)Landroid/view/View;", false)
iv.invokevirtual(containerOptions.classType.internalClassName, "findViewById", "(I)Landroid/view/View;", false)
}
AndroidContainerType.FRAGMENT, AndroidContainerType.SUPPORT_FRAGMENT -> {
iv.invokevirtual(className, "getView", "()Landroid/view/View;", false)
iv.invokevirtual(containerOptions.classType.internalClassName, "getView", "()Landroid/view/View;", false)
iv.dup()
val lgetViewNotNull = Label()
iv.ifnonnull(lgetViewNotNull)