Android extensions: Do not cache ViewStub widgets, do not cast it automatically
This commit is contained in:
Vendored
+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