"Fossies" - the Fresh Open Source Software Archive

Member "kotlin-1.3.61/plugins/android-extensions/android-extensions-compiler/testData/codegen/android/fqNameInAttr/0.kt" (26 Nov 2019, 667 Bytes) of package /linux/misc/kotlin-1.3.61.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Kotlin source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 package test
    2 
    3 import android.app.Activity
    4 import android.view.View
    5 import android.widget.*
    6 import org.my.cool.MyButton
    7 import kotlinx.android.synthetic.main.layout.*
    8 
    9 class R {
   10     class id {
   11         companion object {
   12             const val login = 5
   13         }
   14     }
   15 }
   16 
   17 class MyActivity(): Activity() {
   18     val buttonWidget = MyButton(this)
   19 
   20     override fun <T : View> findViewById(id: Int): T? {
   21         return when (id) {
   22             R.id.login -> buttonWidget as T
   23             else -> null
   24         }
   25     }
   26 
   27     public fun box(): String {
   28         return if (login.toString() == "MyButton") "OK" else ""
   29     }
   30 }
   31 
   32 fun box(): String {
   33     return MyActivity().box()
   34 }