Class BridgeView.BridgeViewListener

java.lang.Object
com.subaio.fintechbridge.BridgeView.BridgeViewListener
Enclosing class:
BridgeView

public abstract static class BridgeView.BridgeViewListener
extends java.lang.Object
Event handlers for `BridgeView`
  • Constructor Summary

    Constructors 
    Constructor Description
    BridgeViewListener()  
  • Method Summary

    Modifier and Type Method Description
    protected void onViewChangedStatus​(BridgeView view, ViewStatus status)
    Called whenever the view changes status.
    protected void onViewCustomEvent​(BridgeView view, java.lang.String name, java.lang.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 onViewDidSelectBack​(BridgeView view)
    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, java.lang.String title)
    Called whenever the view changes title.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • onViewNavigated

      protected abstract void onViewNavigated​(BridgeView view, Page page)
      Called whenever the view attempts to navigate to another page. Should likely be handled by starting a new activity wrapping a `BridgeView` with the given page.
      Parameters:
      view - Calling view.
      page - Page to navigate to.
    • onViewDidSelectBack

      protected abstract void onViewDidSelectBack​(BridgeView view)
      Called whenever the view attempts to go back. Should likely finish the current activity.
      Parameters:
      view - Calling view.
    • onViewChangedStatus

      protected void onViewChangedStatus​(BridgeView view, ViewStatus status)
      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

      protected void onViewUpdatedTitle​(BridgeView view, java.lang.String title)
      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

      protected abstract void onViewDidReceiveError​(BridgeView view, ViewError error)
      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

      protected void onViewCustomEvent​(BridgeView view, java.lang.String name, java.lang.Object data)
      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 event
      data - Payload sent with the event. Type will match return-type of org.json.JSONObject.opt, i.e. JSONObject, JSONArray, String, Double, Boolean or null.