Android Extensions: Support non-latin identifiers (KT-20299)
This commit is contained in:
+2
-1
@@ -32,7 +32,8 @@ object AndroidConst {
|
|||||||
val ID_ATTRIBUTE_NO_NAMESPACE: String = "id"
|
val ID_ATTRIBUTE_NO_NAMESPACE: String = "id"
|
||||||
val CLASS_ATTRIBUTE_NO_NAMESPACE: String = "class"
|
val CLASS_ATTRIBUTE_NO_NAMESPACE: String = "class"
|
||||||
|
|
||||||
val IDENTIFIER_REGEX = "^@(\\+)?(([A-Za-z0-9_\\.]+)\\:)?id\\/([A-Za-z0-9_]+)$".toRegex()
|
private val IDENTIFIER_WORD_REGEX = "[(?:\\p{L}\\p{M}*)0-9_\\.]+"
|
||||||
|
val IDENTIFIER_REGEX = "^@(\\+)?(($IDENTIFIER_WORD_REGEX)\\:)?id\\/($IDENTIFIER_WORD_REGEX)$".toRegex()
|
||||||
|
|
||||||
val CLEAR_FUNCTION_NAME = "clearFindViewByIdCache"
|
val CLEAR_FUNCTION_NAME = "clearFindViewByIdCache"
|
||||||
|
|
||||||
|
|||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sonuç"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Enter your password" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/привет"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ems="10"
|
||||||
|
android:inputType="textPassword" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/こんにちは"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Sign in" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
plugins/android-extensions/android-extensions-compiler/testData/descriptors/nonLatinNames/result.txt
Vendored
+38
@@ -0,0 +1,38 @@
|
|||||||
|
kotlinx
|
||||||
|
|
||||||
|
|
||||||
|
kotlinx.android
|
||||||
|
|
||||||
|
|
||||||
|
kotlinx.android.synthetic
|
||||||
|
|
||||||
|
public fun android.app.Activity.clearFindViewByIdCache(): kotlin.Unit
|
||||||
|
public fun android.app.Fragment.clearFindViewByIdCache(): kotlin.Unit
|
||||||
|
public fun android.view.View.clearFindViewByIdCache(): kotlin.Unit
|
||||||
|
public fun kotlinx.android.extensions.LayoutContainer.clearFindViewByIdCache(): kotlin.Unit
|
||||||
|
|
||||||
|
|
||||||
|
kotlinx.android.synthetic.main
|
||||||
|
|
||||||
|
|
||||||
|
kotlinx.android.synthetic.main.test
|
||||||
|
|
||||||
|
public val android.app.Activity.sonuç: android.widget.TextView!
|
||||||
|
public val android.app.Dialog.sonuç: android.widget.TextView!
|
||||||
|
public val android.app.Fragment.sonuç: android.widget.TextView!
|
||||||
|
public val kotlinx.android.extensions.LayoutContainer.sonuç: android.widget.TextView!
|
||||||
|
public val android.app.Activity.привет: android.widget.EditText!
|
||||||
|
public val android.app.Dialog.привет: android.widget.EditText!
|
||||||
|
public val android.app.Fragment.привет: android.widget.EditText!
|
||||||
|
public val kotlinx.android.extensions.LayoutContainer.привет: android.widget.EditText!
|
||||||
|
public val android.app.Activity.こんにちは: android.widget.Button!
|
||||||
|
public val android.app.Dialog.こんにちは: android.widget.Button!
|
||||||
|
public val android.app.Fragment.こんにちは: android.widget.Button!
|
||||||
|
public val kotlinx.android.extensions.LayoutContainer.こんにちは: android.widget.Button!
|
||||||
|
|
||||||
|
|
||||||
|
kotlinx.android.synthetic.main.test.view
|
||||||
|
|
||||||
|
public val android.view.View.sonuç: android.widget.TextView!
|
||||||
|
public val android.view.View.привет: android.widget.EditText!
|
||||||
|
public val android.view.View.こんにちは: android.widget.Button!
|
||||||
+6
@@ -72,6 +72,12 @@ public class AndroidSyntheticPropertyDescriptorTestGenerated extends AbstractAnd
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("nonLatinNames")
|
||||||
|
public void testNonLatinNames() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("plugins/android-extensions/android-extensions-compiler/testData/descriptors/nonLatinNames/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("sameIds")
|
@TestMetadata("sameIds")
|
||||||
public void testSameIds() throws Exception {
|
public void testSameIds() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/android-extensions/android-extensions-compiler/testData/descriptors/sameIds/");
|
String fileName = KotlinTestUtils.navigationMetadata("plugins/android-extensions/android-extensions-compiler/testData/descriptors/sameIds/");
|
||||||
|
|||||||
Reference in New Issue
Block a user