Joel Denke
02/12/2024, 8:44 AMZoltan Demant
02/12/2024, 8:48 AMAnd for each StringsResource I provide a key, like appText key = TextResource(Res.string.appText)If I understand you correctly, by this you would do something like
val ok = TextResource(Res.string.ok)
? If thats the case, I think its a bad idea. Over time it gets very hard to keep these consistent, and you need to declare stuff twice all the time. I did this once and never again 😅Joel Denke
02/12/2024, 8:57 AMoverride val ok = TextResource(Res.string.ok)
in shared module, and inject the interface in DI level.
And in my actual code i compose it will be like MyText(MyAppTheme.resources.strings.ok)
which will call stringResource(MyAppTheme.resources.strings.ok.resource)
in my custom MyText composable using TextResource sealed interface for multiple types, like AnnotadedString, String and Android native types partly.Joel Denke
02/12/2024, 10:14 AM