Files
kotlin-fork/plugins/android-compiler-plugin/testData/codegen/android/view/0.kt
T
Pavel V. Talanov ed218c473a Get rid of 'class object' usages in code and builtins
Replace some comments and library usages as well
2015-03-25 18:28:00 +03:00

45 lines
963 B
Kotlin
Vendored

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 {
companion 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.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()
}