Call findViewById if invoked on anything but our Activity class

This commit is contained in:
Yan Zhulanow
2015-02-06 16:32:05 +03:00
parent 8ebd63ee96
commit db45ab4ad6
14 changed files with 210 additions and 56 deletions
@@ -0,0 +1,15 @@
package com.myapp
import android.app.Activity
import kotlinx.android.synthetic.layout.*
fun Activity.a() {
val x = login
val y = this.login
}
// 2 GETSTATIC
// 2 INVOKEVIRTUAL
// 2 CHECKCAST
// 0 _\$_findCachedViewById
// 2 findViewById
@@ -0,0 +1,17 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>