Finaly, I made the code independent from my own aplications, and could sucessfuly comment EVERY line of code.What am I talking about?
Well, it's the First, Object Oriented User Interface for Arduino, with an Advanced controller of Touch and Viewshttps://github.com/ivanseidel/ArdUI/wiki
All based in Events and Callbacks, and also inspired on real Android code, you can easily implement whatever you want with it.
Some key features:
* Touch is handled BOTH in interrupt and Timer
(Once a touch is triggered on the interrupt, Timer is the one who start trigering the event. Once no touch is detected, controll is passed to the Interrupt)
* Callbacks. Every view has it's own callbacks and events. onClick, onTouch, onChange.
* Touch Events. Like Android, touch events are implemented, such as: ACTION_DOWN, ACTION_UP, ACTION_MOVE, ACTION_HOVER_ENTER, ACTION_HOVER_EXIT
* Views are implemented extending main class View, or other that implements View. Object oriented allows user to extend a class and improve whatever he wants to.
Views already implemented: SeekBar, ProgressBar, Button, CheckBox, TextView and ViewGroup, that allows many views in a single views.
* Tree Rendering: Once a render is triggered, the view start rendering it's own tree. For example:
If you have 5 views inside a ViewGroup, and one of the 5 is also a ViewGroup containing more 10 views, calling a "render()" on the top view of the tree, will start rendering all the views. Also, calling a "render(false)" will start rendering ONLY the "invalidated" views (only what is necessary).
* Relative rendering: If one view is inside the other, it's relative to the other. One position in a view is ALWAYS relative to it's parent. Moving a view that has views inside, cause it's childs to move with it. Rendering, and Touch are handled relative also.
* Changing Between rootViews is very easy (for example, running another function, state,...). Prepare all your views, and then register the current one on ArdUI. He will make the rest...
Documentation is not done yet, and there is a lot to be done (and improved). I'm using it currently on my robots: TendaDigital.net and it seems to be VERY robust and thrustable.
This is the kind of library, that does everything, you just need to know how to use it (Yet, a little complicated, since I'm still documenting).