public abstract class ForwardingListener extends Object implements View.OnTouchListener, View.OnAttachStateChangeListener
ShowableListMenu
.Constructor and Description |
---|
ForwardingListener(View src) |
Modifier and Type | Method and Description |
---|---|
abstract ShowableListMenu |
getPopup()
Returns the popup to which this listener is forwarding events.
|
protected boolean |
onForwardingStarted()
Called when forwarding would like to start.
|
protected boolean |
onForwardingStopped()
Called when forwarding would like to stop.
|
boolean |
onTouch(View v,
MotionEvent event)
Called when a touch event is dispatched to a view.
|
void |
onViewAttachedToWindow(View v)
Called when the view is attached to a window.
|
void |
onViewDetachedFromWindow(View v)
Called when the view is detached from a window.
|
public ForwardingListener(View src)
public abstract ShowableListMenu getPopup()
Override this to return the correct popup. If the popup is displayed
asynchronously, you may also need to override
onForwardingStopped()
to prevent premature cancellation of
forwarding.
public boolean onTouch(View v, MotionEvent event)
View.OnTouchListener
onTouch
in interface View.OnTouchListener
v
- The view the touch event has been dispatched to.event
- The MotionEvent object containing full information about
the event.public void onViewAttachedToWindow(View v)
View.OnAttachStateChangeListener
onViewAttachedToWindow
in interface View.OnAttachStateChangeListener
v
- The view that was attachedpublic void onViewDetachedFromWindow(View v)
View.OnAttachStateChangeListener
onViewDetachedFromWindow
in interface View.OnAttachStateChangeListener
v
- The view that was detachedprotected boolean onForwardingStarted()
By default, this will show the popup returned by getPopup()
.
It may be overridden to perform another action, like clicking the
source view or preparing the popup before showing it.
protected boolean onForwardingStopped()
By default, this will dismiss the popup returned by
getPopup()
. It may be overridden to perform some other
action.