Package com.subaio.fintechbridge
Class BridgeView.BridgeViewListener
java.lang.Object
com.subaio.fintechbridge.BridgeView.BridgeViewListener
- Enclosing class:
- BridgeView
Event handlers for `BridgeView`
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
onViewChangedStatus
(BridgeView view, ViewStatus status) Called whenever the view changes status.protected void
onViewCustomEvent
(BridgeView view, String name, Object data) Called when a custom event is received from the view.protected abstract void
onViewDidReceiveError
(BridgeView view, ViewError error) Called whenever the view encounters an error.protected abstract void
Called whenever the view attempts to go back.protected abstract void
onViewNavigated
(BridgeView view, Page page) Called whenever the view attempts to navigate to another page.protected void
onViewUpdatedTitle
(BridgeView view, String title) Called whenever the view changes title.
-
Constructor Details
-
BridgeViewListener
public BridgeViewListener()
-
-
Method Details
-
onViewDidSelectBack
Called whenever the view attempts to go back. Should likely finish the current activity.- Parameters:
view
- Calling view.
-
onViewChangedStatus
Called whenever the view changes status. It is not necessary to react to this. Can be used to implement a custom loading-screen by hiding the loading-screen and showing the view on a change to `running` or `errored`. Can be used to implement a custom error-screen by hiding the view and showing an error page on a change to `errored`.- Parameters:
view
- Calling view.status
- New status of the view.
-
onViewUpdatedTitle
Called whenever the view changes title. If a host-application controlled title-bar is used, this text should be shown there.- Parameters:
view
- Calling view.title
- Title of the view.
-
onViewDidReceiveError
Called whenever the view encounters an error. `NO_TEMPLATE`, `VIEW_TIMED_OUT` and `UNDERLYING` should be handled by showing an error page. `INTERNAL_ERROR` represents errors inside the the webview and will have an error page shown there.- Parameters:
view
- Calling view.error
- the error.
-
onViewCustomEvent
Called when a custom event is received from the view. The name and content of custom events should be agreed upon between the host and embedded apps. Should likely start an activity of type `Intent.ACTION_VIEW`.- Parameters:
view
- Calling view.name
- Name of the custom eventdata
- Payload sent with the event. Type will match return-type of org.json.JSONObject.opt, i.e. JSONObject, JSONArray, String, Double, Boolean or null.