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)

此方法是聚焦视图及其祖先响应箭头键的最后机会。

CharSequence getAccessibilityClassName()

返回此对象的类名称以用于辅助功能。

boolean onKeyUp(int keyCode, KeyEvent event)

的默认实现 KeyEvent.Callback.onKeyUp() :当视图进行点击 KEYCODE_DPAD_CENTERKEYCODE_ENTER或者 KEYCODE_SPACE被释放。

boolean onLongClick(View v)

当点击并保存视图时调用。

boolean onTouchEvent(MotionEvent event)

实现此方法来处理触摸屏幕动作事件。

void setEnabled(boolean enabled)

设置此视图的启用状态。

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)

此方法是聚焦视图及其祖先响应箭头键的最后机会。 这在焦点视图在内部不消耗密钥时被调用,视图系统也不能在要求的方向上找到新焦点的视图。

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 ()

返回此对象的类名称以用于辅助功能。 如果子类正在实现的东西应该被视为一个全新的视图类,当它被可访问性使用时,子类只应该覆盖这个子类,与它所源自的类无关。 这用于填写AccessibilityNodeInfo.setClassName

Returns
CharSequence

onKeyUp

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

KeyEvent.Callback.onKeyUp()默认实现:当 KEYCODE_DPAD_CENTER KEYCODE_ENTERKEYCODE_SPACE时,执行该视图的点击。

软件键盘中的按键通常不会触发这个监听器,尽管在某些情况下有些人会选择这样做。 不要依靠这个来捕捉软件按键。

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)

当点击并保存视图时调用。

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)

实现此方法来处理触摸屏幕动作事件。

如果此方法用于检测点击操作,建议通过执行并调用performClick()来执行操作。 这将确保一致的系统行为,包括:

  • 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)

设置此视图的启用状态。 启用状态的解释因子而异。

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!