fm.liveswitch.android.LayoutManager Class Reference

A layout manager for Android. More...

Public Member Functions

 LayoutManager (ViewGroup container)
 Initializes a new instance of the LayoutManager class. More...
 
 LayoutManager (ViewGroup container, LayoutPreset preset)
 Initializes a new instance of the LayoutManager class. More...
 
ViewGroup getContainer ()
 Gets the layout container. More...
 
void setMode (LayoutMode value)
 Gets or sets the mode used by the layout engine. Defaults to LayoutMode.FloatLocal. More...
 
void layout ()
 Positions the local and remote views within the layout. More...
 
- Public Member Functions inherited from fm.liveswitch.LayoutManager< View >
void addOnLayout (fm.liveswitch.IAction1< fm.liveswitch.Layout > value)
 Adds a handler that is raised when a layout is calculated. More...
 
boolean addRemoteMedia (fm.liveswitch.IViewableMedia< T > remoteMedia)
 Adds remote media to the layout. More...
 
boolean addRemoteView (String idValue, T view)
 Adds a remote view to the layout. More...
 
boolean addRemoteViews (String[] ids, T[] views)
 Adds remote views to the layout. More...
 
fm.liveswitch.LayoutOrigin getLayoutOrigin ()
 Gets the layout origin. More...
 
getLocalView ()
 Gets the local view from the layout. More...
 
getRemoteView (String idValue)
 Gets a remote view from the layout. More...
 
String[] getRemoteViewIds ()
 Gets the IDs of the remote views in the layout. More...
 
java.util.ArrayList< T > getRemoteViews ()
 Gets all remote views from the layout. More...
 
java.util.ArrayList< T > getRemoteViews (String[] ids)
 Gets remote views from the layout. More...
 
abstract void layout ()
 Positions the local and remote views within the layout. More...
 
 LayoutManager ()
 Initializes a new instance of the fm.liveswitch.LayoutManager class. More...
 
 LayoutManager (fm.liveswitch.LayoutPreset preset)
 Initializes a new instance of the fm.liveswitch.LayoutManager class. More...
 
void layoutOnMainThread ()
 Positions the local and remote views within the layout after dispatching to the main thread. More...
 
void removeOnLayout (fm.liveswitch.IAction1< fm.liveswitch.Layout > value)
 Removes a handler that is raised when a layout is calculated. More...
 
boolean removeRemoteMedia (fm.liveswitch.IViewableMedia< T > remoteMedia)
 Removes remote media from the layout. More...
 
boolean removeRemoteView (String idValue)
 Removes a remote view from the layout. More...
 
void removeRemoteViews ()
 Removes all remote views from the layout. More...
 
boolean removeRemoteViews (String[] ids)
 Removes remote views from the layout. More...
 
void reset ()
 Removes all remote views from the layout, then removes the local view from the layout. More...
 
boolean setLocalMedia (fm.liveswitch.IViewableMedia< T > localMedia)
 Adds the local media to the layout. More...
 
boolean setLocalView (T view)
 Adds the local view to the layout. More...
 
boolean swapRemoteMedia (fm.liveswitch.IViewableMedia< T > remoteMediaToRemove, fm.liveswitch.IViewableMedia< T > remoteMediaToAdd)
 Swaps remote media in the layout. More...
 
boolean swapRemoteView (String idToRemove, String idToAdd, T viewToAdd)
 Swaps a remote view in the layout. More...
 
boolean swapRemoteViews (String[] idsToRemove, String[] idsToAdd, T[] viewsToAdd)
 Swaps remote views in the layout. More...
 
boolean unsetLocalView ()
 Removes the local view from the layout. More...
 

Protected Member Functions

void addView (View view)
 Adds a view to the container. More...
 
void removeView (View view)
 Removes a view from the container. More...
 
void dispatchToMainThread (final IAction2< Object, Object > action, final Object arg1, final Object arg2)
 Dispatches an action to the main thread. More...
 
void initializeOnGlobalLayout ()
 Attempts to initialize the layout using the global layout listener until successful. More...
 
boolean initializeLayout ()
 Initializes the layout. More...
 
- Protected Member Functions inherited from fm.liveswitch.LayoutManager< View >
abstract void addView (T view)
 Adds a view to the container. More...
 
abstract void dispatchToMainThread (fm.liveswitch.IAction2< Object, Object > action, Object arg1, Object arg2)
 Dispatches an action to the main thread. More...
 
doGetLocalView ()
 Gets the local view. More...
 
java.util.ArrayList< T > doGetRemoteViews (String idValue)
 Gets the remote views for a given remote view ID. More...
 
String[] doGetRemoteViewsIds ()
 Gets the remote view IDs. More...
 
fm.liveswitch.Layout getLayout (int layoutWidth, int layoutHeight, boolean local, int remoteCount)
 Gets a video frame layout. More...
 
fm.liveswitch.Layout getLayout (int layoutWidth, int layoutHeight, boolean local, int remoteCount, String[] remoteViewIds)
 Gets a video frame layout. More...
 
fm.liveswitch.Layout getLayout (int layoutWidth, int layoutHeight, boolean local, int remoteCount, String[] remoteViewIds, fm.liveswitch.Size localVideoSize, fm.liveswitch.Size[] remoteVideoSizes)
 Gets a video frame layout. More...
 
fm.liveswitch.Layout getLayout (int layoutWidth, int layoutHeight, int remoteCount)
 Gets a video frame layout. More...
 
fm.liveswitch.Layout getLayout (int layoutWidth, int layoutHeight, int remoteCount, String[] remoteViewIds)
 Gets a video frame layout. More...
 
abstract void removeView (T view)
 Removes a view from the container. More...
 
void setLayoutOrigin (fm.liveswitch.LayoutOrigin value)
 Sets the layout origin. More...
 

Detailed Description

A layout manager for Android.

Constructor & Destructor Documentation

◆ LayoutManager() [1/2]

fm.liveswitch.android.LayoutManager.LayoutManager ( ViewGroup  container)

Initializes a new instance of the LayoutManager class.

Parameters
containerThe layout container.

◆ LayoutManager() [2/2]

fm.liveswitch.android.LayoutManager.LayoutManager ( ViewGroup  container,
LayoutPreset  preset 
)

Initializes a new instance of the LayoutManager class.

Parameters
containerThe layout container.
presetThe layout preset.

Member Function Documentation

◆ addView()

void fm.liveswitch.android.LayoutManager.addView ( View  view)
protected

Adds a view to the container.

Parameters
viewThe view to add.

◆ dispatchToMainThread()

void fm.liveswitch.android.LayoutManager.dispatchToMainThread ( final IAction2< Object, Object >  action,
final Object  arg1,
final Object  arg2 
)
protected

Dispatches an action to the main thread.

Parameters
actionThe action to invoke.
arg1The first argument.
arg2The second argument.

◆ getContainer()

ViewGroup fm.liveswitch.android.LayoutManager.getContainer ( )

Gets the layout container.

◆ initializeLayout()

boolean fm.liveswitch.android.LayoutManager.initializeLayout ( )
protected

Initializes the layout.

Returns

◆ initializeOnGlobalLayout()

void fm.liveswitch.android.LayoutManager.initializeOnGlobalLayout ( )
protected

Attempts to initialize the layout using the global layout listener until successful.

◆ layout()

void fm.liveswitch.android.LayoutManager.layout ( )

Positions the local and remote views within the layout.

◆ removeView()

void fm.liveswitch.android.LayoutManager.removeView ( View  view)
protected

Removes a view from the container.

Parameters
viewThe view to remove.

◆ setMode()

void fm.liveswitch.android.LayoutManager.setMode ( LayoutMode  value)

Gets or sets the mode used by the layout engine. Defaults to LayoutMode.FloatLocal.