Refactoring: rename android-compiler-plugin to android-extensions-compiler
This commit is contained in:
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package android.app
|
||||
|
||||
import android.view.View
|
||||
import android.content.Context
|
||||
|
||||
open class Activity: Context {
|
||||
open fun findViewById(id: Int): View? = null
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
package android.appwidget
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
package android.content
|
||||
|
||||
interface Context
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
package android.app
|
||||
|
||||
import android.view.View
|
||||
import android.app.Activity
|
||||
|
||||
abstract class Fragment {
|
||||
open fun getActivity(): Activity = throw Exception("Function getActivity() is not overridden")
|
||||
open fun getView(): View = throw Exception("Function getView() is not overridden")
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
package android.inputmethodservice
|
||||
plugins/android-extensions/android-extensions-compiler/testData/codegen/android/FakeOpenglPackage.kt
Vendored
+1
@@ -0,0 +1 @@
|
||||
package android.opengl
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package android.support.v4.app
|
||||
|
||||
import android.view.View
|
||||
import android.app.Activity
|
||||
|
||||
abstract class Fragment {
|
||||
open fun getActivity(): Activity = throw Exception("Function getActivity() is not overridden")
|
||||
open fun getView(): View = throw Exception("Function getView() is not overridden")
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package android.view
|
||||
|
||||
import android.content.Context
|
||||
|
||||
open class View(ctx: Context) {
|
||||
open fun findViewById(id: Int): View? = null
|
||||
}
|
||||
plugins/android-extensions/android-extensions-compiler/testData/codegen/android/FakeWebkitPackage.kt
Vendored
+1
@@ -0,0 +1 @@
|
||||
package android.webkit
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
package android.widget
|
||||
|
||||
import android.view.View
|
||||
import android.content.Context
|
||||
|
||||
open class Button(ctx: Context): View(ctx) {override fun toString() = "Button"}
|
||||
open class EditText(ctx: Context): View(ctx) {override fun toString() = "EditText"}
|
||||
open class TextView(ctx: Context): View(ctx) {override fun toString() = "TextView"}
|
||||
open class FrameLayout(ctx: Context): View(ctx) {override fun toString() = "FrameLayout"}
|
||||
open class RelativeLayout(ctx: Context): View(ctx) {override fun toString() = "RelativeLayout"}
|
||||
open class ImageView(ctx: Context): View(ctx) {override fun toString() = "ImageView"}
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import org.my.cool.MyButton
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val login = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyActivity(): Activity() {
|
||||
val buttonWidget = MyButton(this)
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.login -> buttonWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
public fun box(): String {
|
||||
return if (login.toString() == "MyButton") "OK" else ""
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return MyActivity().box()
|
||||
}
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import org.my.cool.MyButton
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val login = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyActivity(): Activity() {
|
||||
val buttonWidget = MyButton(this)
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.login -> buttonWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="test"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-sdk
|
||||
android:minSdkVersion="18"
|
||||
android:targetSdkVersion="18" />
|
||||
<permission android:name="android"></permission>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.Sample" >
|
||||
<activity
|
||||
android:name="com.example.android.basiccontactables.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop">
|
||||
<meta-data
|
||||
android:name="android.app.searchable"
|
||||
android:resource="@xml/searchable" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEARCH" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package org.my.cool
|
||||
|
||||
import android.widget.Button
|
||||
import android.app.Activity
|
||||
|
||||
class MyButton(ctx: Activity): Button(ctx) {
|
||||
override fun toString(): String {return "MyButton"}
|
||||
}
|
||||
+15
@@ -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="org.my.cool.MyButton"
|
||||
android:id="@+id/login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Sign in" />
|
||||
|
||||
</FrameLayout>
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import org.my.cool.MyButton
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val login = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyActivity(): Activity() {
|
||||
val buttonWidget = MyButton(this)
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.login -> buttonWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
public fun box(): String {
|
||||
return if (login.toString() == "MyButton") "OK" else ""
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return MyActivity().box()
|
||||
}
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import org.my.cool.MyButton
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val login = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyActivity(): Activity() {
|
||||
val buttonWidget = MyButton(this)
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.login -> buttonWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="test"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-sdk
|
||||
android:minSdkVersion="18"
|
||||
android:targetSdkVersion="18" />
|
||||
<permission android:name="android"></permission>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.Sample" >
|
||||
<activity
|
||||
android:name="com.example.android.basiccontactables.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop">
|
||||
<meta-data
|
||||
android:name="android.app.searchable"
|
||||
android:resource="@xml/searchable" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEARCH" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package org.my.cool
|
||||
|
||||
import android.widget.Button
|
||||
import android.content.Context
|
||||
|
||||
class MyButton(ctx: Context): Button(ctx) {
|
||||
override fun toString(): String {return "MyButton"}
|
||||
}
|
||||
+14
@@ -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" >
|
||||
|
||||
<org.my.cool.MyButton
|
||||
android:id="@+id/login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Sign in" />
|
||||
|
||||
</FrameLayout>
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import org.my.cool.MyButton
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val login = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class BaseView(ctx: Context) : View(ctx) {
|
||||
val buttonWidget = MyButton(ctx)
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.login -> buttonWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyFragment(): Fragment() {
|
||||
val baseActivity = Activity()
|
||||
val baseView = BaseView(baseActivity)
|
||||
|
||||
override fun getActivity(): Activity = baseActivity
|
||||
|
||||
override fun getView(): View = baseView
|
||||
|
||||
public fun box(): String {
|
||||
return if (login.toString() == "MyButton") "OK" else ""
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return MyFragment().box()
|
||||
}
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import org.my.cool.MyButton
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val login = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class BaseView(ctx: Context) : View(ctx) {
|
||||
val buttonWidget = MyButton(ctx)
|
||||
}
|
||||
|
||||
class MyFragment(): Fragment() {
|
||||
val baseActivity = Activity()
|
||||
val baseView = BaseView(baseActivity)
|
||||
|
||||
override fun getView(): View = baseView
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="test"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-sdk
|
||||
android:minSdkVersion="18"
|
||||
android:targetSdkVersion="18" />
|
||||
<permission android:name="android"></permission>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.Sample" >
|
||||
<activity
|
||||
android:name="com.example.android.basiccontactables.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop">
|
||||
<meta-data
|
||||
android:name="android.app.searchable"
|
||||
android:resource="@xml/searchable" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEARCH" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package org.my.cool
|
||||
|
||||
import android.widget.Button
|
||||
import android.content.Context
|
||||
|
||||
class MyButton(ctx: Context): Button(ctx) {
|
||||
override fun toString(): String {return "MyButton"}
|
||||
}
|
||||
+15
@@ -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="org.my.cool.MyButton"
|
||||
android:id="@+id/login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Sign in" />
|
||||
|
||||
</FrameLayout>
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
fun box() = "OK"
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="test"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-sdk
|
||||
android:minSdkVersion="18"
|
||||
android:targetSdkVersion="18" />
|
||||
<permission android:name="android"></permission>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.Sample" >
|
||||
<activity
|
||||
android:name="com.example.android.basiccontactables.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop">
|
||||
<meta-data
|
||||
android:name="android.app.searchable"
|
||||
android:resource="@xml/searchable" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEARCH" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||
android:padding="6dip">
|
||||
<ImageView
|
||||
android:id="@+id/req_who_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="6dip"
|
||||
android:gravity="left"
|
||||
android:src="@drawable/icon" />
|
||||
<TextView
|
||||
android:id="@+id/req_state_who"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/req_who_icon"
|
||||
android:textSize="10dip"
|
||||
android:layout_alignParentRight="false"
|
||||
android:layout_alignParentTop="false"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:gravity="left"
|
||||
android:text="who" />
|
||||
<TextView
|
||||
android:id="@+id/req_header"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/req_state_who"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:gravity="right"
|
||||
android:text="No summary"
|
||||
android:textSize="10dip"
|
||||
android:textColor="#FFFF00" />
|
||||
<TextView
|
||||
android:id="@+id/req_summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/req_header"
|
||||
android:layout_toRightOf="@id/req_state_who"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:gravity="right"
|
||||
android:textSize="10dip"
|
||||
android:text="No summary" />
|
||||
<TextView
|
||||
android:id="@+id/req_description"
|
||||
android:layout_below="@id/req_summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/req_state_who"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:gravity="right"
|
||||
android:ellipsize="marquee"
|
||||
android:text="No description"
|
||||
android:textSize="10dip" />
|
||||
<ImageView
|
||||
android:id="@+id/req_state_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/req_description"
|
||||
android:layout_marginRight="6dip"/>
|
||||
</RelativeLayout>
|
||||
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
import kotlinx.android.synthetic.main.layout1.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val item_detail_container = 0
|
||||
const val textView1 = 1
|
||||
const val password = 2
|
||||
const val textView2 = 3
|
||||
const val passwordConfirmation = 4
|
||||
const val login = 5
|
||||
const val passwordField = 6
|
||||
const val passwordCaption = 7
|
||||
const val loginButton = 8
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyActivity(): Activity() {
|
||||
val textViewWidget = TextView(this)
|
||||
val editTextWidget = EditText(this)
|
||||
val buttonWidget = Button(this)
|
||||
val textViewWidget2 = TextView(this)
|
||||
val editTextWidget2 = EditText(this)
|
||||
val buttonWidget2 = Button(this)
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.textView1 -> textViewWidget
|
||||
R.id.password -> editTextWidget
|
||||
R.id.login -> buttonWidget
|
||||
R.id.passwordField -> textViewWidget2
|
||||
R.id.passwordCaption -> editTextWidget2
|
||||
R.id.loginButton -> buttonWidget2
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public fun box(): String{
|
||||
return if (textView1.toString() == "TextView" &&
|
||||
password.toString() == "EditText" &&
|
||||
login.toString() == "Button" &&
|
||||
passwordField.toString() == "TextView" &&
|
||||
passwordCaption.toString() == "EditText" &&
|
||||
loginButton.toString() == "Button")
|
||||
"OK" else ""
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return MyActivity().box()
|
||||
}
|
||||
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
import kotlinx.android.synthetic.main.layout1.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val item_detail_container = 0
|
||||
const val textView1 = 1
|
||||
const val password = 2
|
||||
const val textView2 = 3
|
||||
const val passwordConfirmation = 4
|
||||
const val login = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyActivity(): Activity() {
|
||||
val textViewWidget = TextView(this)
|
||||
val editTextWidget = EditText(this)
|
||||
val buttonWidget = Button(this)
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.textView1 -> textViewWidget
|
||||
R.id.password -> editTextWidget
|
||||
R.id.login -> buttonWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="test"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-sdk
|
||||
android:minSdkVersion="18"
|
||||
android:targetSdkVersion="18" />
|
||||
<permission android:name="android"></permission>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.Sample" >
|
||||
<activity
|
||||
android:name="com.example.android.basiccontactables.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop">
|
||||
<meta-data
|
||||
android:name="android.app.searchable"
|
||||
android:resource="@xml/searchable" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEARCH" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
+29
@@ -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>
|
||||
+29
@@ -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>
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val item_detail_container = 0
|
||||
const val textView1 = 1
|
||||
const val password = 2
|
||||
const val textView2 = 3
|
||||
const val passwordConfirmation = 4
|
||||
const val login = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyActivity(): Activity() {
|
||||
val textViewWidget = TextView(this)
|
||||
val editTextWidget = EditText(this)
|
||||
val buttonWidget = Button(this)
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.textView1 -> textViewWidget
|
||||
R.id.password -> editTextWidget
|
||||
R.id.login -> buttonWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
public fun box(): String{
|
||||
return if (textView1.toString() == "TextView" &&
|
||||
password.toString() == "EditText" &&
|
||||
login.toString() == "Button")
|
||||
"OK" else ""
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return MyActivity().box()
|
||||
}
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val item_detail_container = 0
|
||||
const val textView1 = 1
|
||||
const val password = 2
|
||||
const val textView2 = 3
|
||||
const val passwordConfirmation = 4
|
||||
const val login = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyActivity(): Activity() {
|
||||
val textViewWidget = TextView(this)
|
||||
val editTextWidget = EditText(this)
|
||||
val buttonWidget = Button(this)
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.textView1 -> textViewWidget
|
||||
R.id.password -> editTextWidget
|
||||
R.id.login -> buttonWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="test"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-sdk
|
||||
android:minSdkVersion="18"
|
||||
android:targetSdkVersion="18" />
|
||||
<permission android:name="android"></permission>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.Sample" >
|
||||
<activity
|
||||
android:name="com.example.android.basiccontactables.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop">
|
||||
<meta-data
|
||||
android:name="android.app.searchable"
|
||||
android:resource="@xml/searchable" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEARCH" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
+29
@@ -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>
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
import kotlinx.android.synthetic.main.layout.view.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val container = 0
|
||||
const val login = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyActivity(): Activity() {
|
||||
val containerWidget = object : FrameLayout(this) {
|
||||
val loginWidget = Button(this@MyActivity)
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.login -> loginWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.container -> containerWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
public fun box(): String{
|
||||
return if (container.login.toString() == "Button") "OK" else ""
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return MyActivity().box()
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
import kotlinx.android.synthetic.main.layout.view.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
companion object {
|
||||
const val container = 0
|
||||
const val login = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyActivity(): Activity() {
|
||||
val containerWidget = object : FrameLayout(this) {
|
||||
val loginWidget = Button(this@MyActivity)
|
||||
}
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.container -> containerWidget
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="test"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0" >
|
||||
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||
<uses-sdk
|
||||
android:minSdkVersion="18"
|
||||
android:targetSdkVersion="18" />
|
||||
<permission android:name="android"></permission>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.Sample" >
|
||||
<activity
|
||||
android:name="com.example.android.basiccontactables.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop">
|
||||
<meta-data
|
||||
android:name="android.app.searchable"
|
||||
android:resource="@xml/searchable" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEARCH" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<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" >
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:id="@+id/login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Sign in" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</FrameLayout>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
fun Activity.a() {
|
||||
val x = login
|
||||
val y = this.login
|
||||
}
|
||||
|
||||
// 2 GETSTATIC test/R\$id\.login
|
||||
// 2 INVOKEVIRTUAL android/app/Activity\.findViewById
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
// 0 _\$_findCachedViewById
|
||||
+17
@@ -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>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
import android.app.Fragment
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
fun Fragment.a() {
|
||||
val x = login
|
||||
val y = this.login
|
||||
}
|
||||
|
||||
// 2 GETSTATIC test/R\$id\.login
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
// 2 INVOKEVIRTUAL android/app/Fragment\.getView
|
||||
// 2 INVOKEVIRTUAL android/view/View\.findViewById
|
||||
// 0 _\$_findCachedViewById
|
||||
+17
@@ -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>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Bundle
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.*
|
||||
|
||||
public class MyActivity : Activity() {
|
||||
init { clearFindViewByIdCache() }
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 1 INVOKEVIRTUAL test/MyActivity\._\$_clearFindViewByIdCache
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Bundle
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.*
|
||||
|
||||
public fun Activity.a() {
|
||||
clearFindViewByIdCache()
|
||||
}
|
||||
|
||||
// 0 clearFindViewByIdCache
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Bundle
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
public class MyActivity : Activity() {
|
||||
|
||||
}
|
||||
|
||||
fun MyActivity.b() {
|
||||
val x = login
|
||||
val y = this.login
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 2 GETSTATIC test/R\$id\.login
|
||||
// 2 INVOKEVIRTUAL test/MyActivity\._\$_findCachedViewById
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
+17
@@ -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>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package test
|
||||
|
||||
import android.app.Fragment
|
||||
import android.os.Bundle
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
public class MyFragment : Fragment()
|
||||
|
||||
fun MyFragment.b() {
|
||||
val x = login
|
||||
val y = this.login
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 1 INVOKEVIRTUAL test/MyFragment\.getView
|
||||
// 2 GETSTATIC test/R\$id\.login
|
||||
// 2 INVOKEVIRTUAL test/MyFragment\._\$_findCachedViewById
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
+17
@@ -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>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
import android.view.View
|
||||
import kotlinx.android.synthetic.main.layout.view.*
|
||||
|
||||
fun View.a() {
|
||||
val x = login
|
||||
val y = this.login
|
||||
}
|
||||
|
||||
// 2 GETSTATIC test/R\$id\.login
|
||||
// 2 INVOKEVIRTUAL android/view/View\.findViewById
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
// 0 _\$_findCachedViewById
|
||||
+17
@@ -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>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class MyActivity: Activity() {
|
||||
val button = this.MyButton
|
||||
val button2 = MyButton
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 2 GETSTATIC test/R\$id\.MyButton
|
||||
// 2 INVOKEVIRTUAL test/MyActivity\._\$_findCachedViewById
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
+15
@@ -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>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
import android.app.Fragment
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class MyFragment: Fragment() {
|
||||
val button = this.MyButton
|
||||
val button2 = MyButton
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 1 INVOKEVIRTUAL test/MyFragment\.getView
|
||||
// 2 GETSTATIC test/R\$id\.MyButton
|
||||
// 2 INVOKEVIRTUAL test/MyFragment\._\$_findCachedViewById
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
+15
@@ -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>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class MyActivity: Activity() {
|
||||
val button = this.MyButton
|
||||
val button2 = MyButton
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 2 GETSTATIC test/R\$id\.MyButton
|
||||
// 2 INVOKEVIRTUAL test/MyActivity\._\$_findCachedViewById
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
+14
@@ -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>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
import android.app.Fragment
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
class MyFragment: Fragment() {
|
||||
val button = this.MyButton
|
||||
val button2 = MyButton
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 1 INVOKEVIRTUAL test/MyFragment\.getView
|
||||
// 2 GETSTATIC test/R\$id\.MyButton
|
||||
// 2 INVOKEVIRTUAL test/MyFragment\._\$_findCachedViewById
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
+14
@@ -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>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
import kotlinx.android.synthetic.main.layout1.*
|
||||
|
||||
class MyActivity: Activity() {
|
||||
val button = this.login
|
||||
val button1 = this.loginButton
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 1 GETSTATIC test/R\$id\.login : I
|
||||
// 1 GETSTATIC test/R\$id\.loginButton : I
|
||||
// 2 INVOKEVIRTUAL test/MyActivity\._\$_findCachedViewById
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
+29
@@ -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>
|
||||
+29
@@ -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>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
import kotlinx.android.synthetic.main.layout1.*
|
||||
|
||||
class MyActivity: Activity() {
|
||||
val button = this.login
|
||||
}
|
||||
|
||||
class MyFragment: Fragment() {
|
||||
val button1 = this.loginButton
|
||||
}
|
||||
|
||||
// 2 public _\$_findCachedViewById
|
||||
// 2 public _\$_clearFindViewByIdCache
|
||||
// 1 INVOKEVIRTUAL test/MyFragment\.getView
|
||||
// 1 GETSTATIC test/R\$id\.login : I
|
||||
// 1 GETSTATIC test/R\$id\.loginButton : I
|
||||
// 1 INVOKEVIRTUAL test/MyActivity\._\$_findCachedViewById
|
||||
// 1 INVOKEVIRTUAL test/MyFragment\._\$_findCachedViewById
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
+29
@@ -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>
|
||||
+29
@@ -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>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package test
|
||||
|
||||
import android.app.Fragment
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
public class MyFragment : Fragment() {
|
||||
init {login}
|
||||
}
|
||||
|
||||
public class MyFragment2 : Fragment() {
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
public open fun onDestroy(n: Int) {}
|
||||
|
||||
}
|
||||
|
||||
// 2 public onDestroyView\(\)V
|
||||
// 1 INVOKEVIRTUAL test/MyFragment\._\$_clearFindViewByIdCache
|
||||
// 1 INVOKEVIRTUAL test/MyFragment2\._\$_clearFindViewByIdCache
|
||||
+17
@@ -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>
|
||||
+17
@@ -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>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Bundle
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
public class MyActivity : Activity() {
|
||||
init {login}
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 1 GETSTATIC test/R\$id\.login
|
||||
// 1 INVOKEVIRTUAL test/MyActivity\._\$_findCachedViewById
|
||||
// 1 CHECKCAST android/widget/Button
|
||||
+17
@@ -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>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
import android.app.Fragment
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
public class MyFragment : Fragment() {
|
||||
init {login}
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 1 INVOKEVIRTUAL test/MyFragment\.getView
|
||||
// 1 GETSTATIC test/R\$id\.login
|
||||
// 1 INVOKEVIRTUAL test/MyFragment\._\$_findCachedViewById
|
||||
// 1 CHECKCAST android/widget/Button
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<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" >
|
||||
|
||||
|
||||
|
||||
<fragment
|
||||
android:id="@+id/fragm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</FrameLayout>
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.os.Bundle
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
public class MyActivity : Activity() {
|
||||
init { fragm }
|
||||
}
|
||||
|
||||
public class MyFragment : Fragment() {
|
||||
init { fragm }
|
||||
}
|
||||
|
||||
// 1 INVOKEVIRTUAL android/app/Activity\.getFragmentManager
|
||||
// 1 INVOKEVIRTUAL android/app/Fragment\.getFragmentManager
|
||||
// 2 GETSTATIC test/R\$id\.fragm
|
||||
// 2 INVOKEVIRTUAL android/app/FragmentManager\.findFragmentById
|
||||
// 2 CHECKCAST android/app/Fragment
|
||||
+17
@@ -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>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package test
|
||||
|
||||
import android.view.View
|
||||
import android.app.Activity
|
||||
import kotlinx.android.synthetic.main.layout.view.*
|
||||
|
||||
public class MyActivity : Activity() {
|
||||
init { View(this).login }
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 INVOKEVIRTUAL test/MyActivity\.findViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 1 GETSTATIC test/R\$id\.login
|
||||
// 1 INVOKEVIRTUAL android/view/View\.findViewById
|
||||
// 0 INVOKEVIRTUAL test/MyActivity\._\$_findCachedViewById
|
||||
// 1 CHECKCAST android/widget/Button
|
||||
+17
@@ -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>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package android.support.v4.app
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.os.Bundle
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
open class Fragment {
|
||||
open fun getActivity(): Activity = throw Exception("Function getActivity() is not overridden")
|
||||
open fun getView(): View = throw Exception("Function getView() is not overridden")
|
||||
}
|
||||
|
||||
public class MyFragment : Fragment()
|
||||
|
||||
fun MyFragment.b() {
|
||||
val x = login
|
||||
val y = this.login
|
||||
}
|
||||
|
||||
// 2 public _\$_findCachedViewById
|
||||
// 2 public _\$_clearFindViewByIdCache
|
||||
// 1 INVOKEVIRTUAL android/support/v4/app/MyFragment\.getView
|
||||
// 2 GETSTATIC test/R\$id\.login
|
||||
// 2 INVOKEVIRTUAL android/support/v4/app/MyFragment\._\$_findCachedViewById
|
||||
// 2 CHECKCAST android/widget/Button
|
||||
+17
@@ -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>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package android.support.v4.app
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
open class Fragment {
|
||||
open fun getActivity(): Activity = throw Exception("Function getActivity() is not overridden")
|
||||
open fun getView(): View = throw Exception("Function getView() is not overridden")
|
||||
}
|
||||
|
||||
public class MyFragment : Fragment() {
|
||||
init {login}
|
||||
}
|
||||
|
||||
// 2 public _\$_findCachedViewById
|
||||
// 2 public _\$_clearFindViewByIdCache
|
||||
// 1 INVOKEVIRTUAL android/support/v4/app/MyFragment\.getView
|
||||
// 1 GETSTATIC test/R\$id\.login
|
||||
// 1 INVOKEVIRTUAL android/support/v4/app/MyFragment\._\$_findCachedViewById
|
||||
// 1 CHECKCAST android/widget/Button
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<fragment
|
||||
android:id="@+id/fragm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</FrameLayout>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package android.support.v4.app
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Bundle
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
open class FragmentManager {
|
||||
open fun findFragmentById(id: Int): Fragment = throw Exception("Function getFragmentById() is not overriden")
|
||||
}
|
||||
|
||||
open class Fragment {
|
||||
open fun getFragmentManager(): FragmentManager = throw Exception("Function getFragmentManager() is not overriden")
|
||||
}
|
||||
|
||||
open class FragmentActivity : Activity() {
|
||||
open fun getSupportFragmentManager(): FragmentManager = throw Exception("Function getSupportFragmentManager() is not overriden")
|
||||
}
|
||||
|
||||
public class MyActivity : FragmentActivity() {
|
||||
init { fragm }
|
||||
}
|
||||
|
||||
public class MyFragment : Fragment() {
|
||||
init { fragm }
|
||||
}
|
||||
|
||||
// 1 INVOKEVIRTUAL android/support/v4/app/FragmentActivity\.getSupportFragmentManager
|
||||
// 1 INVOKEVIRTUAL android/support/v4/app/Fragment\.getFragmentManager
|
||||
// 2 GETSTATIC test/R\$id\.fragm
|
||||
// 2 INVOKEVIRTUAL android/support/v4/app/FragmentManager\.findFragmentById
|
||||
// 2 CHECKCAST android/support/v4/app/Fragment
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</FrameLayout>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Bundle
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
public class MyActivity : Activity() {
|
||||
fun test() {
|
||||
stub
|
||||
}
|
||||
}
|
||||
|
||||
// 1 GETSTATIC test/R\$id\.stub
|
||||
// 0 INVOKEVIRTUAL test/MyActivity\._\$_findCachedViewById
|
||||
// 1 INVOKEVIRTUAL android/app/Activity\.findViewById
|
||||
// 0 CHECKCAST android/view/ViewStub
|
||||
// 2 CHECKCAST android/view/View
|
||||
Reference in New Issue
Block a user