Methods Summary |
---|
public abstract void | addContentView(View view, ViewGroup.LayoutParams params)Variation on
{@link #setContentView(View, android.view.ViewGroup.LayoutParams)}
to add an additional content view to the screen. Added after any existing
ones in the screen -- existing views are NOT removed.
|
public void | addFlags(int flags)Convenience function to set the flag bits as specified in flags, as
per {@link #setFlags}.
setFlags(flags, flags);
|
public void | clearFlags(int flags)Convenience function to clear the flag bits as specified in flags, as
per {@link #setFlags}.
setFlags(0, flags);
|
public abstract void | closeAllPanels()
|
public abstract void | closePanel(int featureId)
|
public View | findViewById(int id)Finds a view that was identified by the id attribute from the XML that
was processed in {@link android.app.Activity#onCreate}. This will
implicitly call {@link #getDecorView} for you, with all of the
associated side-effects.
return getDecorView().findViewById(id);
|
public final WindowManager.LayoutParams | getAttributes()Retrieve the current window attributes associated with this panel.
return mWindowAttributes;
|
public final android.view.Window$Callback | getCallback()Return the current Callback interface for this window.
return mCallback;
|
public final android.view.Window | getContainer()Return the container for this Window.
return mContainer;
|
public final android.content.Context | getContext()Return the Context this window policy is running in, for retrieving
resources and other information.
return mContext;
|
public abstract View | getCurrentFocus()Return the view in this Window that currently has focus, or null if
there are none. Note that this does not look in any containing
Window.
|
public abstract View | getDecorView()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.
Note that calling this function for the first time "locks in"
various window characteristics as described in
{@link #setContentView(View, android.view.ViewGroup.LayoutParams)}.
|
protected final int | getFeatures()Return the feature bits that are enabled. This is the set of features
that were given to requestFeature(), and are being handled by this
Window itself or its container. That is, it is the set of
requested features that you can actually use.
To do: add a public version of this API that allows you to check for
features by their feature ID.
return mFeatures;
|
protected final int | getForcedWindowFlags()Return the window flags that have been explicitly set by the client,
so will not be modified by {@link #getDecorView}.
return mForcedWindowFlags;
|
public abstract LayoutInflater | getLayoutInflater()Quick access to the {@link LayoutInflater} instance that this Window
retrieved from its Context.
|
protected final int | getLocalFeatures()Return the feature bits that are being implemented by this Window.
This is the set of features that were given to requestFeature(), and are
being handled by only this Window itself, not by its containers.
return mLocalFeatures;
|
public abstract int | getVolumeControlStream()
|
public WindowManager | getWindowManager()Return the window manager allowing this Window to display its own
windows.
return mWindowManager;
|
public final android.content.res.TypedArray | getWindowStyle()Return the {@link android.R.styleable#Window} attributes from this
window's theme.
synchronized (this) {
if (mWindowStyle == null) {
mWindowStyle = mContext.obtainStyledAttributes(
com.android.internal.R.styleable.Window);
}
return mWindowStyle;
}
|
public final boolean | hasChildren()
return mHasChildren;
|
protected final boolean | hasSoftInputMode()Has the app specified their own soft input mode?
return mHasSoftInputMode;
|
public final boolean | isActive()
return mIsActive;
|
public abstract boolean | isFloating()Return whether this window is being displayed with a floating style
(based on the {@link android.R.attr#windowIsFloating} attribute in
the style/theme).
|
public abstract boolean | isShortcutKey(int keyCode, KeyEvent event)Is a keypress one of the defined shortcut keys for this window.
|
public final void | makeActive()
if (mContainer != null) {
if (mContainer.mActiveChild != null) {
mContainer.mActiveChild.mIsActive = false;
}
mContainer.mActiveChild = this;
}
mIsActive = true;
onActive();
|
protected abstract void | onActive()
|
public abstract void | onConfigurationChanged(android.content.res.Configuration newConfig)Should be called when the configuration is changed.
|
public abstract void | openPanel(int featureId, KeyEvent event)
|
public abstract View | peekDecorView()Retrieve the current decor view, but only if it has already been created;
otherwise returns null.
|
public abstract boolean | performContextMenuIdentifierAction(int id, int flags)
|
public abstract boolean | performPanelIdentifierAction(int featureId, int id, int flags)
|
public abstract boolean | performPanelShortcut(int featureId, int keyCode, KeyEvent event, int flags)
|
public boolean | requestFeature(int featureId)Enable extended screen features. This must be called before
setContentView(). May be called as many times as desired as long as it
is before setContentView(). If not called, no extended features
will be available. You can not turn off a feature once it is requested.
You canot use other title features with {@link #FEATURE_CUSTOM_TITLE}.
final int flag = 1<<featureId;
mFeatures |= flag;
mLocalFeatures |= mContainer != null ? (flag&~mContainer.mFeatures) : flag;
return (mFeatures&flag) != 0;
|
public abstract void | restoreHierarchyState(android.os.Bundle savedInstanceState)
|
public abstract android.os.Bundle | saveHierarchyState()
|
public void | setAttributes(WindowManager.LayoutParams a)Specify custom window attributes. PLEASE NOTE: the
layout params you give here should generally be from values previously
retrieved with {@link #getAttributes()}; you probably do not want to
blindly create and apply your own, since this will blow away any values
set by the framework that you are not interested in.
mWindowAttributes.copyFrom(a);
if (mCallback != null) {
mCallback.onWindowAttributesChanged(mWindowAttributes);
}
|
public abstract void | setBackgroundDrawable(android.graphics.drawable.Drawable drawable)Change the background of this window to a custom Drawable. Setting the
background to null will make the window be opaque. To make the window
transparent, you can use an empty drawable (for instance a ColorDrawable
with the color 0 or the system drawable android:drawable/empty.)
|
public void | setBackgroundDrawableResource(int resid)Change the background of this window to a Drawable resource. Setting the
background to null will make the window be opaque. To make the window
transparent, you can use an empty drawable (for instance a ColorDrawable
with the color 0 or the system drawable android:drawable/empty.)
setBackgroundDrawable(mContext.getResources().getDrawable(resid));
|
public void | setCallback(android.view.Window$Callback callback)Set the Callback interface for this window, used to intercept key
events and other dynamic operations in the window.
mCallback = callback;
|
public abstract void | setChildDrawable(int featureId, android.graphics.drawable.Drawable drawable)
|
public abstract void | setChildInt(int featureId, int value)
|
public void | setContainer(android.view.Window container)Set the container for this window. If not set, the DecorWindow
operates as a top-level window; otherwise, it negotiates with the
container to display itself appropriately.
mContainer = container;
if (container != null) {
// Embedded screens never have a title.
mFeatures |= 1<<FEATURE_NO_TITLE;
mLocalFeatures |= 1<<FEATURE_NO_TITLE;
container.mHasChildren = true;
}
|
public abstract void | setContentView(int layoutResID)Convenience for
{@link #setContentView(View, android.view.ViewGroup.LayoutParams)}
to set the screen content from a layout resource. The resource will be
inflated, adding all top-level views to the screen.
|
public abstract void | setContentView(View view)Convenience for
{@link #setContentView(View, android.view.ViewGroup.LayoutParams)}
set the screen content to an explicit view. This view is placed
directly into the screen's view hierarchy. It can itself be a complex
view hierarhcy.
|
public abstract void | setContentView(View view, ViewGroup.LayoutParams params)Set the screen content to an explicit view. This view is placed
directly into the screen's view hierarchy. It can itself be a complex
view hierarchy.
Note that calling this function "locks in" various characteristics
of the window that can not, from this point forward, be changed: the
features that have been requested with {@link #requestFeature(int)},
and certain window flags as described in {@link #setFlags(int, int)}.
|
protected void | setDefaultWindowFormat(int format)Set the default format of window, as per the PixelFormat types. This
is the format that will be used unless the client specifies in explicit
format with setFormat();
mDefaultWindowFormat = format;
if (!mHaveWindowFormat) {
final WindowManager.LayoutParams attrs = getAttributes();
attrs.format = format;
if (mCallback != null) {
mCallback.onWindowAttributesChanged(attrs);
}
}
|
public abstract void | setFeatureDrawable(int featureId, android.graphics.drawable.Drawable drawable)Set an explicit Drawable value for feature of this window. You must
have called requestFeature(featureId) before calling this function.
|
public abstract void | setFeatureDrawableAlpha(int featureId, int alpha)Set a custom alpha value for the given drawale feature, controlling how
much the background is visible through it.
|
public abstract void | setFeatureDrawableResource(int featureId, int resId)Set the value for a drawable feature of this window, from a resource
identifier. You must have called requestFeauture(featureId) before
calling this function.
|
public abstract void | setFeatureDrawableUri(int featureId, android.net.Uri uri)Set the value for a drawable feature of this window, from a URI. You
must have called requestFeature(featureId) before calling this
function.
The only URI currently supported is "content:", specifying an image
in a content provider.
|
public abstract void | setFeatureInt(int featureId, int value)Set the integer value for a feature. The range of the value depends on
the feature being set. For FEATURE_PROGRESSS, it should go from 0 to
10000. At 10000 the progress is complete and the indicator hidden.
|
public void | setFlags(int flags, int mask)Set the flags of the window, as per the
{@link WindowManager.LayoutParams WindowManager.LayoutParams}
flags.
Note that some flags must be set before the window decoration is
created (by the first call to
{@link #setContentView(View, android.view.ViewGroup.LayoutParams)} or
{@link #getDecorView()}:
{@link WindowManager.LayoutParams#FLAG_LAYOUT_IN_SCREEN} and
{@link WindowManager.LayoutParams#FLAG_LAYOUT_INSET_DECOR}. These
will be set for you based on the {@link android.R.attr#windowIsFloating}
attribute.
final WindowManager.LayoutParams attrs = getAttributes();
attrs.flags = (attrs.flags&~mask) | (flags&mask);
mForcedWindowFlags |= mask;
if (mCallback != null) {
mCallback.onWindowAttributesChanged(attrs);
}
|
public void | setFormat(int format)Set the format of window, as per the PixelFormat types. This overrides
the default format that is selected by the Window based on its
window decorations.
final WindowManager.LayoutParams attrs = getAttributes();
if (format != PixelFormat.UNKNOWN) {
attrs.format = format;
mHaveWindowFormat = true;
} else {
attrs.format = mDefaultWindowFormat;
mHaveWindowFormat = false;
}
if (mCallback != null) {
mCallback.onWindowAttributesChanged(attrs);
}
|
public void | setGravity(int gravity)Set the gravity of the window, as per the Gravity constants. This
controls how the window manager is positioned in the overall window; it
is only useful when using WRAP_CONTENT for the layout width or height.
final WindowManager.LayoutParams attrs = getAttributes();
attrs.gravity = gravity;
if (mCallback != null) {
mCallback.onWindowAttributesChanged(attrs);
}
|
public void | setLayout(int width, int height)Set the width and height layout parameters of the window. The default
for both of these is FILL_PARENT; you can change them to WRAP_CONTENT to
make a window that is not full-screen.
final WindowManager.LayoutParams attrs = getAttributes();
attrs.width = width;
attrs.height = height;
if (mCallback != null) {
mCallback.onWindowAttributesChanged(attrs);
}
|
public void | setSoftInputMode(int mode)Specify an explicit soft input mode to use for the window, as per
{@link WindowManager.LayoutParams#softInputMode
WindowManager.LayoutParams.softInputMode}. Providing anything besides
"unspecified" here will override the input mode the window would
normally retrieve from its theme.
final WindowManager.LayoutParams attrs = getAttributes();
if (mode != WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED) {
attrs.softInputMode = mode;
mHasSoftInputMode = true;
} else {
mHasSoftInputMode = false;
}
if (mCallback != null) {
mCallback.onWindowAttributesChanged(attrs);
}
|
public abstract void | setTitle(java.lang.CharSequence title)
|
public abstract void | setTitleColor(int textColor)
|
public void | setType(int type)Set the type of the window, as per the WindowManager.LayoutParams
types.
final WindowManager.LayoutParams attrs = getAttributes();
attrs.type = type;
if (mCallback != null) {
mCallback.onWindowAttributesChanged(attrs);
}
|
public abstract void | setVolumeControlStream(int streamType)
|
public void | setWindowAnimations(int resId)Specify custom animations to use for the window, as per
{@link WindowManager.LayoutParams#windowAnimations
WindowManager.LayoutParams.windowAnimations}. Providing anything besides
0 here will override the animations the window would
normally retrieve from its theme.
final WindowManager.LayoutParams attrs = getAttributes();
attrs.windowAnimations = resId;
if (mCallback != null) {
mCallback.onWindowAttributesChanged(attrs);
}
|
public void | setWindowManager(WindowManager wm, android.os.IBinder appToken, java.lang.String appName)Set the window manager for use by this Window to, for example,
display panels. This is not used for displaying the
Window itself -- that must be done by the client.
mAppToken = appToken;
mAppName = appName;
if (wm == null) {
wm = WindowManagerImpl.getDefault();
}
mWindowManager = new LocalWindowManager(wm);
|
public abstract boolean | superDispatchKeyEvent(KeyEvent event)Used by custom windows, such as Dialog, to pass the key press event
further down the view hierarchy. Application developers should
not need to implement or call this.
|
public abstract boolean | superDispatchTouchEvent(MotionEvent event)Used by custom windows, such as Dialog, to pass the touch screen event
further down the view hierarchy. Application developers should
not need to implement or call this.
|
public abstract boolean | superDispatchTrackballEvent(MotionEvent event)Used by custom windows, such as Dialog, to pass the trackball event
further down the view hierarchy. Application developers should
not need to implement or call this.
|
public abstract void | takeKeyEvents(boolean get)Request that key events come to this activity. Use this if your
activity has no views with focus, but the activity still wants
a chance to process key events.
|
public abstract void | togglePanel(int featureId, KeyEvent event)
|