belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1
WindowCompat
public
final
class
WindowCompat
extends Object
java.lang.Object | |
↳ | android.support.v4.view.WindowCompat |
Helper for accessing features in Window
.
Summary
Constants | |
---|---|
int |
FEATURE_ACTION_BAR
Flag for enabling the Action Bar. |
int |
FEATURE_ACTION_BAR_OVERLAY
Flag for requesting an Action Bar that overlays window content. |
int |
FEATURE_ACTION_MODE_OVERLAY
Flag for specifying the behavior of action modes when an Action Bar is not present. |
Public methods | |
---|---|
static
<T extends View>
T
|
requireViewById(Window window, int id)
Finds a view that was identified by the |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Constants
FEATURE_ACTION_BAR
int FEATURE_ACTION_BAR
Flag for enabling the Action Bar. This is enabled by default for some devices. The Action Bar replaces the title bar and provides an alternate location for an on-screen menu button on some devices.
Constant Value: 8 (0x00000008)
FEATURE_ACTION_BAR_OVERLAY
int FEATURE_ACTION_BAR_OVERLAY
Flag for requesting an Action Bar that overlays window content.
Normally an Action Bar will sit in the space above window content, but if this
feature is requested along with FEATURE_ACTION_BAR
it will be layered over
the window content itself. This is useful if you would like your app to have more control
over how the Action Bar is displayed, such as letting application content scroll beneath
an Action Bar with a transparent background or otherwise displaying a transparent/translucent
Action Bar over application content.
This mode is especially useful with View.SYSTEM_UI_FLAG_FULLSCREEN
, which allows you to seamlessly hide the
action bar in conjunction with other screen decorations.
As of JELLY_BEAN
, when an
ActionBar is in this mode it will adjust the insets provided to
View.fitSystemWindows(Rect)
to include the content covered by the action bar, so you can do layout within
that space.
Constant Value: 9 (0x00000009)
FEATURE_ACTION_MODE_OVERLAY
int FEATURE_ACTION_MODE_OVERLAY
Flag for specifying the behavior of action modes when an Action Bar is not present. If overlay is enabled, the action mode UI will be allowed to cover existing window content.
Constant Value: 10 (0x0000000a)
Public methods
requireViewById
T requireViewById (Window window, int id)
Finds a view that was identified by the android:id
XML attribute
that was processed in onCreate(Bundle)
, or throws an
IllegalArgumentException if the ID is invalid, or there is no matching view in the hierarchy.
Note: In most cases -- depending on compiler support -- the resulting view is automatically cast to the target class type. If the target class type is unconstrained, an explicit cast may be necessary.
Parameters | |
---|---|
window |
Window |
id |
int : the ID to search for |
Returns | |
---|---|
T |
a view with given ID |
Annotations
Interfaces
- ActionProvider.VisibilityListener
- AsyncLayoutInflater.OnInflateFinishedListener
- LayoutInflaterFactory
- MenuItemCompat.OnActionExpandListener
- NestedScrollingChild
- NestedScrollingChild2
- NestedScrollingParent
- NestedScrollingParent2
- OnApplyWindowInsetsListener
- ScrollingView
- TintableBackgroundView
- ViewPager.OnAdapterChangeListener
- ViewPager.OnPageChangeListener
- ViewPager.PageTransformer
- ViewPropertyAnimatorListener
- ViewPropertyAnimatorUpdateListener
Classes
- AbsSavedState
- AccessibilityDelegateCompat
- ActionProvider
- AsyncLayoutInflater
- GestureDetectorCompat
- GravityCompat
- InputDeviceCompat
- LayoutInflaterCompat
- MarginLayoutParamsCompat
- MenuCompat
- MenuItemCompat
- MotionEventCompat
- NestedScrollingChildHelper
- NestedScrollingParentHelper
- PagerAdapter
- PagerTabStrip
- PagerTitleStrip
- PointerIconCompat
- ScaleGestureDetectorCompat
- VelocityTrackerCompat
- ViewCompat
- ViewConfigurationCompat
- ViewGroupCompat
- ViewPager
- ViewPager.LayoutParams
- ViewPager.SavedState
- ViewPager.SimpleOnPageChangeListener
- ViewParentCompat
- ViewPropertyAnimatorCompat
- ViewPropertyAnimatorListenerAdapter
- WindowCompat
- WindowInsetsCompat