This week was mainly spent with preparing for the next major release:
- The usage of lambdas was streamlined. Now there is a proper interface (Java side) for each method which will accept a lambda
and a proper extension function which accepts Kotlin lambdas. So what looks like this in Java:
tileGrid.onInput(System.out::println);looks like this in Kotlin:tileGrid.onInput { println(it) }. This way both languages have idiomatic APIs. There are also new examples for each language demonstrating how these things work in their own class in thezircon.examplesproject. Inputhandling was also streamlined. This was a bit awkward before, but now there are separateInput,KeyStrokeandMouseListenerinterfaces and a nice API to use them. Previously there were seemingly arbitrary functions (likeonMouseReleased), but now the concept is fleshed out properly. You can still use the old ways, but behind the scenes it is now clean code.- The component rendering refactor is now complete, and there are examples with all kinds of decorations for all components.
Now all components can be decorated with all decorations including shadow, box, and more.
Here are some screenshots and a short description about the purpose of the component:
- TextBox: a
TextBoxis for representing textual content without the ability to edit. It supports semantic content elemens likeHeaders,ListItems andParagraphs. - TextArea: this one is for editing text. It supports displaying the cursor and can be single or multiline
- RadioButtonGroup is a container of
RatioButtons It supports a selection listener and you can add key-value pairs to it. We used key-value pairs because we still have nightmares about the old androidSpinnercomponent which just used a flatList<String>and it was horrible to pick items from it. - Panel is a
Container. This means that you can add otherComponents to it, or even otherPanels. - Label is an one-liner non-editable text component.
- Header is another one-liner non-editable text component
but it uses the primary foreground color as opposed to the
Labelwhich uses the secondary. This means that by using theHeaderyou can add emphasis to the text on the screen without tampering with styles. - CheckBox behaves as you would expect it to. The difference
from the
RadioButtonGroupis that the selected state is not dependent on otherCheckBoxes so they don’t need to be grouped either. - Buttons are simple clickable components
- TextBox: a
- The roadmap for the release is now complete. You can check the ToDo column here, this is what we want to get done before the next major release. This also means that now is the time to speark up if you want to see something in it. :)
A next major release is coming up for this Autumn, so stay tuned.
Do you have questions? Ask us on our Discord Server.
If you like what we do and want to support us consider becoming a Patron.