Add compiler tests for support.v4.app.Fragment
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.myapp"
|
||||
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>
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package kotlinx.android.synthetic.test
|
||||
|
||||
import android.app.*
|
||||
import android.view.*
|
||||
import android.widget.*
|
||||
import android.webkit.*
|
||||
import android.inputmethodservice.*
|
||||
import android.opengl.*
|
||||
import android.appwidget.*
|
||||
import android.support.v4.app.*
|
||||
import android.support.v4.view.*
|
||||
import android.support.v4.widget.*
|
||||
import kotlin.internal.flexible.ft
|
||||
|
||||
val android.app.Activity.item_detail_container: ft<FrameLayout, FrameLayout?>
|
||||
get() = findViewById(0) as? FrameLayout
|
||||
|
||||
val android.app.Fragment.item_detail_container: ft<FrameLayout, FrameLayout?>
|
||||
get() = getView().findViewById(0) as? FrameLayout
|
||||
|
||||
val android.support.v4.app.Fragment.item_detail_container: ft<FrameLayout, FrameLayout?>
|
||||
get() = getView().findViewById(0) as? FrameLayout
|
||||
|
||||
val android.app.Activity.textView1: ft<TextView, TextView?>
|
||||
get() = findViewById(0) as? TextView
|
||||
|
||||
val android.app.Fragment.textView1: ft<TextView, TextView?>
|
||||
get() = getView().findViewById(0) as? TextView
|
||||
|
||||
val android.support.v4.app.Fragment.textView1: ft<TextView, TextView?>
|
||||
get() = getView().findViewById(0) as? TextView
|
||||
|
||||
val android.app.Activity.password: ft<EditText, EditText?>
|
||||
get() = findViewById(0) as? EditText
|
||||
|
||||
val android.app.Fragment.password: ft<EditText, EditText?>
|
||||
get() = getView().findViewById(0) as? EditText
|
||||
|
||||
val android.support.v4.app.Fragment.password: ft<EditText, EditText?>
|
||||
get() = getView().findViewById(0) as? EditText
|
||||
|
||||
val android.app.Activity.login: ft<Button, Button?>
|
||||
get() = findViewById(0) as? Button
|
||||
|
||||
val android.app.Fragment.login: ft<Button, Button?>
|
||||
get() = getView().findViewById(0) as? Button
|
||||
|
||||
val android.support.v4.app.Fragment.login: ft<Button, Button?>
|
||||
get() = getView().findViewById(0) as? Button
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package kotlinx.android.synthetic.test.view
|
||||
|
||||
import android.app.*
|
||||
import android.view.*
|
||||
import android.widget.*
|
||||
import android.webkit.*
|
||||
import android.inputmethodservice.*
|
||||
import android.opengl.*
|
||||
import android.appwidget.*
|
||||
import android.support.v4.app.*
|
||||
import android.support.v4.view.*
|
||||
import android.support.v4.widget.*
|
||||
import kotlin.internal.flexible.ft
|
||||
|
||||
val android.view.View.item_detail_container: ft<FrameLayout, FrameLayout?>
|
||||
get() = findViewById(0) as? FrameLayout
|
||||
|
||||
val android.view.View.textView1: ft<TextView, TextView?>
|
||||
get() = findViewById(0) as? TextView
|
||||
|
||||
val android.view.View.password: ft<EditText, EditText?>
|
||||
get() = findViewById(0) as? EditText
|
||||
|
||||
val android.view.View.login: ft<Button, Button?>
|
||||
get() = findViewById(0) as? Button
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
+5
-5
@@ -1,20 +1,20 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Fragment
|
||||
import android.os.Bundle
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.layout.*
|
||||
|
||||
public class MyActivity : Activity()
|
||||
public class MyFragment : Fragment()
|
||||
|
||||
fun MyActivity.b() {
|
||||
fun MyFragment.b() {
|
||||
val x = login
|
||||
val y = this.login
|
||||
}
|
||||
|
||||
// 1 public _\$_findCachedViewById
|
||||
// 1 public _\$_clearFindViewByIdCache
|
||||
// 1 INVOKEVIRTUAL com/myapp/MyActivity\.findViewById
|
||||
// 1 INVOKEVIRTUAL com/myapp/MyFragment\.getView
|
||||
// 2 GETSTATIC com/myapp/R\$id\.login
|
||||
// 2 INVOKEVIRTUAL com/myapp/MyActivity\._\$_findCachedViewById
|
||||
// 2 INVOKEVIRTUAL com/myapp/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>
|
||||
+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.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 com/myapp/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.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 com/myapp/R\$id\.login
|
||||
// 1 INVOKEVIRTUAL android/support/v4/app/MyFragment\._\$_findCachedViewById
|
||||
// 1 CHECKCAST android/widget/Button
|
||||
Reference in New Issue
Block a user