Ignore fragment tag (it requires a different implementation)
This commit is contained in:
+2
-5
@@ -38,7 +38,7 @@ public object AndroidConst {
|
||||
|
||||
val CLEAR_FUNCTION_NAME = "clearFindViewByIdCache"
|
||||
|
||||
val IGNORED_XML_WIDGET_TYPES = setOf("requestFocus", "merge", "tag", "check")
|
||||
val IGNORED_XML_WIDGET_TYPES = setOf("requestFocus", "merge", "tag", "check", "fragment")
|
||||
|
||||
val ESCAPED_IDENTIFIERS = (JetTokens.KEYWORDS.getTypes() + JetTokens.SOFT_KEYWORDS.getTypes())
|
||||
.map { it as? JetKeywordToken }.filterNotNull().map { it.getValue() }.toSet()
|
||||
@@ -64,10 +64,7 @@ public fun isWidgetTypeIgnored(xmlType: String): Boolean {
|
||||
return (xmlType.isEmpty() || xmlType in AndroidConst.IGNORED_XML_WIDGET_TYPES)
|
||||
}
|
||||
|
||||
public fun getRealWidgetType(xmlType: String): String = when (xmlType) {
|
||||
"fragment", "include" -> "View"
|
||||
else -> xmlType
|
||||
}
|
||||
public fun getRealWidgetType(xmlType: String): String = if (xmlType == "include") "View" else xmlType
|
||||
|
||||
fun escapeAndroidIdentifier(id: String): String {
|
||||
return if (id in AndroidConst.ESCAPED_IDENTIFIERS) "`$id`" else id
|
||||
|
||||
-6
@@ -18,12 +18,6 @@ val android.app.Activity.includeTag: ft<View, View?>
|
||||
val android.app.Fragment.includeTag: ft<View, View?>
|
||||
get() = getView().findViewById(0)
|
||||
|
||||
val android.app.Activity.fragmentTag: ft<View, View?>
|
||||
get() = findViewById(0)
|
||||
|
||||
val android.app.Fragment.fragmentTag: ft<View, View?>
|
||||
get() = getView().findViewById(0)
|
||||
|
||||
val android.app.Activity.`fun`: ft<TextView, TextView?>
|
||||
get() = findViewById(0) as? TextView
|
||||
|
||||
|
||||
-3
@@ -15,9 +15,6 @@ import kotlin.internal.flexible.ft
|
||||
val android.view.View.includeTag: ft<View, View?>
|
||||
get() = findViewById(0)
|
||||
|
||||
val android.view.View.fragmentTag: ft<View, View?>
|
||||
get() = findViewById(0)
|
||||
|
||||
val android.view.View.`fun`: ft<TextView, TextView?>
|
||||
get() = findViewById(0) as? TextView
|
||||
|
||||
|
||||
Reference in New Issue
Block a user