public abstract class

SCBaseFactory

extends Object
implements IControllerRequestListener
java.lang.Object
   ↳ com.c2call.sdk.pub.gui.core.controller.SCBaseFactory<T extends com.c2call.sdk.pub.gui.core.controller.IController>
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Base class of several factories of the C2Call SDK. These factories are typically used to create controlled views within PopupWindows. They take a IControllerFactory in the constructor and bind the created controller to the life-cycle of the Popup.

For example to show a ContactDetail in a Popup you would code something like:

 new SCContactDetailFactory(contact).createPopup(context,
 												layout,
 												anchor,
 												400, LayoutParams.WRAP_CONTENT);
 

Summary

Public Constructors
SCBaseFactory(IControllerFactory<T> controllerFactory)
Instanciates a new SCBaseFactory.
Public Methods
T createController(Activity context, View view)
Creates a Controller
AnchorPopup createPopup(Activity context, int res, View anchor, int w, int h)
Creates a Popup containing a controlled view
AnchorPopup createPopup(Activity context, View view, View anchor, int w, int h)
void onControllerEvent(SCBaseControllerEvent event)
Protected Methods
abstract SCViewDescription onCreateViewDescription()
Called to create a SCViewDescription for the controller.
abstract void onInitController(T controller)
Called after onCreate(Activity, SCActivityResultDispatcher) to furthor initialize the controller
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.c2call.sdk.pub.gui.core.controller.IControllerRequestListener

Public Constructors

public SCBaseFactory (IControllerFactory<T> controllerFactory)

Instanciates a new SCBaseFactory.

Parameters
controllerFactory the factory that is used to create the controller

Public Methods

public T createController (Activity context, View view)

Creates a Controller

Parameters
context the context of the Controller
view the view that will be controlled
Returns
  • the newly created Controller

public AnchorPopup createPopup (Activity context, int res, View anchor, int w, int h)

Creates a Popup containing a controlled view

Parameters
context the Context of the Popup
res the resource id of the layout that will be inflated
anchor the anchor view of the Popup (where it will be shown)
w the desired width of the Popup
h the desired height fo the Popup
Returns
  • return a AnchorPopup with controlled view inside.

public AnchorPopup createPopup (Activity context, View view, View anchor, int w, int h)

public void onControllerEvent (SCBaseControllerEvent event)

Protected Methods

protected abstract SCViewDescription onCreateViewDescription ()

Called to create a SCViewDescription for the controller.

protected abstract void onInitController (T controller)

Called after onCreate(Activity, SCActivityResultDispatcher) to furthor initialize the controller