# 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
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")
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