Refactoring: rename android-compiler-plugin to android-extensions-compiler
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
import kotlinx.android.synthetic.main.layout.view.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val container = 0
|
||||
const 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.login -> loginWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.container -> containerWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
public fun box(): String{
|
||||
return if (container.login.toString() == "Button") "OK" else ""
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return MyActivity().box()
|
||||
}
|
||||
Reference in New Issue
Block a user