|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object android.view.View android.view.ViewGroup android.widget.AdapterView<ListAdapter> android.widget.AbsListView android.widget.ListView sk.baka.ambient.views.gesturelist.GesturesListView
public class GesturesListView
Captures the motion events
and generates more high-level
gesture events.
To configure the view you may need to set the two properties:
dragDropViews
list - list of targets where the items can be
dropped. May be null
- this has the same meaning as an empty
listlistener
The view offers a lot simplified API than the classical ListView
, at
the price of disabling support for other adapters. For example, there is no
need to set the ListAdapter
and evade the minefield of
list-scrollposition-resetting functions like ListView.getAdapter()
To work with this modified list view, you just need to modify model using the
model holder
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class android.widget.AbsListView |
---|
AbsListView.LayoutParams, AbsListView.OnScrollListener, AbsListView.RecyclerListener |
Nested classes/interfaces inherited from class android.widget.AdapterView |
---|
AdapterView.AdapterContextMenuInfo, AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener, AdapterView.OnItemSelectedListener |
Nested classes/interfaces inherited from class android.view.ViewGroup |
---|
ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener |
Nested classes/interfaces inherited from class android.view.View |
---|
View.BaseSavedState, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLongClickListener, View.OnTouchListener |
Field Summary | |
---|---|
List<GesturesListView> |
dragDropViews
If not empty then the LU/LD gestures will drag'n'drop selected items to these views. |
int |
hintDeleteCopyMoveId
The string id of the "Delete/Copy/Move" (touchpad L?) gesture. |
int |
hintDeleteId
The string id of the "Delete" (L, LL) gesture. |
int |
hintDeleteMovePasteId
The string id of the "Delete/Move/Paste" (keyboard L?) gesture. |
(package private) int |
itemLayoutId
Layout ID for each item in the list. |
(package private) KeypadController |
keyController
Handles the touchpad events and controls this view. |
IGestureListViewListener |
listener
The gesture listener. |
(package private) TouchPadController |
touchController
Handles the touchpad events and controls this view. |
Fields inherited from class android.widget.ListView |
---|
CHOICE_MODE_MULTIPLE, CHOICE_MODE_NONE, CHOICE_MODE_SINGLE |
Fields inherited from class android.widget.AbsListView |
---|
TRANSCRIPT_MODE_ALWAYS_SCROLL, TRANSCRIPT_MODE_DISABLED, TRANSCRIPT_MODE_NORMAL |
Fields inherited from class android.widget.AdapterView |
---|
INVALID_POSITION, INVALID_ROW_ID, ITEM_VIEW_TYPE_HEADER_OR_FOOTER, ITEM_VIEW_TYPE_IGNORE |
Fields inherited from class android.view.ViewGroup |
---|
CLIP_TO_PADDING_MASK, FLAG_USE_CHILD_DRAWING_ORDER, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE |
Constructor Summary | |
---|---|
GesturesListView(Context context,
AttributeSet attrs)
Creates new view. |
|
GesturesListView(Context context,
AttributeSet attrs,
int defStyle)
Creates new view. |
|
GesturesListView(Context context,
int itemLayoutId)
Creates new view. |
Method Summary | |
---|---|
boolean |
canMove()
Checks if the move events ( IGestureListViewListener.moveItems(Interval, int) and
IGestureListViewListener.moveItemsByOne(Interval, boolean) ) can
be invoked. |
(package private) void |
clearMode(Object controller)
Clears the mode and dismisses the window. |
void |
clipboardChanged()
Invoke to let the listview know that the clipboard was modified. |
GesturesListView |
findView(Point point)
Finds a view from the registered list of views
that contains given point. |
(package private) TrackListClipboardObject |
getClipboard()
Returns the clipboard contents. |
Interval |
getHighlight()
Returns current highlight. |
int |
getItemIndex(MotionEvent event)
Returns item index the event coordinates is pointing to. |
ModelHolder |
getModel()
Returns the model holder. |
boolean |
isEOP(int position)
Checks if given item is the EOP item. |
protected void |
onAttachedToWindow()
|
protected void |
onFocusChanged(boolean gainFocus,
int direction,
Rect previouslyFocusedRect)
|
boolean |
onKeyDown(int keyCode,
KeyEvent event)
|
boolean |
onKeyMultiple(int keyCode,
int repeatCount,
KeyEvent event)
|
boolean |
onKeyUp(int keyCode,
KeyEvent event)
|
boolean |
onTouchEvent(MotionEvent event)
|
int |
pointToPosition(int x,
int y)
|
(package private) void |
restoreSelector()
Restores the original selector. |
void |
setAdapter(ListAdapter adapter)
|
(package private) void |
setMode(int resId,
Object controller,
boolean persistent)
Sets the mode tooltip the view is currently in. |
void |
setOnItemClickListener(AdapterView.OnItemClickListener l)
|
void |
setOnItemSelectedListener(AdapterView.OnItemSelectedListener listener)
|
(package private) void |
transparentSelector()
Remembers the original selector and sets a transparent (non-visible) selector. |
void |
zoom(boolean zoom)
Zooms or un-zooms the items. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface android.view.ViewParent |
---|
createContextMenu, getParent, isLayoutRequested |
Field Detail |
---|
int itemLayoutId
public int hintDeleteId
public int hintDeleteCopyMoveId
public int hintDeleteMovePasteId
public final List<GesturesListView> dragDropViews
final TouchPadController touchController
final KeypadController keyController
public IGestureListViewListener listener
Constructor Detail |
---|
public GesturesListView(Context context, int itemLayoutId)
context
- the contextitemLayoutId
- layout ID for each item in the list.public GesturesListView(Context context, AttributeSet attrs, int defStyle)
context
- attrs
- defStyle
- public GesturesListView(Context context, AttributeSet attrs)
context
- attrs
- Method Detail |
---|
TrackListClipboardObject getClipboard()
null
if the clipboard is incompatible or empty.public void clipboardChanged()
public ModelHolder getModel()
public Interval getHighlight()
null
.protected void onAttachedToWindow()
onAttachedToWindow
in class AbsListView
public void setOnItemClickListener(AdapterView.OnItemClickListener l)
setOnItemClickListener
in class AdapterView<ListAdapter>
public void setAdapter(ListAdapter adapter)
setAdapter
in class ListView
public boolean canMove()
IGestureListViewListener.moveItems(Interval, int)
and
IGestureListViewListener.moveItemsByOne(Interval, boolean)
) can
be invoked.
true
if this list view can drag'n'drop items onto
itself, false
otherwise.public boolean onTouchEvent(MotionEvent event)
onTouchEvent
in class ListView
public boolean onKeyDown(int keyCode, KeyEvent event)
onKeyDown
in interface KeyEvent.Callback
onKeyDown
in class ListView
public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event)
onKeyMultiple
in interface KeyEvent.Callback
onKeyMultiple
in class ListView
public boolean onKeyUp(int keyCode, KeyEvent event)
onKeyUp
in interface KeyEvent.Callback
onKeyUp
in class ListView
void transparentSelector()
void restoreSelector()
public int pointToPosition(int x, int y)
pointToPosition
in class AbsListView
public GesturesListView findView(Point point)
registered list of views
that contains given point.
point
- the point in this view's coordinate system
null
if no such
view exists.public int getItemIndex(MotionEvent event)
event
- the event
void setMode(int resId, Object controller, boolean persistent)
resId
- the string to showcontroller
- calleepersistent
- if false
then the mode hint will disappear
automatically after 2 seconds.void clearMode(Object controller)
controller
- calleepublic void setOnItemSelectedListener(AdapterView.OnItemSelectedListener listener)
setOnItemSelectedListener
in class AdapterView<ListAdapter>
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect)
onFocusChanged
in class ListView
public boolean isEOP(int position)
position
- the item index
true
if it is EOP, false
otherwise.public void zoom(boolean zoom)
zoom
- true
if zoom the view.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |