WearableDrawerLayout
This package is part of the
Android support library which
is no longer maintained.
The support library has been superseded by AndroidX
which is part of Jetpack .
We recommend using the AndroidX libraries in all new projects. You should also consider
migrating existing projects to AndroidX.
To find the AndroidX class that maps to this deprecated class, see the AndroidX
support library class
mappings .
public
class
WearableDrawerLayout
extends FrameLayout
implements
View.OnLayoutChangeListener ,
NestedScrollingParent
Top-level container that allows interactive drawers to be pulled from the top and bottom edge of
the window. For WearableDrawerLayout to work properly, scrolling children must send nested
scrolling events. Views that implement NestedScrollingChild
do
this by default. To enable nested scrolling on frameworks views like ListView
, set android:nestedScrollingEnabled="true"
on the view in
the layout file, or call setNestedScrollingEnabled(boolean)
in code. This includes the main
content in a WearableDrawerLayout, as well as the content inside of the drawers.
To use WearableDrawerLayout with WearableActionDrawerView
or WearableNavigationDrawerView
, place either drawer in a WearableDrawerLayout.
<android.support.wear.widget.drawer.WearableDrawerLayout [...]>
<FrameLayout android:id=”@+id/content” />
<android.support.wear.widget.drawer.WearableNavigationDrawerView
android:layout_width=”match_parent”
android:layout_height=”match_parent” />
<android.support.wear.widget.drawer.WearableActionDrawerView
android:layout_width=”match_parent”
android:layout_height=”match_parent” />
</android.support.wear.widget.drawer.WearableDrawerLayout>
To use custom content in a drawer, place WearableDrawerView
in a WearableDrawerLayout
and specify the layout_gravity to pick the drawer location (the following example is for a top
drawer). Note: You must either call setDrawerContent(View)
and pass
in your drawer content view, or specify it in the app:drawerContent
XML attribute.
<android.support.wear.widget.drawer.WearableDrawerLayout [...]>
<FrameLayout
android:id=”@+id/content”
android:layout_width=”match_parent”
android:layout_height=”match_parent” />
<android.support.wear.widget.drawer.WearableDrawerView
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:layout_gravity=”top”
app:drawerContent="@+id/top_drawer_content" >
<FrameLayout
android:id=”@id/top_drawer_content”
android:layout_width=”match_parent”
android:layout_height=”match_parent” />
</android.support.wear.widget.drawer.WearableDrawerView>
</android.support.wear.widget.drawer.WearableDrawerLayout>
Summary
Nested classes
class
WearableDrawerLayout.DrawerStateCallback
Listener for monitoring events about drawers.
Inherited constants
From
class
android.view.ViewGroup
int
CLIP_TO_PADDING_MASK
int
FOCUS_AFTER_DESCENDANTS
int
FOCUS_BEFORE_DESCENDANTS
int
FOCUS_BLOCK_DESCENDANTS
int
LAYOUT_MODE_CLIP_BOUNDS
int
LAYOUT_MODE_OPTICAL_BOUNDS
int
PERSISTENT_ALL_CACHES
int
PERSISTENT_ANIMATION_CACHE
int
PERSISTENT_NO_CACHE
int
PERSISTENT_SCROLLING_CACHE
From
class
android.view.View
int
ACCESSIBILITY_LIVE_REGION_ASSERTIVE
int
ACCESSIBILITY_LIVE_REGION_NONE
int
ACCESSIBILITY_LIVE_REGION_POLITE
int
AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
String
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE
String
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY
String
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH
String
AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR
String
AUTOFILL_HINT_CREDIT_CARD_NUMBER
String
AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE
String
AUTOFILL_HINT_EMAIL_ADDRESS
String
AUTOFILL_HINT_NAME
String
AUTOFILL_HINT_PASSWORD
String
AUTOFILL_HINT_PHONE
String
AUTOFILL_HINT_POSTAL_ADDRESS
String
AUTOFILL_HINT_POSTAL_CODE
String
AUTOFILL_HINT_USERNAME
int
AUTOFILL_TYPE_DATE
int
AUTOFILL_TYPE_LIST
int
AUTOFILL_TYPE_NONE
int
AUTOFILL_TYPE_TEXT
int
AUTOFILL_TYPE_TOGGLE
int
DRAG_FLAG_GLOBAL
int
DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION
int
DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION
int
DRAG_FLAG_GLOBAL_URI_READ
int
DRAG_FLAG_GLOBAL_URI_WRITE
int
DRAG_FLAG_OPAQUE
int
DRAWING_CACHE_QUALITY_AUTO
int
DRAWING_CACHE_QUALITY_HIGH
int
DRAWING_CACHE_QUALITY_LOW
int
FIND_VIEWS_WITH_CONTENT_DESCRIPTION
int
FIND_VIEWS_WITH_TEXT
int
FOCUSABLE
int
FOCUSABLES_ALL
int
FOCUSABLES_TOUCH_MODE
int
FOCUSABLE_AUTO
int
FOCUS_BACKWARD
int
FOCUS_DOWN
int
FOCUS_FORWARD
int
FOCUS_LEFT
int
FOCUS_RIGHT
int
FOCUS_UP
int
GONE
int
HAPTIC_FEEDBACK_ENABLED
int
IMPORTANT_FOR_ACCESSIBILITY_AUTO
int
IMPORTANT_FOR_ACCESSIBILITY_NO
int
IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
int
IMPORTANT_FOR_ACCESSIBILITY_YES
int
IMPORTANT_FOR_AUTOFILL_AUTO
int
IMPORTANT_FOR_AUTOFILL_NO
int
IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS
int
IMPORTANT_FOR_AUTOFILL_YES
int
IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS
int
INVISIBLE
int
KEEP_SCREEN_ON
int
LAYER_TYPE_HARDWARE
int
LAYER_TYPE_NONE
int
LAYER_TYPE_SOFTWARE
int
LAYOUT_DIRECTION_INHERIT
int
LAYOUT_DIRECTION_LOCALE
int
LAYOUT_DIRECTION_LTR
int
LAYOUT_DIRECTION_RTL
int
MEASURED_HEIGHT_STATE_SHIFT
int
MEASURED_SIZE_MASK
int
MEASURED_STATE_MASK
int
MEASURED_STATE_TOO_SMALL
int
NOT_FOCUSABLE
int
NO_ID
int
OVER_SCROLL_ALWAYS
int
OVER_SCROLL_IF_CONTENT_SCROLLS
int
OVER_SCROLL_NEVER
int
SCREEN_STATE_OFF
int
SCREEN_STATE_ON
int
SCROLLBARS_INSIDE_INSET
int
SCROLLBARS_INSIDE_OVERLAY
int
SCROLLBARS_OUTSIDE_INSET
int
SCROLLBARS_OUTSIDE_OVERLAY
int
SCROLLBAR_POSITION_DEFAULT
int
SCROLLBAR_POSITION_LEFT
int
SCROLLBAR_POSITION_RIGHT
int
SCROLL_AXIS_HORIZONTAL
int
SCROLL_AXIS_NONE
int
SCROLL_AXIS_VERTICAL
int
SCROLL_INDICATOR_BOTTOM
int
SCROLL_INDICATOR_END
int
SCROLL_INDICATOR_LEFT
int
SCROLL_INDICATOR_RIGHT
int
SCROLL_INDICATOR_START
int
SCROLL_INDICATOR_TOP
int
SOUND_EFFECTS_ENABLED
int
STATUS_BAR_HIDDEN
int
STATUS_BAR_VISIBLE
int
SYSTEM_UI_FLAG_FULLSCREEN
int
SYSTEM_UI_FLAG_HIDE_NAVIGATION
int
SYSTEM_UI_FLAG_IMMERSIVE
int
SYSTEM_UI_FLAG_IMMERSIVE_STICKY
int
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
int
SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
int
SYSTEM_UI_FLAG_LAYOUT_STABLE
int
SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
int
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
int
SYSTEM_UI_FLAG_LOW_PROFILE
int
SYSTEM_UI_FLAG_VISIBLE
int
SYSTEM_UI_LAYOUT_FLAGS
int
TEXT_ALIGNMENT_CENTER
int
TEXT_ALIGNMENT_GRAVITY
int
TEXT_ALIGNMENT_INHERIT
int
TEXT_ALIGNMENT_TEXT_END
int
TEXT_ALIGNMENT_TEXT_START
int
TEXT_ALIGNMENT_VIEW_END
int
TEXT_ALIGNMENT_VIEW_START
int
TEXT_DIRECTION_ANY_RTL
int
TEXT_DIRECTION_FIRST_STRONG
int
TEXT_DIRECTION_FIRST_STRONG_LTR
int
TEXT_DIRECTION_FIRST_STRONG_RTL
int
TEXT_DIRECTION_INHERIT
int
TEXT_DIRECTION_LOCALE
int
TEXT_DIRECTION_LTR
int
TEXT_DIRECTION_RTL
String
VIEW_LOG_TAG
int
VISIBLE
Inherited fields
From
class
android.view.View
public
static
final
Property <View , Float>
ALPHA
protected
static
final
int[]
EMPTY_STATE_SET
protected
static
final
int[]
ENABLED_FOCUSED_SELECTED_STATE_SET
protected
static
final
int[]
ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET
protected
static
final
int[]
ENABLED_FOCUSED_STATE_SET
protected
static
final
int[]
ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET
protected
static
final
int[]
ENABLED_SELECTED_STATE_SET
protected
static
final
int[]
ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET
protected
static
final
int[]
ENABLED_STATE_SET
protected
static
final
int[]
ENABLED_WINDOW_FOCUSED_STATE_SET
protected
static
final
int[]
FOCUSED_SELECTED_STATE_SET