public abstract class

BaseUIComponent

extends Object
java.lang.Object
   ↳ com.pdftron.collab.ui.base.component.BaseUIComponent<V extends com.pdftron.collab.ui.base.component.BaseUIView<E extends com.pdftron.collab.ui.base.component.BaseUIEvent>, E, VM extends ViewModel>
Known Direct Subclasses

Class Overview

A BaseUIComponent describes a UI component on the screen, which could be a part of an activity or fragment (basically anything that is a LifecycleOwner. The main responsibility of the BaseUIComponent is to define the business logic of its views and maintain the data associated with the views.

The data for BaseUIComponent is contained within a ViewModel object. Updates to the data can be observed directly by the BaseUIComponent, or by the caller if needed (usually a Fragment or an android.app.Activity).

Android views are handled by a BaseUIView object. The only responsibilities of this object are to inflate the views and to emit user interaction events to the component. User interaction is captured through BaseUIEvents and these events can be observed directly by the BaseUIComponent, or by the caller.

Summary

Public Constructors
BaseUIComponent(ViewGroup parent, LifecycleOwner lifecycleOwner, VM model, observable)
Constructor for creating a UI component.
Public Methods
final getObservable()
Returns the Observable that emits user events BaseUIEvent of type E.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BaseUIComponent (ViewGroup parent, LifecycleOwner lifecycleOwner, VM model, observable)

Constructor for creating a UI component.

Parameters
parent the ViewGroup to inflate this component's UI
lifecycleOwner the LifecycleOwner that uses this component
model the ViewModel that contains the view state data for this component
observable the observable that will be used to emit user UI interfaction events

Public Methods

public final getObservable ()

Returns the Observable that emits user events BaseUIEvent of type E. This is typically called outside of the component, by Fragments or Activities that would like to listen to user events.

Returns
  • the observable that is used to listen BaseUIEvents