Support View in android-compiler-plugin

This commit is contained in:
Yan Zhulanow
2015-03-04 21:19:28 +03:00
parent 33a1aa342f
commit 4cc5e9248a
41 changed files with 637 additions and 60 deletions
@@ -0,0 +1,34 @@
package com.myapp
import android.app.Activity
import android.view.View
import android.widget.*
import kotlinx.android.synthetic.layout.*
import kotlinx.android.synthetic.layout.view.*
class R {
class id {
class object {
val container = 0
val login = 1
}
}
}
class MyActivity(): Activity() {
val containerWidget = object : FrameLayout(this) {
val loginWidget = Button(this@MyActivity)
}
override fun findViewById(id: Int): View? {
return when (id) {
R.id.container -> containerWidget
else -> null
}
}
}
fun box(): String {
return "OK"
}