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

louiscad

08/28/2019, 7:34 AM
Some folks at Square also believe xml UIs are the past and made this: https://github.com/square/contour What do you think about it? Also, any thoughts relative to Splitties Views DSL?
i

ispbox

08/28/2019, 9:29 AM
@louiscad Thanks a lot for a link! From the first point of view looks quite promising (and much better than Compose 🙂 ). If talking about DSL API generations, I would mark Anko as 1st generation (too linked to Android activities, not so flexible with custom views), Splitties DSL as 2nd generation (beautiful Ui interface, out-of-box support for any custom View), and probably Contour is the 3rd generation.
l

louiscad

08/28/2019, 9:30 AM
@ispbox Is there something you prefer in Contour? Is the 3rd generation better than the 2nd 😅 ?
And things you prefer in Splitties Views DSL rather than Contour? I have to admit I didn't dug deep into it yet.
i

ispbox

08/28/2019, 9:32 AM
I'm impressed with the following sample:
Copy code
leftTo { 
  if (user.name.isEmpty) parent.left()
  else nameView.right()
}
Also it is definitely cool to have context-aware API. That is a long lasting problem of Android views and layout parameters 🙂
I didn't dig deeper as well (it looks like they are just on the way, and it is not stable enough for production). I think that Splitties is much better suited for production compared to Anko and Contour 🙂 Splitties just give you better Android views, and Contour tries to provide new kind of views, with its own layout system. It definitely requires respect and honor 😉
And this line looks ugly:
Copy code
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18f)
l

louiscad

08/28/2019, 10:23 AM
The ugly line also isn't accessibility friendly.
i

ispbox

08/28/2019, 4:30 PM
Took a look at their sample. I'm not convinced finally. But wish these guys good luck!
4 Views