Support Fragment in android-compiler-plugin

This commit is contained in:
Yan Zhulanow
2015-03-03 17:41:48 +03:00
parent d4184bd51d
commit da8369066b
68 changed files with 1160 additions and 25 deletions
@@ -0,0 +1,16 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
fun Fragment.a() {
val x = login
val y = this.login
}
// 2 GETSTATIC
// 4 INVOKEVIRTUAL
// 2 CHECKCAST
// 0 _\$_findCachedViewById
// 2 findViewById
// 2 getView
@@ -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>
@@ -0,0 +1,22 @@
package com.myapp
import android.app.Fragment
import android.os.Bundle
import java.io.File
import kotlinx.android.synthetic.layout.*
public class MyFragment : Fragment() {
}
fun Fragment.b() {
val x = login
val y = this.login
}
// 2 GETSTATIC
// 8 INVOKEVIRTUAL
// 3 CHECKCAST
// 1 _\$_findCachedViewById
// 3 findViewById
// 3 getView
@@ -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>
@@ -0,0 +1,21 @@
package com.myapp
import android.app.Activity
import android.os.Bundle
import java.io.File
import kotlinx.android.synthetic.layout.*
public class MyActivity : Activity() {
}
fun MyActivity.b() {
val x = login
val y = this.login
}
// 2 GETSTATIC
// 5 INVOKEVIRTUAL
// 3 CHECKCAST
// 3 _\$_findCachedViewById
// 1 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>
@@ -0,0 +1,16 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.MyButton
val button2 = MyButton
}
// 2 GETSTATIC
// 6 INVOKEVIRTUAL
// 3 CHECKCAST
// 3 _\$_findCachedViewById
// 1 findViewById
// 1 getView
@@ -0,0 +1,15 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<view
class="android.widget.Button"
android:id="@+id/MyButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,16 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.MyButton
val button2 = MyButton
}
// 2 GETSTATIC
// 6 INVOKEVIRTUAL
// 3 CHECKCAST
// 3 _\$_findCachedViewById
// 1 findViewById
// 1 getView
@@ -0,0 +1,14 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<android.widget.Button
android:id="@+id/MyButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,21 @@
package com.myapp
import android.app.Activity
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
import kotlinx.android.synthetic.layout1.*
class MyActivity: Activity() {
val button = this.login
}
class MyFragment: Fragment() {
val button1 = this.loginButton
}
// 2 GETSTATIC
// 9 INVOKEVIRTUAL
// 4 CHECKCAST
// 4 _\$_findCachedViewById
// 2 findViewById
// 1 getView
@@ -0,0 +1,29 @@
<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" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your password" />
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,29 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<TextView
android:id="@+id/passwordField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your password" />
<EditText
android:id="@+id/passwordCaption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -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>
@@ -0,0 +1,16 @@
package com.myapp
import android.app.Fragment
import java.io.File
import kotlinx.android.synthetic.layout.*
public class MyFragment : Fragment() {
{login}
}
// 1 GETSTATIC
// 5 INVOKEVIRTUAL
// 2 CHECKCAST
// 2 _\$_findCachedViewById
// 1 findViewById
// 1 getView