Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix illegal chars getting generated into function names. #234

Merged
merged 2 commits into from May 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions sample/src/main/java/com/airbnb/android/showkasesample/Text.kt
Expand Up @@ -143,3 +143,14 @@ fun H6TextRowComponentPreview(
) {
H6TextRowComponent(person.name)
}

// This is here for testing, generating this code into function names would
// fail dex generation
@Preview(name = "H6 Text Row & special chars !@#$%^&*()_+", group = "Text")
@Composable
fun H6TextRowComponentPreviewWithSpecialCharInPreview(
age: String = "15",
@PreviewParameter(provider = ParameterProvider::class) person: Person
) {
H6TextRowComponent(person.name)
}
Expand Up @@ -38,7 +38,7 @@ internal class ShowkaseCodegenMetadataWriter(private val environment: XProcessin
"${name}_${showkaseMetadata.showkaseStyleName}"
} else {
name
}.replace(" ", "_")
}.filter { it.isLetterOrDigit() }

val annotation = createShowkaseCodegenMetadata(showkaseMetadata)
showkaseMetadata.enclosingClassName?.let {
Expand Down