https://kotlinlang.org logo
r

romainguy

05/20/2019, 2:54 AM
Yes, we have wrappers for existing Android views
n

napperley

05/20/2019, 2:55 AM
Is there a example available?
r

romainguy

05/20/2019, 2:55 AM
Of creating wrappers or using them?
n

napperley

05/20/2019, 2:55 AM
Both.
r

romainguy

05/20/2019, 2:55 AM
You'll find both in the source tree
I'm not at a computer now so can't look for their exact location
n

napperley

05/20/2019, 2:56 AM
Can the views be incorporated without having to use a separate XML layout?
r

romainguy

05/20/2019, 3:05 AM
Yep
That's not new, you never had to use XML layouts before
n

napperley

05/20/2019, 3:26 AM
Can you please elaborate further.
r

romainguy

05/20/2019, 3:27 AM
XML was always optional to create layouts, that's not changing (for old views integration)
n

napperley

05/20/2019, 3:31 AM
From what I understand views could be done using the standard Android APIs, however there were no style APIs hence all styles had to be defined in XML files.
Lack of style APIs is one of the major reasons why Android developers couldn't declaratively do views in code, unless the app being developed doesn't use styles which is unlikely.
r

romainguy

05/20/2019, 3:46 AM
Styles have to be in XML (although...) but Views themselves can be used programmatically
n

napperley

05/20/2019, 3:52 AM
Will that change later on (especially with many styles being dynamic)? What do you mean by although with styles (is there a catch involved)?
g

gildor

05/20/2019, 5:56 AM
Styles for Views are in XML and Views work with them using styled attribute and theme API, Compose has nothing like that now, own style definition API defined in code, check source code, there are many examples
2 Views