Activity

Declaration

class enamlnative.widgets.activity.Activity(parent=None, **kwargs)[source]

Bases: enaml.widgets.toolkit_object.ToolkitObject

proxy

Reference to the proxy

app

Reference to the application

started

Activity lifecycle events

state

Activity lifecycle state must be set by the implementation

dp

Pixel density of the device Loaded immediately as this is used often.

width

Width of the screen in dp

height

Height of the screen in dp

orientation

Screen orientation

build_info

Build info from https://developer.android.com/reference/android/os/Build.VERSION.html

api_level

SDK version Loaded immediately

async start()[source]

Start the activity.

on_back_pressed() bool[source]

Override this to handle the back event

on_reload()[source]

Override this to handle the back event

child_added(child)[source]

A reimplemented child added event handler.

This handler will invoke the superclass handler and then invoke the ‘child_added()’ method on an active proxy.

Android Implementation

class enamlnative.android.android_activity.AndroidActivity[source]

Bases: enamlnative.widgets.activity.ProxyActivity

widget

Reference to the activty

window

Default window id

view

View currently displayed

init_widget()[source]

Initialize on the first call

async start()[source]

Start the activity and retrieve the window id

activate_bottom_up()[source]

Show the first child view of the window

child_added(child)[source]

Handle a child being added to the object.

This method will only be called after the proxy tree is active and the UI is running. The default implementation is a no-op.

Parameters

child (ProxyToolkitObject) – The toolkit proxy child added to the object.

on_activity_lifecycle_changed(state)[source]

Update the state when the android app is paused, resumed, etc..

Widgets can observe this value for changes if they need to react to app lifecycle changes.

on_back_pressed()[source]

Fire the back_pressed event with a dictionary with a ‘handled’ key when the back hardware button is pressed

If ‘handled’ is set to any value that evaluates to True the default event implementation will be ignored.

on_configuration_changed(config)[source]

Handles a screen configuration change.

No iOS implementation found.