-
-
Save dilrajsingh1997/85686df2f8a739a722dc8f1114b00ffa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file addLine "override fun get(bundle: Bundle, key: String): " | |
addVariableType(file, propertyInfo) | |
file addPhrase "? {" | |
tabs++ | |
when (propertyInfo.composeArgumentType) { | |
ComposeArgumentType.PARCELABLE -> file addLine "return bundle.getParcelable(key)" | |
ComposeArgumentType.PARCELABLE_ARRAY -> file addLine "return bundle.getParcelableArrayList(key)" | |
ComposeArgumentType.SERIALIZABLE -> { | |
file addLine "return bundle.getSerializable(key) as? " | |
addVariableType(file, propertyInfo) | |
} | |
} | |
tabs-- | |
file addLine "}" | |
file addLine "override fun put(bundle: Bundle, key: String, value: " | |
addVariableType(file, propertyInfo) | |
file addPhrase ") {" | |
tabs++ | |
when (propertyInfo.composeArgumentType) { | |
ComposeArgumentType.PARCELABLE -> file addLine "bundle.putParcelable(key, value)" | |
ComposeArgumentType.PARCELABLE_ARRAY -> file addLine "bundle.putParcelableArrayList(key, value)" | |
ComposeArgumentType.SERIALIZABLE -> file addLine "bundle.putSerializable(key, value)" | |
} | |
tabs-- | |
file addLine "}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment