DefaultOffsettingHelper
public
class
DefaultOffsettingHelper
extends WearableRecyclerView.OffsettingHelper
This class is deprecated.
use the androidx.wear.widget.WearableRecyclerView and associated classes
provided by the Jetpack Wear library
instead.
This implementation of WearableRecyclerView.OffsettingHelper provides basic offsetting
logic for updating child layout. For round devices it offsets the children horizontally to make
them appear to travel around a circle. For square devices it aligns them in a straight list.
Summary
Public constructors | |
|---|---|
DefaultOffsettingHelper()
|
|
Public methods | |
|---|---|
void
|
adjustAnchorOffsetXY(View child, float[] anchorOffsetXY)
Override this method if you wish to adjust the anchor coordinates for each child view during a layout pass. |
void
|
updateChild(View child, WearableRecyclerView parent)
The default implementation will lay out children along a curve for round screens and along a straight line for square screens. |
Inherited methods | |
|---|---|
|
From class
android.support.wearable.view.WearableRecyclerView.OffsettingHelper
abstract
void
updateChild(View child, WearableRecyclerView parent)
Override this method if you wish to implement custom child layout behavior on scroll. | |
|
From class
java.lang.Object
Object
clone()
boolean
equals(Object arg0)
void
finalize()
final
Class<?>
getClass()
int
hashCode()
final
void
notify()
final
void
notifyAll()
String
toString()
final
void
wait(long arg0, int arg1)
final
void
wait(long arg0)
final
void
wait()
| |
Public constructors
DefaultOffsettingHelper
public DefaultOffsettingHelper ()
Public methods
adjustAnchorOffsetXY
public void adjustAnchorOffsetXY (View child, float[] anchorOffsetXY)
Override this method if you wish to adjust the anchor coordinates for each child view during a layout pass. In the override set the new desired anchor coordinates in the provided array. The coordinates should be provided in relation to the child view.
| Parameters | |
|---|---|
child |
View: The child view to which the anchor coordinates will apply. |
anchorOffsetXY |
float: The anchor coordinates for the provided child view, by default set to a
pre-defined constant on the horizontal axis and half of the child height on the vertical
axis (vertical center).
|
updateChild
public void updateChild (View child, WearableRecyclerView parent)
The default implementation will lay out children along a curve for round screens and along a straight line for square screens.
| Parameters | |
|---|---|
child |
View: the current child to be affected. |
parent |
WearableRecyclerView: the WearableRecyclerView parent that this helper is attached to.
|