Skip to content

Instantly share code, notes, and snippets.

@dilrajsingh1997
Created Dec 3, 2021
Embed
What would you like to do?
fun getElementNavType(): String {
return when (propertyInfo.composeArgumentType) {
ComposeArgumentType.BOOLEAN -> "NavType.BoolType"
ComposeArgumentType.STRING -> "NavType.StringType"
ComposeArgumentType.FLOAT -> "NavType.FloatType"
ComposeArgumentType.INT -> "NavType.IntType"
ComposeArgumentType.LONG -> "NavType.LongType"
ComposeArgumentType.INT_ARRAY -> "IntArrayType"
ComposeArgumentType.BOOLEAN_ARRAY -> "BoolArrayType"
ComposeArgumentType.FLOAT_ARRAY -> "FloatArrayType"
ComposeArgumentType.LONG_ARRAY -> "LongArrayType"
else -> {
"${className}_${propertyInfo.propertyName.replaceFirstChar { it.uppercase() }}NavType"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment