Android synthetic properties are now properties with flexible type
This commit is contained in:
+3
-2
@@ -4,10 +4,11 @@ import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlin.internal.flexible.ft
|
||||
|
||||
val Activity.MyButton: org.my.cool.Button
|
||||
val Activity.MyButton: ft<org.my.cool.Button, org.my.cool.Button?>
|
||||
get() = findViewById(0) as org.my.cool.Button
|
||||
|
||||
val Fragment.MyButton: org.my.cool.Button
|
||||
val Fragment.MyButton: ft<org.my.cool.Button, org.my.cool.Button?>
|
||||
get() = getView().findViewById(0) as org.my.cool.Button
|
||||
|
||||
|
||||
+2
-1
@@ -4,7 +4,8 @@ import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlin.internal.flexible.ft
|
||||
|
||||
val View.MyButton: org.my.cool.Button
|
||||
val View.MyButton: ft<org.my.cool.Button, org.my.cool.Button?>
|
||||
get() = findViewById(0) as org.my.cool.Button
|
||||
|
||||
|
||||
Reference in New Issue
Block a user