Friday, April 8, 2011

Window

Abstract base class for a top-level window look and behavior policy. An instance of this class should be used as the top-level view added to the window manager. It provides standard UI policies such as a background, title area, default key processing, etc.
The only existing implementation of this abstract class is android.policy.PhoneWindow, which you should instantiate when needing a Window. Eventually that class will be refactored and a factory method added for creating Window instances without knowing about a particular implementation.

Summary

Nested Classes
interfaceWindow.CallbackAPI from a Window back to its caller. 
Constants
intDEFAULT_FEATURESThe default features enabled
intFEATURE_ACTION_BARFlag for enabling the Action Bar.
intFEATURE_ACTION_BAR_OVERLAYFlag for requesting an Action Bar that overlays window content.
intFEATURE_ACTION_MODE_OVERLAYFlag for specifying the behavior of action modes when an Action Bar is not present.
intFEATURE_CONTEXT_MENUFlag for the context menu.
intFEATURE_CUSTOM_TITLEFlag for custom title.
intFEATURE_INDETERMINATE_PROGRESSFlag for indeterminate progress
intFEATURE_LEFT_ICONFlag for having an icon on the left side of the title bar
intFEATURE_NO_TITLEFlag for the "no title" feature, turning off the title at the top of the screen.
intFEATURE_OPTIONS_PANELFlag for the "options panel" feature.
intFEATURE_PROGRESSFlag for the progress indicator feature
intFEATURE_RIGHT_ICONFlag for having an icon on the right side of the title bar
intID_ANDROID_CONTENTThe ID that the main layout in the XML layout file should have.
intPROGRESS_ENDEnding value for the (primary) progress
intPROGRESS_INDETERMINATE_OFFFlag for setting the progress bar's indeterminate mode off
intPROGRESS_INDETERMINATE_ONFlag for setting the progress bar's indeterminate mode on
intPROGRESS_SECONDARY_ENDHighest possible value for the secondary progress
intPROGRESS_SECONDARY_STARTLowest possible value for the secondary progress
intPROGRESS_STARTStarting value for the (primary) progress
intPROGRESS_VISIBILITY_OFFFlag for setting the progress bar's visibility to GONE
intPROGRESS_VISIBILITY_ONFlag for setting the progress bar's visibility to VISIBLE
Public Constructors
Window(Context context)
Public Methods
abstract voidaddContentView(View view, ViewGroup.LayoutParams params)
Variation on setContentView(View, android.view.ViewGroup.LayoutParams) to add an additional content view to the screen.
voidaddFlags(int flags)
Convenience function to set the flag bits as specified in flags, as per setFlags(int, int).
voidclearFlags(int flags)
Convenience function to clear the flag bits as specified in flags, as per setFlags(int, int).
abstract voidcloseAllPanels()
abstract voidclosePanel(int featureId)
ViewfindViewById(int id)
Finds a view that was identified by the id attribute from the XML that was processed in onCreate(Bundle).
final WindowManager.LayoutParamsgetAttributes()
Retrieve the current window attributes associated with this panel.
final Window.CallbackgetCallback()
Return the current Callback interface for this window.
final WindowgetContainer()
Return the container for this Window.
final ContextgetContext()
Return the Context this window policy is running in, for retrieving resources and other information.
abstract ViewgetCurrentFocus()
Return the view in this Window that currently has focus, or null if there are none.
abstract ViewgetDecorView()
Retrieve the top-level window decor view (containing the standard window frame/decorations and the client's content inside of that), which can be added as a window to the window manager.
abstract LayoutInflatergetLayoutInflater()
Quick access to the LayoutInflater instance that this Window retrieved from its Context.
abstract intgetVolumeControlStream()
WindowManagergetWindowManager()
Return the window manager allowing this Window to display its own windows.
final TypedArraygetWindowStyle()
Return the Window attributes from this window's theme.
final booleanhasChildren()
booleanhasFeature(int feature)
Query for the availability of a certain feature.
abstract voidinvalidatePanelMenu(int featureId)
final booleanisActive()
abstract booleanisFloating()
Return whether this window is being displayed with a floating style (based on the windowIsFloatingattribute in the style/theme).
abstract booleanisShortcutKey(int keyCode, KeyEvent event)
Is a keypress one of the defined shortcut keys for this window.
final voidmakeActive()
abstract voidonConfigurationChanged(Configuration newConfig)
Should be called when the configuration is changed.
abstract voidopenPanel(int featureId, KeyEvent event)
abstract ViewpeekDecorView()
Retrieve the current decor view, but only if it has already been created; otherwise returns null.
abstract booleanperformContextMenuIdentifierAction(int id, int flags)
abstract booleanperformPanelIdentifierAction(int featureId, int id, int flags)
abstract booleanperformPanelShortcut(int featureId, int keyCode, KeyEvent event, int flags)
booleanrequestFeature(int featureId)
Enable extended screen features.
abstract voidrestoreHierarchyState(Bundle savedInstanceState)
abstract BundlesaveHierarchyState()
voidsetAttributes(WindowManager.LayoutParams a)
Specify custom window attributes.
abstract voidsetBackgroundDrawable(Drawable drawable)
Change the background of this window to a custom Drawable.
voidsetBackgroundDrawableResource(int resid)
Change the background of this window to a Drawable resource.
voidsetCallback(Window.Callback callback)
Set the Callback interface for this window, used to intercept key events and other dynamic operations in the window.
abstract voidsetChildDrawable(int featureId, Drawable drawable)
abstract voidsetChildInt(int featureId, int value)
voidsetContainer(Window container)
Set the container for this window.
abstract voidsetContentView(View view)
Convenience for setContentView(View, android.view.ViewGroup.LayoutParams) set the screen content to an explicit view.
abstract voidsetContentView(int layoutResID)
Convenience for setContentView(View, android.view.ViewGroup.LayoutParams) to set the screen content from a layout resource.
abstract voidsetContentView(View view, ViewGroup.LayoutParams params)
Set the screen content to an explicit view.
abstract voidsetFeatureDrawable(int featureId, Drawable drawable)
Set an explicit Drawable value for feature of this window.
abstract voidsetFeatureDrawableAlpha(int featureId, int alpha)
Set a custom alpha value for the given drawale feature, controlling how much the background is visible through it.
abstract voidsetFeatureDrawableResource(int featureId, int resId)
Set the value for a drawable feature of this window, from a resource identifier.
abstract voidsetFeatureDrawableUri(int featureId, Uri uri)
Set the value for a drawable feature of this window, from a URI.
abstract voidsetFeatureInt(int featureId, int value)
Set the integer value for a feature.
voidsetFlags(int flags, int mask)
Set the flags of the window, as per the WindowManager.LayoutParams flags.
voidsetFormat(int format)
Set the format of window, as per the PixelFormat types.
voidsetGravity(int gravity)
Set the gravity of the window, as per the Gravity constants.
voidsetLayout(int width, int height)
Set the width and height layout parameters of the window.
voidsetSoftInputMode(int mode)
Specify an explicit soft input mode to use for the window, as perWindowManager.LayoutParams.softInputMode.
abstract voidsetTitle(CharSequence title)
abstract voidsetTitleColor(int textColor)
voidsetType(int type)
Set the type of the window, as per the WindowManager.LayoutParams types.
abstract voidsetVolumeControlStream(int streamType)
voidsetWindowAnimations(int resId)
Specify custom animations to use for the window, as perWindowManager.LayoutParams.windowAnimations.
voidsetWindowManager(WindowManager wm, IBinder appToken, String appName, boolean hardwareAccelerated)
Set the window manager for use by this Window to, for example, display panels.
voidsetWindowManager(WindowManager wm, IBinder appToken, String appName)
Set the window manager for use by this Window to, for example, display panels.
abstract booleansuperDispatchKeyEvent(KeyEvent event)
Used by custom windows, such as Dialog, to pass the key press event further down the view hierarchy.
abstract booleansuperDispatchKeyShortcutEvent(KeyEvent event)
Used by custom windows, such as Dialog, to pass the key shortcut press event further down the view hierarchy.
abstract booleansuperDispatchTouchEvent(MotionEvent event)
Used by custom windows, such as Dialog, to pass the touch screen event further down the view hierarchy.
abstract booleansuperDispatchTrackballEvent(MotionEvent event)
Used by custom windows, such as Dialog, to pass the trackball event further down the view hierarchy.
abstract voidtakeInputQueue(InputQueue.Callback callback)
Take ownership of this window's InputQueue.
abstract voidtakeKeyEvents(boolean get)
Request that key events come to this activity.
abstract voidtakeSurface(SurfaceHolder.Callback2 callback)
Take ownership of this window's surface.
abstract voidtogglePanel(int featureId, KeyEvent event)
Protected Methods
final intgetFeatures()
Return the feature bits that are enabled.
final intgetForcedWindowFlags()
Return the window flags that have been explicitly set by the client, so will not be modified bygetDecorView().
final intgetLocalFeatures()
Return the feature bits that are being implemented by this Window.
final booleanhasSoftInputMode()
Has the app specified their own soft input mode?
abstract voidonActive()
voidsetDefaultWindowFormat(int format)
Set the default format of window, as per the PixelFormat types.
[Expand]
Inherited Methods
 From class java.lang.Object


No comments:

Post a Comment