mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 00:21:32 +00:00
35 lines
667 B
Kotlin
Vendored
35 lines
667 B
Kotlin
Vendored
package test
|
|
|
|
import android.app.Activity
|
|
import android.view.View
|
|
import android.widget.*
|
|
import org.my.cool.MyButton
|
|
import kotlinx.android.synthetic.main.layout.*
|
|
|
|
class R {
|
|
class id {
|
|
companion object {
|
|
const val login = 5
|
|
}
|
|
}
|
|
}
|
|
|
|
class MyActivity(): Activity() {
|
|
val buttonWidget = MyButton(this)
|
|
|
|
override fun <T : View> findViewById(id: Int): T? {
|
|
return when (id) {
|
|
R.id.login -> buttonWidget as T
|
|
else -> null
|
|
}
|
|
}
|
|
|
|
public fun box(): String {
|
|
return if (login.toString() == "MyButton") "OK" else ""
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
return MyActivity().box()
|
|
}
|