Merge: Intro the portable UI of app.nit
authorJean Privat <jean@pryen.org>
Wed, 20 May 2015 00:29:57 +0000 (20:29 -0400)
committerJean Privat <jean@pryen.org>
Wed, 20 May 2015 00:29:57 +0000 (20:29 -0400)
commit103fea4892b56763f8c6f6ceb77142c052ec4942
tree1a4fa61b4b4b2be878e4be24264411ed8dca30ce
parent21446b5d16d8fd25c2543d2b5143a24b54ad405a
parent05d20c6dfbbdce80b291a6eb14a6fedac0b89a76
Merge: Intro the portable UI of app.nit

This PR introduces a basic API to create UI applications portable between Android and GNU/Linux. Each implementation apply refinements to implement the API using platform-specific native controls, and GTK on GNU/Linux.

A few notes on the API logic (you will want to read the readme file too):

* All attached `AppComponents` instances receive the life-cycle annotations. This includes all controls and view. So a visible `Button` will be notified when the application pauses.

* All controls can be observed by other instances so that they are notified of input events. In the calculator example, we use this to implement the behavior on button press in the window logic.

This PR also updates to the calculator example to use only the portable UI.

The scope of the portable UI at this point is limited to views needed by the calculator example.
This is intentionnal to keep a small number of views while still tweaking the portable UI foundation.

TODO next:

* Complete the abstraction of some partially implemented features: balancing the size of views in a layout and limit what can be the top-level view within a window.
* iOS, OS X, OpenGL implementations of the portable UI.
* Add more views, and concrete examples to the portable UI.
* Deal with multiple distinct windows (there is a real problem on Android where each activity must have a distinct Java class.)
* Find and document the best way for the user to create custom portable views.

Pull-Request: #1348
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>