com.sony.smallapp
Class SmallAppWindow

java.lang.Object
  extended by com.sony.smallapp.SmallAppWindow

public class SmallAppWindow
extends java.lang.Object

SmallAppWindow represents the window which renders the Small App content. It provides UI components such as a background, title area, drag handler, resize handler, close button, etc.

The SmallAppWindow instance is created automatically for the Small App, and you can access the SmallAppWindow instance associated to your Small App using SmallApplication.getWindow().


Nested Class Summary
static class SmallAppWindow.Attributes
          Attributes of a window.
static interface SmallAppWindow.OnWindowFocusChangeListener
          Interface definition for a callback to be invoked when the window focus is changed.
static interface SmallAppWindow.OnWindowStateChangeListener
          Interface definition for a callback to be invoked when the state of a window is changed.
static class SmallAppWindow.WindowState
          A state of a window.
 
Method Summary
 SmallAppWindow.Attributes getAttributes()
          Retrieve attributes for this window.
 SmallAppWindow.WindowState getWindowState()
          Get a current window state.
 void setAttributes(SmallAppWindow.Attributes attr)
          Set attributes to this window.
 void setBackgroundDrawable(android.graphics.drawable.Drawable drawable)
          Change the background of this window to a custom Drawable.
 void setHeaderView(android.view.View view)
          Set the view such as option menus to header area.
 void setOnWindowFocusChangeListener(SmallAppWindow.OnWindowFocusChangeListener l)
          Register a callback to be invoked when the window focus is changed.
 void setOnWindowStateChangeListener(SmallAppWindow.OnWindowStateChangeListener l)
          Register a callback to be invoked when the state of a window is changed.
 void setSoftInputMode(int mode)
          Apply the soft input mode, as per android.view.WindowManager.LayoutParams.softInputMode.
 void setWindowState(SmallAppWindow.WindowState state)
          Change a window state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAttributes

public final SmallAppWindow.Attributes getAttributes()
Retrieve attributes for this window.

Returns:
Attributes for this window.

setAttributes

public void setAttributes(SmallAppWindow.Attributes attr)
Set attributes to this window.

Parameters:
attr - Attributes.

setSoftInputMode

public void setSoftInputMode(int mode)
Apply the soft input mode, as per android.view.WindowManager.LayoutParams.softInputMode.

Parameters:
mode - Mode specifying soft input mode for this window, as per android.view.WindowManager.LayoutParams.softInputMode.

setHeaderView

public void setHeaderView(android.view.View view)
Set the view such as option menus to header area.

Parameters:
view - The desired view.

setBackgroundDrawable

public void setBackgroundDrawable(android.graphics.drawable.Drawable drawable)
Change the background of this window to a custom Drawable. The padding value of the Drawable is used to determine where the content view specified by {link SmallApplication#setContentView(int) should be placed.

Parameters:
drawable - The new window background.

setOnWindowFocusChangeListener

public void setOnWindowFocusChangeListener(SmallAppWindow.OnWindowFocusChangeListener l)
Register a callback to be invoked when the window focus is changed.

Parameters:
l - The callback that will run

setOnWindowStateChangeListener

public void setOnWindowStateChangeListener(SmallAppWindow.OnWindowStateChangeListener l)
Register a callback to be invoked when the state of a window is changed.

Parameters:
l - The callback that will run

setWindowState

public void setWindowState(SmallAppWindow.WindowState state)
Change a window state.

Parameters:
state - A state to be set

getWindowState

public final SmallAppWindow.WindowState getWindowState()
Get a current window state.

Returns:
Current window state