public abstract class

SlideScreen

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

Class Overview

The SlideScreen is a screen that manages the presentation of three side-by-side Screen. The left screen and the right screen are slideable and are hidden at the presentation of the slide screen.

You use this class to implement a Screen with sliding menu user interface.

A typical implementation of SlideScreen could be:

 public class MySLideScreen extends SlideScreen {
 
 	public void onCreate() {
 		// content
 		setMiddleScreen(MyContentScreen.class);
 
 		// A sliding menu will be displayed on the left part
 		setLeftScreen(MySlidingMenuScreen.class);
 	}
 
 }
 

SlideScreen Life cycle

As SlideScreen is a Screen, the same lifecyle applies. Some rules exist for the SlideScreen's sub-screens:
  • When a SlideScreen is resumed, all the sub-screens are resumed,
  • When a SlideScreen is paused, all the sub-screens are paused,
  • When a SlideScreen is destroyed, all the sub-screens are destroyed.
Opening or closing a panel of the SlideScreen does not have any effect on sub-screens lifecycle.

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
SlideScreen()
Public Methods
boolean isLeftScreenOpened()
Checks if the left sliding pane is opened or not.
boolean isRightScreenOpened()
Checks if the right sliding pane is opened or not.
void setLeftScreenOpened(boolean opened)
Programmatically opens or closes the left pane.
void setLeftScreenWidth(int width)
Forces a width for the left pane.
void setLeftSlidingTouchEnabled(boolean enabled)
Activates or deactivates the opening of the left panel by dragging the screen.
void setRightScreenOpened(boolean opened)
Programmatically opens or closes the right pane.
void setRightScreenWidth(int width)
Forces a width for the right pane.
Protected Methods
void onLeftScreenClosed()
Called when the left screen is closed.
void onLeftScreenOpened()
Called when the left screen is opened.
void onRightScreenClosed()
Called when the right screen is closed.
void onRightScreenOpened()
Called when the right screen is opened.
void setContent(View content)
Do not use this method: to set the middle content of a SlideScreen, use setMiddleScreen(Class).
void setContent(int layoutResId)
Do not use this method: to set the middle content of a SlideScreen, use setMiddleScreen(Class).
void setLeftScreen(Class screen)
Sets the left sliding pane screen.
void setLeftScreen(Class screen, ScreenParams params)
Sets the left sliding pane screen with screen parameters.
void setLeftShadowEnabled(boolean enabled)
Enables or not the shadow over the middle screen when the left screen is opened.
void setLeftSlidingTouchAreaWidth(int width)
Sets the area width where the SlideScreen's left screen can be dragged.
void setMiddleScreen(Class screen, ScreenParams params)
Sets the middle screen (main screen) of this SlideScreen with screen parameters.
void setMiddleScreen(Class screen)
Sets the middle screen (main screen) of this SlideScreen.
void setRightContentSlidingEnabled(boolean enabled)
Enables or disables the middle content sliding effect when the right panel is sliding.
void setRightScreen(Class screen)
Sets the right sliding pane screen.
void setRightScreen(Class screen, ScreenParams params)
Sets the right sliding pane screen with screen parameters.
void setRightShadowEnabled(boolean enabled)
Enables or not the shadow over the middle screen when the right screen is opened.
[Expand]
Inherited Methods
From class com.neomades.app.Screen
From class java.lang.Object

Public Constructors

public SlideScreen ()

Public Methods

public boolean isLeftScreenOpened ()

Checks if the left sliding pane is opened or not.

Returns
  • true if the left sliding pane is opened

public boolean isRightScreenOpened ()

Checks if the right sliding pane is opened or not.

Returns
  • true if the right sliding pane is opened

public void setLeftScreenOpened (boolean opened)

Programmatically opens or closes the left pane.

Parameters
opened true to open the sliding left pane

public void setLeftScreenWidth (int width)

Forces a width for the left pane. Negative values are ignored (default width is used).

Parameters
width width in DP units

public void setLeftSlidingTouchEnabled (boolean enabled)

Activates or deactivates the opening of the left panel by dragging the screen. By default it is activated.

Parameters
enabled true to enable (default value)

public void setRightScreenOpened (boolean opened)

Programmatically opens or closes the right pane.

Parameters
opened true to open the sliding right pane

public void setRightScreenWidth (int width)

Forces a width for the right pane. Negative values are ignored (default width is used).

Parameters
width width in DP units

Protected Methods

protected void onLeftScreenClosed ()

Called when the left screen is closed. Override this method to add custom actions when the left screen has just closed.

protected void onLeftScreenOpened ()

Called when the left screen is opened. Override this method to add custom actions when the left screen has just opened.

protected void onRightScreenClosed ()

Called when the right screen is closed. Override this method to add custom actions when the right screen has just closed.

protected void onRightScreenOpened ()

Called when the right screen is opened. Override this method to add custom actions when the right screen has just opened.

protected void setContent (View content)

Do not use this method: to set the middle content of a SlideScreen, use setMiddleScreen(Class).

An IllegalStateException will be thrown if this method is called for a SlideScreen.

Parameters
content the content of this screen

protected void setContent (int layoutResId)

Do not use this method: to set the middle content of a SlideScreen, use setMiddleScreen(Class).

An IllegalStateException will be thrown if this method is called for a SlideScreen.

Parameters
layoutResId Resources ID of the XML layout

protected void setLeftScreen (Class screen)

Sets the left sliding pane screen.

Parameters
screen the left screen

protected void setLeftScreen (Class screen, ScreenParams params)

Sets the left sliding pane screen with screen parameters.

Parameters
screen the left screen
params screen parameters for the left screen

protected void setLeftShadowEnabled (boolean enabled)

Enables or not the shadow over the middle screen when the left screen is opened. By default the shadow is enabled in Android.

Cross Platform Considerations

In iOS, this method does nothing.

Parameters
enabled true to enable (default value)

protected void setLeftSlidingTouchAreaWidth (int width)

Sets the area width where the SlideScreen's left screen can be dragged.

Cross Platform Considerations

In iOS, there is a minimal width of 50 dp. Inputs below this value are ignored. If the input width is lower, the hardware may not detect the user finger.

In Android, there is a minimal width of 50 dp. Inputs below this value are ignored. If the input width is lower, the hardware may not detect the user finger.

Parameters
width the area width in dp, 0 or negative to use all the available width

protected void setMiddleScreen (Class screen, ScreenParams params)

Sets the middle screen (main screen) of this SlideScreen with screen parameters.

Parameters
screen the middle screen
params screen parameters for the middle screen

protected void setMiddleScreen (Class screen)

Sets the middle screen (main screen) of this SlideScreen.

Parameters
screen the middle screen

protected void setRightContentSlidingEnabled (boolean enabled)

Enables or disables the middle content sliding effect when the right panel is sliding.

If true the middle content will be pushed from right to left by the right panel. Otherwise, the right panel will slide over the middle content.

Cross Platform Considerations

In iOS, this method has no effect. The middle content sliding effect is always enabled.

Parameters
enabled true to enable middle content sliding effect

protected void setRightScreen (Class screen)

Sets the right sliding pane screen.

Parameters
screen the right screen

protected void setRightScreen (Class screen, ScreenParams params)

Sets the right sliding pane screen with screen parameters.

Parameters
screen the right screen
params screen parameters for the right screen

protected void setRightShadowEnabled (boolean enabled)

Enables or not the shadow over the middle screen when the right screen is opened. By default the shadow is enabled in Android.

Cross Platform Considerations

In iOS, this method does nothing.

Parameters
enabled true to enable (default value)