auto cast widget to its original type

- change property return type signatures from View to actual widget type
- simplify and update tests
This commit is contained in:
Mikhail Mutcianko
2014-07-14 15:39:43 +04:00
committed by Yan Zhulanow
parent 31dc8194f1
commit aa01d6d7cf
8 changed files with 67 additions and 67 deletions
@@ -1,21 +1,16 @@
import android.app.Activity
import android.view.View
import android.widget.*
val Activity.item_detail_container: View
get() = findViewById(R.id.item_detail_container)!!
val Activity.item_detail_container: FrameLayout
get() = findViewById(R.id.item_detail_container) as FrameLayout
val Activity.textView1: View
get() = findViewById(R.id.textView1)!!
val Activity.textView1: TextView
get() = findViewById(R.id.textView1) as TextView
val Activity.password: View
get() = findViewById(R.id.password)!!
val Activity.password: EditText
get() = findViewById(R.id.password) as EditText
val Activity.textView2: View
get() = findViewById(R.id.textView2)!!
val Activity.passwordConfirmation: View
get() = findViewById(R.id.passwordConfirmation)!!
val Activity.login: View
get() = findViewById(R.id.login)!!
val Activity.login: Button
get() = findViewById(R.id.login) as Button
@@ -18,22 +18,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" >
<requestFocus />
</EditText>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Repeat your password" />
<EditText
android:id="@+id/passwordConfirmation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
@@ -0,0 +1,6 @@
package android.widget
class EditText
class TextView
class Button
class FrameLayout