Android Guides | Samples

Android.Views.Window Class

Abstract base class for a top-level window look and behavior policy.

See Also: Window

Syntax

[Android.Runtime.Register("android/view/Window", DoNotGenerateAcw=true)]
public abstract class Window : Object

Remarks

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.view.PhoneWindow, which you should instantiate when needing a Window.

[Android Documentation]

Requirements

Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Views.Window are listed below.

See Also: Object

Public Constructors

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

const
IdAndroidContentInt32 (16908290). The ID that the main layout in the XML layout file should have.
const
NavigationBarBackgroundTransitionNameString. The transitionName for the navigation bar background View when a custom background is used.
const
ProgressEndWindowProgress (10000). Ending value for the (primary) progress
const
ProgressIndeterminateOffWindowProgress (-4). Flag for setting the progress bar's indeterminate mode off
const
ProgressIndeterminateOnWindowProgress (-3). Flag for setting the progress bar's indeterminate mode on
const
ProgressSecondaryEndWindowProgress (30000). Highest possible value for the secondary progress
const
ProgressSecondaryStartWindowProgress (20000). Lowest possible value for the secondary progress
const
ProgressStartWindowProgress (0). Starting value for the (primary) progress
const
ProgressVisibilityOffWindowProgress (-2). Flag for setting the progress bar's visibility to GONE
const
ProgressVisibilityOnWindowProgress (-1). Flag for setting the progress bar's visibility to VISIBLE
const
StatusBarBackgroundTransitionNameString. The transitionName for the status bar background View when a custom background is used.

Public Properties

AllowEnterTransitionOverlapBoolean. Returns how the transition set in Window.EnterTransition overlaps with the exit transition of the calling Activity.
AllowReturnTransitionOverlapBoolean. Returns how the transition set in Window.ExitTransition overlaps with the exit transition of the called Activity when reentering after if finishes.
AttributesWindowManagerLayoutParams. Retrieve the current window attributes associated with this panel.
CallbackWindow+ICallback. Return the current Callback interface for this window.
ContainerWindow. Return the container for this Window.
[read-only]
ContentSceneScene. Retrieve the Scene representing this window's current content.
[read-only]
ContextContext. Return the Context this window policy is running in, for retrieving resources and other information.
[read-only]
abstract
CurrentFocusView. Return the view in this Window that currently has focus, or null if there are none.
[read-only]
abstract
DecorViewView. 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.
EnterTransitionTransition. Returns the transition used to move Views into the initial scene.
ExitTransitionTransition. Returns the Transition that will be used to move Views out of the scene when starting a new Activity.
[read-only]
HasChildrenBoolean.
[read-only]
IsActiveBoolean.
[read-only]
abstract
IsFloatingBoolean. Return whether this window is being displayed with a floating style (based on the NoType:android/R$attr;Href=../../../reference/android/R.attr.html#windowIsFloating attribute in the style/theme).
[read-only]
abstract
LayoutInflaterLayoutInflater. Quick access to the LayoutInflater instance that this Window retrieved from its Context.
MediaControllerMediaController. Gets the MediaController that was previously set.
abstract
NavigationBarColorColor.
ReenterTransitionTransition. Returns the Transition that will be used to move Views in to the scene when returning from a previously-started Activity.
ReturnTransitionTransition. Returns he Transition that will be used to move Views out of the scene when the Window is preparing to close, for example after a call to Activity.FinishAfterTransition.
SharedElementEnterTransitionTransition. Returns the Transition that will be used for shared elements transferred into the content Scene.
SharedElementExitTransitionTransition. Returns the Transition to use for shared elements in the launching Window prior to transferring to the launched Activity's Window.
SharedElementReenterTransitionTransition. Returns the Transition that will be used for shared elements reentering from a started Activity after it has returned the shared element to it start location.
SharedElementReturnTransitionTransition. Returns the Transition that will be used for shared elements transferred back to a calling Activity.
SharedElementsUseOverlayBoolean. Returns true when shared elements should use an Overlay during shared element transitions or false when they should animate as part of the normal View hierarchy.
abstract
StatusBarColorColor.
TransitionBackgroundFadeDurationInt64. Returns the duration, in milliseconds, of the window background fade when transitioning into or away from an Activity when called with an Activity Transition.
TransitionManagerTransitionManager. Retrieve the TransitionManager responsible for for default transitions in this window.
abstract
VolumeControlStreamStream.
[read-only]
WindowManagerIWindowManager. Return the window manager allowing this Window to display its own windows.
[read-only]
WindowStyleTypedArray. Return the NoType:android/R$styleable;Href=../../../reference/android/R.styleable.html#Window attributes from this window's theme.

Protected Properties

[read-only]
FeaturesInt32. Return the feature bits that are enabled.
[read-only]
ForcedWindowFlagsInt32. Return the window flags that have been explicitly set by the client, so will not be modified by Window.DecorView.
[read-only]
HasSoftInputModeBoolean. Has the app specified their own soft input mode?
[read-only]
LocalFeaturesInt32. Return the feature bits that are being implemented by this Window.
[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

abstract
AddContentView(View, ViewGroup+LayoutParams)
Variation on Window.SetContentView(View, .LayoutParams) to add an additional content view to the screen.
AddFlags(WindowManagerFlags)
Convenience function to set the flag bits as specified in flags, as per Window.SetFlags(WindowManagerFlags,WindowManagerFlags).
ClearFlags(WindowManagerFlags)
Convenience function to clear the flag bits as specified in flags, as per Window.SetFlags(WindowManagerFlags,WindowManagerFlags).
abstract
CloseAllPanels()
abstract
ClosePanel(Int32)
FindViewById(Int32) : View
Finds a view that was identified by the id attribute from the XML that was processed in Activity.OnCreate(Bundle).
FindViewById<T>(Int32) : T
HasFeature(WindowFeatures) : Boolean
Query for the availability of a certain feature.
InjectInputEvent(InputEvent)
Inject an event to window locally.
abstract
InvalidatePanelMenu(WindowFeatures)
abstract
IsShortcutKey(Keycode, KeyEvent) : Boolean
Is a keypress one of the defined shortcut keys for this window.
MakeActive()
abstract
OnConfigurationChanged(Configuration)
Should be called when the configuration is changed.
abstract
OpenPanel(Int32, KeyEvent)
abstract
PeekDecorView() : View
Retrieve the current decor view, but only if it has already been created; otherwise returns null.
abstract
PerformContextMenuIdentifierAction(Int32, MenuPerformFlags) : Boolean
abstract
PerformPanelIdentifierAction(Int32, Int32, MenuPerformFlags) : Boolean
abstract
PerformPanelShortcut(Int32, Keycode, KeyEvent, MenuPerformFlags) : Boolean
RequestFeature(WindowFeatures) : Boolean
Enable extended screen features.
abstract
RestoreHierarchyState(Bundle)
abstract
SaveHierarchyState() : Bundle
abstract
SetBackgroundDrawable(Drawable)
Change the background of this window to a custom Drawable.
SetBackgroundDrawableResource(Int32)
Change the background of this window to a Drawable resource.
abstract
SetChildDrawable(Int32, Drawable)
abstract
SetChildInt(Int32, Int32)
abstract
SetContentView(View)
Convenience for Window.SetContentView(View, .LayoutParams) set the screen content to an explicit view.
abstract
SetContentView(Int32)
Convenience for Window.SetContentView(View, .LayoutParams) to set the screen content from a layout resource.
abstract
SetContentView(View, ViewGroup+LayoutParams)
Set the screen content to an explicit view.
SetDimAmount(Single)
Set the amount of dim behind the window when using WindowManagerLayoutParams.FLAG_DIM_BEHIND.
abstract
SetFeatureDrawable(WindowFeatures, Drawable)
Set an explicit Drawable value for feature of this window.
abstract
SetFeatureDrawableAlpha(WindowFeatures, Int32)
Set a custom alpha value for the given drawable feature, controlling how much the background is visible through it.
abstract
SetFeatureDrawableResource(WindowFeatures, Int32)
Set the value for a drawable feature of this window, from a resource identifier.
abstract
SetFeatureDrawableUri(WindowFeatures, Uri)
Set the value for a drawable feature of this window, from a URI.
abstract
SetFeatureInt(WindowFeatures, Int32)
Set the integer value for a feature.
SetFlags(WindowManagerFlags, WindowManagerFlags)
Set the flags of the window, as per the WindowManagerLayoutParams flags.
SetFormat(Format)
Set the format of window, as per the PixelFormat types.
SetGravity(GravityFlags)
Set the gravity of the window, as per the Gravity constants.
SetIcon(Int32)
Set the primary icon for this window.
SetLayout(Int32, Int32)
Set the width and height layout parameters of the window.
SetLocalFocus(Boolean, Boolean)
Set focus locally.
SetLogo(Int32)
Set the logo for this window.
SetSoftInputMode(SoftInput)
Specify an explicit soft input mode to use for the window, as per WindowManagerLayoutParams.SoftInputMode.
abstract
SetTitle(ICharSequence)
SetTitle(String)
abstract
SetTitleColor(Color)
SetType(WindowManagerTypes)
Set the type of the window, as per the WindowManager.
SetUiOptions(UiOptions)
Set extra options that will influence the UI for this window.
SetUiOptions(UiOptions, UiOptions)
Set extra options that will influence the UI for this window.
SetWindowAnimations(Int32)
Specify custom animations to use for the window, as per WindowManagerLayoutParams.WindowAnimations.
SetWindowManager(IWindowManager, IBinder, String)
Set the window manager for use by this Window to, for example, display panels.
SetWindowManager(IWindowManager, IBinder, String, Boolean)
Set the window manager for use by this Window to, for example, display panels.
abstract
SuperDispatchGenericMotionEvent(MotionEvent) : Boolean
Used by custom windows, such as Dialog, to pass the generic motion event further down the view hierarchy.
abstract
SuperDispatchKeyEvent(KeyEvent) : Boolean
Used by custom windows, such as Dialog, to pass the key press event further down the view hierarchy.
abstract
SuperDispatchKeyShortcutEvent(KeyEvent) : Boolean
Used by custom windows, such as Dialog, to pass the key shortcut press event further down the view hierarchy.
abstract
SuperDispatchTouchEvent(MotionEvent) : Boolean
Used by custom windows, such as Dialog, to pass the touch screen event further down the view hierarchy.
abstract
SuperDispatchTrackballEvent(MotionEvent) : Boolean
Used by custom windows, such as Dialog, to pass the trackball event further down the view hierarchy.
abstract
TakeInputQueue(InputQueue+ICallback)
Take ownership of this window's InputQueue.
abstract
TakeKeyEvents(Boolean)
Request that key events come to this activity.
abstract
TakeSurface(ISurfaceHolderCallback2)
Take ownership of this window's surface.
abstract
TogglePanel(Int32, KeyEvent)

Protected Methods

abstract
OnActive()
SetDefaultWindowFormat(Int32)
Set the default format of window, as per the PixelFormat types.