public abstract class

SCBaseFragment

extends Fragment
implements IFragmentCommunication IControllerRequestListener
java.lang.Object
   ↳ android.app.Fragment
     ↳ com.c2call.sdk.pub.fragments.core.SCBaseFragment<T extends com.c2call.sdk.pub.gui.core.controller.IController, Callbacks extends com.c2call.sdk.pub.fragments.core.IFragmentCallbacks>
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

This is the base class of all Fragments that are controlled by an IController, like most Fragments of the C2Call SDK

Summary

[Expand]
Inherited Constants
From interface android.content.ComponentCallbacks2
Public Constructors
SCBaseFragment()
SCBaseFragment(Class<Callbacks> callbacksClass)
Public Methods
Callbacks getCallbacks()
Gets the callbacks.
T getController()
Gets the controller.
String getExtraTag()
static int getId(String name)
Convenience method that dynamically gets the ID of a resource
void onActivityCreated(Bundle savedInstanceState)
void onActivityResult(int requestCode, int resultCode, Intent data)
void onAttach(Activity activity)
boolean onBackPressed()
Notify the fragment that the back button was pressed
void onConfigurationChanged(Configuration newConfig)
void onControllerEvent(SCBaseControllerEvent event)
void onCreate(Bundle savedInstanceState)
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void onDestroy()
void onResume()
Protected Methods
int getDefaultLayout()
If no layout was passed by intent (key: EXTRA_DATA_LAYOUT) then this layout will be used as default
boolean hasOptionsMenu()
void onBindCommunication(Callbacks callbacks)
void onControllerPostCreate(T controller)
void onControllerPreCreate(T controller)
IFragmentCommunication onCreateCommunication()
Called to create a communication object for this Fragment
abstract T onCreateController(View v, SCViewDescription vd)
Called in onActivityCreated(Bundle) to create a IController for this fragment
SCActivityResultDispatcher onCreateResultDispactcher()
Creates a SCActivityResultDispatcher that will be set in the IController of this fragment
abstract SCViewDescription onCreateViewDescription()
Create a SCViewDescription that is used in onCreateController(View, SCViewDescription) to create a new Controller
[Expand]
Inherited Methods
From class android.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.content.ComponentCallbacks2
From interface android.view.View.OnCreateContextMenuListener
From interface com.c2call.sdk.pub.fragments.communication.IFragmentCommunication
From interface com.c2call.sdk.pub.gui.core.controller.IControllerRequestListener

Public Constructors

public SCBaseFragment ()

public SCBaseFragment (Class<Callbacks> callbacksClass)

Public Methods

public Callbacks getCallbacks ()

Gets the callbacks.

Returns
  • the callbacks

public T getController ()

Gets the controller.

Returns
  • the controller

public String getExtraTag ()

Returns

public static int getId (String name)

Convenience method that dynamically gets the ID of a resource

Parameters
name the name of the ID
Returns
  • the ID

public void onActivityCreated (Bundle savedInstanceState)

public void onActivityResult (int requestCode, int resultCode, Intent data)

public void onAttach (Activity activity)

public boolean onBackPressed ()

Notify the fragment that the back button was pressed

Returns
  • true if the event was consumed.

public void onConfigurationChanged (Configuration newConfig)

public void onControllerEvent (SCBaseControllerEvent event)

public void onCreate (Bundle savedInstanceState)

public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

public void onDestroy ()

public void onResume ()

Protected Methods

protected int getDefaultLayout ()

If no layout was passed by intent (key: EXTRA_DATA_LAYOUT) then this layout will be used as default

Returns
  • the default layout for this fragment

protected boolean hasOptionsMenu ()

protected void onBindCommunication (Callbacks callbacks)

protected void onControllerPostCreate (T controller)

Parameters
controller the Controller

protected void onControllerPreCreate (T controller)

Parameters
controller the Controller

protected IFragmentCommunication onCreateCommunication ()

Called to create a communication object for this Fragment

Returns

protected abstract T onCreateController (View v, SCViewDescription vd)

Called in onActivityCreated(Bundle) to create a IController for this fragment

Parameters
v the view that is needed to create the controller. This is the result of onCreateView(LayoutInflater, ViewGroup, Bundle)
vd the view that is needed to create the contrller
Returns
  • the controller that will control this Fragment

protected SCActivityResultDispatcher onCreateResultDispactcher ()

Creates a SCActivityResultDispatcher that will be set in the IController of this fragment

Returns
  • a result dispatcher

protected abstract SCViewDescription onCreateViewDescription ()

Create a SCViewDescription that is used in onCreateController(View, SCViewDescription) to create a new Controller

Returns