r/androiddev • u/koje1971 • Aug 02 '26
build a UI withoutXML or Compose
I'm building the UI for my little Android game without XML or Compose. I wrote my own wrapper classes for the views and can use them in a kind of custom DSL.
45
Upvotes
3
u/Oily-Affection1601 Aug 02 '26
As a learning experience, or did you have a specific need not covered adequately with existing frameworks?
9
u/0x1F601 Aug 02 '26
Wow the old school nostalgia is strong here... (except in kotlin)
Before "good" IDE layout rendering was added I swear this was how old school android was envisioned to be. I think you've basically captured the mental model that the view system had intended.
Why you'd proceed down this path when the view based UI system is clearly deprecated and on the way out is beyond me. But hey, if it works for you it works and if you like it you like it. The whole point of rolling your own solution is so you can do whatever the fuck you like. Enjoy it!
3
u/Radiokot1 Aug 04 '26
Remember Anko? :)
49
u/adrianczuczka Aug 02 '26
we got android hard mode before GTA6
33
u/ramzes190 Aug 02 '26
ugly as expected. congrats!
41
u/ThaBalla79 Aug 02 '26
13
u/OverallAd9984 Aug 02 '26
so they r views!
5
u/KalamaresFTW Aug 02 '26
Extremely cursed, gotta love it
1
u/Zhuinden Aug 02 '26
So is this using Splitties or what?
1
u/Traditional_Glass_45 Aug 03 '26
Why? What is the reason for using coded views?
1
u/Mavamaarten Aug 04 '26
At this point, why would you not use Compose?
1
u/ProHussain Aug 05 '26
Why do you prefer android views over compose?
3
u/iamwisespirit Aug 03 '26
I think if u wrote this in java it would be great
3
u/JacksOnF1re Aug 03 '26
Don't tell these kids what their xmls views are internally.
2
u/programadorthi Aug 02 '26
Anything that accepts at least a Double Buffer we can draw.
2
u/leonardovallem Aug 03 '26
ios uikit feelings
2
u/Interesting-Let8134 Aug 04 '26
Looks like anko controls from 2017
1
u/iamwisespirit Aug 03 '26
People find out way of building ui with code 🤯