Most visited

Recently visited

Added in API level 1

ZoomButton

public class ZoomButton
extends ImageButton implements View.OnLongClickListener

java.lang.Object
   ↳ android.view.View
     ↳ android.widget.ImageView
       ↳ android.widget.ImageButton
         ↳ android.widget.ZoomButton


Summary

Inherited XML attributes

From class android.widget.ImageView
From class android.view.View

Inherited constants

From class android.view.View

Inherited fields

From class android.view.View

Public constructors

ZoomButton(Context context)
ZoomButton(Context context, AttributeSet attrs)
ZoomButton(Context context, AttributeSet attrs, int defStyleAttr)
ZoomButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public methods

boolean dispatchUnhandledMove(View focused, int direction)

This method is the last chance for the focused view and its ancestors to respond to an arrow key.

CharSequence getAccessibilityClassName()

Return the class name of this object to be used for accessibility purposes.

boolean onKeyUp(int keyCode, KeyEvent event)

Default implementation of KeyEvent.Callback.onKeyUp(): perform clicking of the view when KEYCODE_DPAD_CENTER, KEYCODE_ENTER or KEYCODE_SPACE is released.

boolean onLongClick(View v)

Called when a view has been clicked and held.

boolean onTouchEvent(MotionEvent event)

Implement this method to handle touch screen motion events.

void setEnabled(boolean enabled)

Set the enabled state of this view.

void setZoomSpeed(long speed)

Inherited methods

From class android.widget.ImageButton
From class android.widget.ImageView
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource
From interface android.view.View.OnLongClickListener

Public constructors

ZoomButton

Added in API level 1
ZoomButton (Context context)

Parameters
context Context

ZoomButton

Added in API level 1
ZoomButton (Context context, 
                AttributeSet attrs)

Parameters
context Context
attrs AttributeSet

ZoomButton

Added in API level 1
ZoomButton (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context
attrs AttributeSet
defStyleAttr int

ZoomButton

Added in API level 21
ZoomButton (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)

Parameters
context Context
attrs AttributeSet
defStyleAttr int
defStyleRes int

Public methods

dispatchUnhandledMove

Added in API level 1
boolean dispatchUnhandledMove (View focused, 
                int direction)

This method is the last chance for the focused view and its ancestors to respond to an arrow key. This is called when the focused view did not consume the key internally, nor could the view system find a new view in the requested direction to give focus to.

Parameters
focused View: The currently focused view.
direction int: The direction focus wants to move. One of FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, and FOCUS_RIGHT.
Returns
boolean True if the this view consumed this unhandled move.

getAccessibilityClassName

Added in API level 23
CharSequence getAccessibilityClassName ()

Return the class name of this object to be used for accessibility purposes. Subclasses should only override this if they are implementing something that should be seen as a completely new class of view when used by accessibility, unrelated to the class it is deriving from. This is used to fill in AccessibilityNodeInfo.setClassName.

Returns
CharSequence

onKeyUp

Added in API level 1
boolean onKeyUp (int keyCode, 
                KeyEvent event)

Default implementation of KeyEvent.Callback.onKeyUp(): perform clicking of the view when KEYCODE_DPAD_CENTER, KEYCODE_ENTER or KEYCODE_SPACE is released.

Key presses in software keyboards will generally NOT trigger this listener, although some may elect to do so in some situations. Do not rely on this to catch software key presses.

Parameters
keyCode int: A key code that represents the button pressed, from KeyEvent.
event KeyEvent: The KeyEvent object that defines the button action.
Returns
boolean If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.

onLongClick

Added in API level 1
boolean onLongClick (View v)

Called when a view has been clicked and held.

Parameters
v View: The view that was clicked and held.
Returns
boolean true if the callback consumed the long click, false otherwise.

onTouchEvent

Added in API level 1
boolean onTouchEvent (MotionEvent event)

Implement this method to handle touch screen motion events.

If this method is used to detect click actions, it is recommended that the actions be performed by implementing and calling performClick(). This will ensure consistent system behavior, including:

  • obeying click sound preferences
  • dispatching OnClickListener calls
  • handling ACTION_CLICK when accessibility features are enabled

Parameters
event MotionEvent: The motion event.
Returns
boolean True if the event was handled, false otherwise.

setEnabled

Added in API level 1
void setEnabled (boolean enabled)

Set the enabled state of this view. The interpretation of the enabled state varies by subclass.

Parameters
enabled boolean: True if this view is enabled, false otherwise.

setZoomSpeed

Added in API level 1
void setZoomSpeed (long speed)

Parameters
speed long

Hooray!