WearableRecyclerView
class WearableRecyclerView : RecyclerView
| kotlin.Any | ||||
| ↳ | android.view.View | |||
| ↳ | android.view.ViewGroup | |||
| ↳ | androidx.recyclerview.widget.RecyclerView | |||
| ↳ | androidx.wear.widget.WearableRecyclerView |
Wearable specific implementation of the RecyclerView enabling setCircularScrollingGestureEnabled circular scrolling} and semi-circular layouts.
| See also | |
|---|---|
setCircularScrollingGestureEnabled |
Summary
Public constructors |
|---|
WearableRecyclerView(context: Context!) |
WearableRecyclerView(context: Context!, attrs: AttributeSet?) |
WearableRecyclerView(context: Context!, attrs: AttributeSet?, defStyle: Int) |
WearableRecyclerView( |
Public functions |
|
|---|---|
Float |
Returns the current bezel width for circular scrolling as a fraction of the screen's radius. |
Float |
Returns how many degrees does the user have to rotate for to scroll through one screen height. |
Boolean |
Returns whether circular scrolling is enabled for this view. |
Boolean |
Returns whether the view is currently configured to center the edge children. |
Boolean |
onTouchEvent(event: MotionEvent!) |
Unit |
setBezelFraction(fraction: Float)Taps within this radius and the radius of the screen are considered close enough to the bezel to be candidates for circular scrolling. |
Unit |
setCircularScrollingGestureEnabled(Enables/disables circular touch scrolling for this view. |
Unit |
setEdgeItemsCenteringEnabled(isEnabled: Boolean)Use this method to configure the |
Unit |
setScrollDegreesPerScreen(degreesPerScreen: Float)Sets how many degrees the user has to rotate by to scroll through one screen height when they are using the circular scrolling gesture.The default value equates 180 degrees scroll to one screen. |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Public constructors
WearableRecyclerView
WearableRecyclerView(context: Context!, attrs: AttributeSet?, defStyle: Int)
WearableRecyclerView
WearableRecyclerView(
context: Context!,
attrs: AttributeSet?,
defStyle: Int,
defStyleRes: Int
)
Public functions
getBezelFraction
fun getBezelFraction(): Float
Returns the current bezel width for circular scrolling as a fraction of the screen's radius.
| See also | |
|---|---|
setBezelFraction |
getScrollDegreesPerScreen
fun getScrollDegreesPerScreen(): Float
Returns how many degrees does the user have to rotate for to scroll through one screen height.
isCircularScrollingGestureEnabled
fun isCircularScrollingGestureEnabled(): Boolean
Returns whether circular scrolling is enabled for this view.
| See also | |
|---|---|
setCircularScrollingGestureEnabled |
isEdgeItemsCenteringEnabled
fun isEdgeItemsCenteringEnabled(): Boolean
Returns whether the view is currently configured to center the edge children. See setEdgeItemsCenteringEnabled for details.
setBezelFraction
fun setBezelFraction(fraction: Float): Unit
Taps within this radius and the radius of the screen are considered close enough to the bezel to be candidates for circular scrolling. Expressed as a fraction of the screen's radius. The default is the whole screen i.e 1.0f.
setCircularScrollingGestureEnabled
fun setCircularScrollingGestureEnabled(
circularScrollingGestureEnabled: Boolean
): Unit
Enables/disables circular touch scrolling for this view. When enabled, circular touch gestures around the edge of the screen will cause the view to scroll up or down. Related methods let you specify the characteristics of the scrolling, like the speed of the scroll or the are considered for the start of this scrolling gesture.
setEdgeItemsCenteringEnabled
fun setEdgeItemsCenteringEnabled(isEnabled: Boolean): Unit
Use this method to configure the WearableRecyclerView on round watches to always align the first and last items with the vertical center of the screen. This effectively moves the start and end of the list to the middle of the screen if the user has scrolled so far. It takes the height of the children into account so that they are correctly centered. On nonRound watches, this method has no effect and original padding is used.
| Parameters | |
|---|---|
isEnabled: Boolean |
set to true if you wish to align the edge children (first and last) with the center of the screen. |
setScrollDegreesPerScreen
fun setScrollDegreesPerScreen(degreesPerScreen: Float): Unit
Sets how many degrees the user has to rotate by to scroll through one screen height when they are using the circular scrolling gesture.The default value equates 180 degrees scroll to one screen.
| Parameters | |
|---|---|
degreesPerScreen: Float |
the number of degrees to rotate by to scroll through one whole height of the screen, |
| See also | |
|---|---|
setCircularScrollingGestureEnabled |