public interface Surface
Modifier and Type | Interface and Description |
---|---|
static interface |
Surface.ReportErrorRunnable
A runnable to be called in the event of an error.
|
Modifier and Type | Method and Description |
---|---|
android.view.View |
attach(MicroService service,
java.lang.Runnable onAttached,
Surface.ReportErrorRunnable onError)
Attaches a MicroService to the UI.
|
void |
bind(MicroService service,
JSContext context,
JSObject export,
JSValue config,
java.lang.Runnable onBound,
Surface.ReportErrorRunnable onError)
Binds a surface to a MicroService.
|
void |
detach()
Detaches any currently attached MicroService.
|
void |
reset()
Detaches and clears the Surface.
|
void bind(MicroService service, JSContext context, JSObject export, JSValue config, java.lang.Runnable onBound, Surface.ReportErrorRunnable onError)
service
- The microservice on which to bindcontext
- The Javascript context on which to bindexport
- An object which will be passed back to the caller where the surface may
export its JS bindingsconfig
- An optional configuration parameter passed from JavaScriptonBound
- A runnable which must be called once binding is completeonError
- A runnable which should be called if binding failsandroid.view.View attach(MicroService service, java.lang.Runnable onAttached, Surface.ReportErrorRunnable onError)
service
- The MicroService to attachonAttached
- A runnable to be called after the UI is activeonError
- A runnable which should be called if attaching failsvoid detach()
void reset()