public abstract class

SplitScreen

extends Screen
java.lang.Object
   ↳ com.neomades.app.Screen
     ↳ com.neomades.app.SplitScreen

Class Overview

The SplitScreen class is a screen that manages the presentation of two side-by-side Screen. You use this class to implement a master-detail user interface for tablets devices, in which the left-side Screen presents a Screen and the right-side presents details of the selected item with another Screen.

Important: A SplitScreen should be the first Screen pushed by an Application.

The SplitScreen has no significant actions to do. Its job is to manager two side with two different screens. The master (left-side) screen could update the details (right-side) screen.

A typical implementation of SplitScreen could be:

 public class MySplitScreen extends SplitScreen {
 
 	public void onCreate() {
 		// list of items
 		setMasterScreen(MyListScreen.class);
 
 		// optional : the details screen could be blank
 		// here, we push a details screen for the first item from the master
 		// screen
 		setDetailsScreen(MyDetailsScreen.class, new ScreenParam().putInt("itemIndex", 0));
 	}
 
 }
 

Phone compatibility

If you use a SplitScreen on a phone, only the Master Screen is shown. When a Screen is pushed by the controller inside the Master Screen, then the Details Screen is pushed into the navigation Stack. The end-user could navigate between master and details thanks to navigation stack. To be sure having this behaviour, The main screen should prefer using pushScreen(Class) instead of other navigation stack actions.

Orientation changes behaviors

By default, both Screen are displayed in landscape orientation but only the detail view controller is displayed in portrait orientations. In portrait orientations, the master view controller can be displayed in a 'popup' way from a button.

Summary

[Expand]
Inherited Constants
From class com.neomades.app.Screen
From interface com.neomades.app.Keys
From interface com.neomades.app.Orientation
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
[Expand]
Inherited Fields
From class com.neomades.app.Screen
Public Constructors
SplitScreen()
Protected Methods
Screen getDetailsScreen()
Screen getMasterScreen()
void setDetailsScreen(Class screen, ScreenParams params)
Set the Right-side panel screen with extra information.
void setDetailsScreen(Class screen)
Set the Right-side panel screen.
void setMasterScreen(Class screen)
Set the Left-side panel screen.
void setMasterScreen(Class screen, ScreenParams screenParams)
Set the Left-side panel screen.
void setMasterScreenWidth(int widthInDp)
Sets the master screen with in DP units.
void setSlidingMasterScreen(boolean enabled)
Sets the Master-Screen sliding enabled or not in portrait mode for android tablets.
[Expand]
Inherited Methods
From class com.neomades.app.Screen
From class java.lang.Object

Public Constructors

public SplitScreen ()

Protected Methods

protected Screen getDetailsScreen ()

Returns
  • the current details screen or null

protected Screen getMasterScreen ()

Returns
  • the current master screen or null

protected void setDetailsScreen (Class screen, ScreenParams params)

Set the Right-side panel screen with extra information.

Parameters
screen screen type to create into the right-side.
params extra information to give to the screen
Throws
IllegalArgumentException if screen parameter is SplitScreen or TabScreen or does not inherit from Screen
NullPointerException if screen is null

protected void setDetailsScreen (Class screen)

Set the Right-side panel screen.

Parameters
screen screen type to create into the right-side.
Throws
IllegalArgumentException if screen parameter is SplitScreen or TabScreen or does not inherit from Screen
NullPointerException if screen is null

protected void setMasterScreen (Class screen)

Set the Left-side panel screen.

Parameters
screen screen type to create into the left-side.
Throws
IllegalArgumentException if screen parameter is SplitScreen or TabScreen or does not inherit from Screen
NullPointerException if screen is null

protected void setMasterScreen (Class screen, ScreenParams screenParams)

Set the Left-side panel screen.

Parameters
screen screen type to create into the left-side.
screenParams parameters to push to the master screen
Throws
IllegalArgumentException if screen parameter is SplitScreen or TabScreen or does not inherit from Screen
NullPointerException if screen is null

protected void setMasterScreenWidth (int widthInDp)

Sets the master screen with in DP units.

Cross Platform Considerations

Only supported by Android tablets.

Parameters
widthInDp the master screen width

protected void setSlidingMasterScreen (boolean enabled)

Sets the Master-Screen sliding enabled or not in portrait mode for android tablets.

Cross Platform Considerations

Only supported by Android tablets.

Throws
IllegalStateException if this method has been called outside onCreate() and after setMasterScreen(Class) or setDetailsScreen(Class)