Support androidx packages

... in the IDE plugin and the Android extensions compiler.

Change-Id: Iffd58351b0592e12ffc937c06d871d26958fe161
This commit is contained in:
Raluca Sauciuc
2018-04-06 08:42:17 -07:00
committed by Yan Zhulanow
parent 612baacc25
commit 89d61ee12d
13 changed files with 166 additions and 8 deletions
@@ -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,26 @@
package androidx.fragment.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
// 2 INVOKEVIRTUAL androidx/fragment/app/Fragment\.getView
// 2 GETSTATIC test/R\$id\.login
// 2 INVOKEVIRTUAL androidx/fragment/app/MyFragment\._\$_findCachedViewById
// 2 CHECKCAST android/widget/Button
@@ -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 androidx.fragment.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
// 2 INVOKEVIRTUAL androidx/fragment/app/Fragment\.getView
// 1 GETSTATIC test/R\$id\.login
// 1 INVOKEVIRTUAL androidx/fragment/app/MyFragment\._\$_findCachedViewById
// 1 CHECKCAST android/widget/Button
@@ -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>
@@ -0,0 +1,31 @@
package androidx.fragment.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 androidx/fragment/app/FragmentActivity\.getSupportFragmentManager
// 1 INVOKEVIRTUAL androidx/fragment/app/Fragment\.getFragmentManager
// 2 GETSTATIC test/R\$id\.fragm
// 2 INVOKEVIRTUAL androidx/fragment/app/FragmentManager\.findFragmentById