|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectRecyclerView
android.support.wearable.view.WearableListView
public class WearableListView
An alternative version of ListView that is optimized for ease of use on small screen wearable devices. It displays a vertically scrollable list of items, and automatically snaps to the nearest item when the user stops scrolling. The currently selected item in the list is always expanded to provide a larger touch target.
If you are using proguard in your project, you will need to update your proguard flags such that animations (expansion/contraction, snap-to-center) will work. These rules are:
-keep class android.support.wearable.view.WearableListView {
private void setScrollAnimator(int);
private void setScrollVertically(int);
}
| Nested Class Summary | |
|---|---|
static class |
WearableListView.Adapter
Base class for adapters providing data for the WearableListView. |
static interface |
WearableListView.ClickListener
|
static interface |
WearableListView.Item
|
static interface |
WearableListView.OnScrollListener
|
static class |
WearableListView.ViewHolder
Wrapper around items displayed in the list view. |
| Field Summary | |
|---|---|
static java.lang.String |
TAG
|
| Constructor Summary | |
|---|---|
WearableListView(Context context)
|
|
WearableListView(Context context,
AttributeSet attrs)
|
|
WearableListView(Context context,
AttributeSet attrs,
int defStyleAttr)
|
|
| Method Summary | |
|---|---|
void |
addOnScrollListener(WearableListView.OnScrollListener listener)
Adds a listener that will be called when the content of the list view is scrolled. |
boolean |
fling(int velocityX,
int velocityY)
|
WearableListView.ViewHolder |
getChildViewHolder(View child)
|
boolean |
onInterceptTouchEvent(MotionEvent event)
|
void |
onScrolled(int dx,
int dy)
|
void |
onScrollStateChanged(int newState)
|
boolean |
onTouchEvent(MotionEvent event)
|
void |
removeOnScrollListener(WearableListView.OnScrollListener listener)
Removes listener for scroll events. |
void |
resetLayoutManager()
Clears state of the layout manager that positions list items. |
void |
setClickListener(WearableListView.ClickListener clickListener)
Adds a listener that will be called when the user taps on the WearableListView or its items. |
void |
setGreedyTouchMode(boolean greedy)
Controls whether WearableListView should intercept all touch events and also prevent the parent from receiving them. |
void |
setInitialOffset(int offset)
By default the first element of the list is initially positioned in the center of the screen. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TAG
| Constructor Detail |
|---|
public WearableListView(Context context)
public WearableListView(Context context,
AttributeSet attrs)
public WearableListView(Context context,
AttributeSet attrs,
int defStyleAttr)
| Method Detail |
|---|
public void resetLayoutManager()
public void setGreedyTouchMode(boolean greedy)
greedy - If true it will intercept all touch events.public void setInitialOffset(int offset)
offset - How far should the elements be pushed down.public boolean onInterceptTouchEvent(MotionEvent event)
public boolean onTouchEvent(MotionEvent event)
public void onScrollStateChanged(int newState)
public void onScrolled(int dx,
int dy)
public void addOnScrollListener(WearableListView.OnScrollListener listener)
public void removeOnScrollListener(WearableListView.OnScrollListener listener)
public boolean fling(int velocityX,
int velocityY)
public WearableListView.ViewHolder getChildViewHolder(View child)
public void setClickListener(WearableListView.ClickListener clickListener)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||