https://kotlinlang.org logo
#android
Title
# android
l

louiscad

08/23/2019, 9:38 AM
Here's a random dream: Android resources ids (
R.sometype.stuff
) generated as inline classes.
🙏 1
t

Thomas

08/23/2019, 9:39 AM
And multiplatform strings.xml!
l

louiscad

08/23/2019, 9:40 AM
Well, multiplatform
strings.kt
, no?
😁 1
m

Melvin Biamont

08/23/2019, 9:41 AM
Same for Visibility or LayoutParams which could be inline classes
l

louiscad

08/23/2019, 9:43 AM
@Melvin Biamont
LayoutParams
couldn't be inline classes, they have more than one field. Regarding visibility, it'd require inline enums (which R8 already do), but it's often easier to just use
isVisible
and alike extensions from AndroidX core KTX.
a
l

louiscad

08/23/2019, 9:44 AM
@alex009 You're working on it?
a

alex009

08/23/2019, 9:48 AM
yes. we already have MR (multiplatform resources) expect/actual where we should add manually new keys when add strings to resources, and plan to implement gradle plugin for generation from some strings.xml multiplatform resources & MR class
🚀 1
l

louiscad

08/23/2019, 4:51 PM
I'd be interested to see it! Feel free to share even if not fully polished.
2 Views