Android Extensions: Correctly handle namespaces in layout xml
#KT-19451 Fixed Target versions 1.1.5
This commit is contained in:
+2
-1
@@ -43,7 +43,7 @@ class AndroidXmlVisitor(val elementCallback: (ResourceIdentifier, String, XmlAtt
|
||||
return
|
||||
}
|
||||
|
||||
val idAttribute = tag?.getAttribute(AndroidConst.ID_ATTRIBUTE)
|
||||
val idAttribute = tag?.getAttribute(AndroidConst.ID_ATTRIBUTE_NO_NAMESPACE, AndroidConst.ANDROID_NAMESPACE)
|
||||
if (idAttribute != null) {
|
||||
val idAttributeValue = idAttribute.value
|
||||
if (idAttributeValue != null) {
|
||||
@@ -52,6 +52,7 @@ class AndroidXmlVisitor(val elementCallback: (ResourceIdentifier, String, XmlAtt
|
||||
if (name != null) elementCallback(name, xmlType, idAttribute)
|
||||
}
|
||||
}
|
||||
|
||||
tag?.acceptChildren(this)
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Bundle
|
||||
import java.io.File
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
public class MyActivity : Activity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {}
|
||||
val button = login<caret>
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<FrameLayout xmlns:a="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
a:id="@+id/item_detail_container"
|
||||
a:layout_width="match_parent"
|
||||
a:layout_height="match_parent"
|
||||
tools:context=".ItemDetailActivity"
|
||||
tools:ignore="MergeRootFrame" >
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
a:id="@+id/login"
|
||||
a:layout_width="match_parent"
|
||||
a:layout_height="wrap_content"
|
||||
a:text="Sign in" />
|
||||
|
||||
</FrameLayout>
|
||||
+6
@@ -36,6 +36,12 @@ public class AndroidGotoTestGenerated extends AbstractAndroidGotoTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("plugins/android-extensions/android-extensions-idea/testData/android/goto"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, false);
|
||||
}
|
||||
|
||||
@TestMetadata("customNamespaceName")
|
||||
public void testCustomNamespaceName() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/android-extensions/android-extensions-idea/testData/android/goto/customNamespaceName/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("fqNameInAttr")
|
||||
public void testFqNameInAttr() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/android-extensions/android-extensions-idea/testData/android/goto/fqNameInAttr/");
|
||||
|
||||
Reference in New Issue
Block a user