examples: annotate examples
[nit.git] / lib / app / examples / ui_example.nit
index 43628af..8f4f8f1 100644 (file)
 
 # User interface example using `app::ui`
 module ui_example is
+       example
        app_name "app.nit UI"
        app_namespace "org.nitlanguage.ui_example"
-       android_api_target 15
+       android_api_min 21
+       android_api_target 21
+       android_manifest_activity "android:theme=\"@android:style/Theme.Material\""
 end
 
 import app::ui
@@ -31,7 +34,7 @@ class UiExampleWindow
        var layout = new ListLayout(parent=self)
 
        # Some label
-       var some_label = new Label(parent=layout, text="This Window uses a ListLayout.")
+       var some_label = new Label(parent=layout, text="Sample Window using a ListLayout.")
 
        # A checkbox
        var checkbox = new CheckBox(parent=layout, text="A CheckBox")
@@ -82,11 +85,4 @@ class SecondWindow
        var another_label = new Label(parent=layout, text="Close it by tapping the back button.")
 end
 
-redef class App
-       redef fun on_create
-       do
-               # Create the main window
-               push_window new UiExampleWindow
-               super
-       end
-end
+redef fun root_window do return new UiExampleWindow