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
|
||||
|
||||
|
||||
+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
|
||||
|
||||
|
||||
+9
-8
@@ -4,28 +4,29 @@ import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlin.internal.flexible.ft
|
||||
|
||||
val Activity.item_detail_container: FrameLayout
|
||||
val Activity.item_detail_container: ft<FrameLayout, FrameLayout?>
|
||||
get() = findViewById(0) as FrameLayout
|
||||
|
||||
val Fragment.item_detail_container: FrameLayout
|
||||
val Fragment.item_detail_container: ft<FrameLayout, FrameLayout?>
|
||||
get() = getView().findViewById(0) as FrameLayout
|
||||
|
||||
val Activity.textView1: TextView
|
||||
val Activity.textView1: ft<TextView, TextView?>
|
||||
get() = findViewById(0) as TextView
|
||||
|
||||
val Fragment.textView1: TextView
|
||||
val Fragment.textView1: ft<TextView, TextView?>
|
||||
get() = getView().findViewById(0) as TextView
|
||||
|
||||
val Activity.password: EditText
|
||||
val Activity.password: ft<EditText, EditText?>
|
||||
get() = findViewById(0) as EditText
|
||||
|
||||
val Fragment.password: EditText
|
||||
val Fragment.password: ft<EditText, EditText?>
|
||||
get() = getView().findViewById(0) as EditText
|
||||
|
||||
val Activity.login: Button
|
||||
val Activity.login: ft<Button, Button?>
|
||||
get() = findViewById(0) as Button
|
||||
|
||||
val Fragment.login: Button
|
||||
val Fragment.login: ft<Button, Button?>
|
||||
get() = getView().findViewById(0) as Button
|
||||
|
||||
|
||||
+5
-4
@@ -4,16 +4,17 @@ import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlin.internal.flexible.ft
|
||||
|
||||
val View.item_detail_container: FrameLayout
|
||||
val View.item_detail_container: ft<FrameLayout, FrameLayout?>
|
||||
get() = findViewById(0) as FrameLayout
|
||||
|
||||
val View.textView1: TextView
|
||||
val View.textView1: ft<TextView, TextView?>
|
||||
get() = findViewById(0) as TextView
|
||||
|
||||
val View.password: EditText
|
||||
val View.password: ft<EditText, EditText?>
|
||||
get() = findViewById(0) as EditText
|
||||
|
||||
val View.login: Button
|
||||
val View.login: ft<Button, Button?>
|
||||
get() = findViewById(0) as Button
|
||||
|
||||
|
||||
+9
-8
@@ -4,28 +4,29 @@ import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlin.internal.flexible.ft
|
||||
|
||||
val Activity.frameLayout: FrameLayout
|
||||
val Activity.frameLayout: ft<FrameLayout, FrameLayout?>
|
||||
get() = findViewById(0) as FrameLayout
|
||||
|
||||
val Fragment.frameLayout: FrameLayout
|
||||
val Fragment.frameLayout: ft<FrameLayout, FrameLayout?>
|
||||
get() = getView().findViewById(0) as FrameLayout
|
||||
|
||||
val Activity.passwordField: TextView
|
||||
val Activity.passwordField: ft<TextView, TextView?>
|
||||
get() = findViewById(0) as TextView
|
||||
|
||||
val Fragment.passwordField: TextView
|
||||
val Fragment.passwordField: ft<TextView, TextView?>
|
||||
get() = getView().findViewById(0) as TextView
|
||||
|
||||
val Activity.passwordCaption: EditText
|
||||
val Activity.passwordCaption: ft<EditText, EditText?>
|
||||
get() = findViewById(0) as EditText
|
||||
|
||||
val Fragment.passwordCaption: EditText
|
||||
val Fragment.passwordCaption: ft<EditText, EditText?>
|
||||
get() = getView().findViewById(0) as EditText
|
||||
|
||||
val Activity.loginButton: Button
|
||||
val Activity.loginButton: ft<Button, Button?>
|
||||
get() = findViewById(0) as Button
|
||||
|
||||
val Fragment.loginButton: Button
|
||||
val Fragment.loginButton: ft<Button, Button?>
|
||||
get() = getView().findViewById(0) as Button
|
||||
|
||||
|
||||
+5
-4
@@ -4,16 +4,17 @@ import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlin.internal.flexible.ft
|
||||
|
||||
val View.frameLayout: FrameLayout
|
||||
val View.frameLayout: ft<FrameLayout, FrameLayout?>
|
||||
get() = findViewById(0) as FrameLayout
|
||||
|
||||
val View.passwordField: TextView
|
||||
val View.passwordField: ft<TextView, TextView?>
|
||||
get() = findViewById(0) as TextView
|
||||
|
||||
val View.passwordCaption: EditText
|
||||
val View.passwordCaption: ft<EditText, EditText?>
|
||||
get() = findViewById(0) as EditText
|
||||
|
||||
val View.loginButton: Button
|
||||
val View.loginButton: ft<Button, Button?>
|
||||
get() = findViewById(0) as Button
|
||||
|
||||
|
||||
+9
-8
@@ -4,28 +4,29 @@ import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlin.internal.flexible.ft
|
||||
|
||||
val Activity.item_detail_container: FrameLayout
|
||||
val Activity.item_detail_container: ft<FrameLayout, FrameLayout?>
|
||||
get() = findViewById(0) as FrameLayout
|
||||
|
||||
val Fragment.item_detail_container: FrameLayout
|
||||
val Fragment.item_detail_container: ft<FrameLayout, FrameLayout?>
|
||||
get() = getView().findViewById(0) as FrameLayout
|
||||
|
||||
val Activity.textView1: TextView
|
||||
val Activity.textView1: ft<TextView, TextView?>
|
||||
get() = findViewById(0) as TextView
|
||||
|
||||
val Fragment.textView1: TextView
|
||||
val Fragment.textView1: ft<TextView, TextView?>
|
||||
get() = getView().findViewById(0) as TextView
|
||||
|
||||
val Activity.password: EditText
|
||||
val Activity.password: ft<EditText, EditText?>
|
||||
get() = findViewById(0) as EditText
|
||||
|
||||
val Fragment.password: EditText
|
||||
val Fragment.password: ft<EditText, EditText?>
|
||||
get() = getView().findViewById(0) as EditText
|
||||
|
||||
val Activity.login: Button
|
||||
val Activity.login: ft<Button, Button?>
|
||||
get() = findViewById(0) as Button
|
||||
|
||||
val Fragment.login: Button
|
||||
val Fragment.login: ft<Button, Button?>
|
||||
get() = getView().findViewById(0) as Button
|
||||
|
||||
|
||||
+5
-4
@@ -4,16 +4,17 @@ import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlin.internal.flexible.ft
|
||||
|
||||
val View.item_detail_container: FrameLayout
|
||||
val View.item_detail_container: ft<FrameLayout, FrameLayout?>
|
||||
get() = findViewById(0) as FrameLayout
|
||||
|
||||
val View.textView1: TextView
|
||||
val View.textView1: ft<TextView, TextView?>
|
||||
get() = findViewById(0) as TextView
|
||||
|
||||
val View.password: EditText
|
||||
val View.password: ft<EditText, EditText?>
|
||||
get() = findViewById(0) as EditText
|
||||
|
||||
val View.login: Button
|
||||
val View.login: ft<Button, Button?>
|
||||
get() = findViewById(0) as Button
|
||||
|
||||
|
||||
Reference in New Issue
Block a user