Most visited

Recently visited

Added in API level 1

ZoomControls

public class ZoomControls
extends LinearLayout

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ android.widget.ZoomControls


ZoomControls类显示一组简单的控件,用于缩放并提供回调来注册事件。

Summary

Inherited XML attributes

From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View

Inherited constants

From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View

Inherited fields

From class android.view.View

Public constructors

ZoomControls(Context context)
ZoomControls(Context context, AttributeSet attrs)

Public methods

CharSequence getAccessibilityClassName()

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

boolean hasFocus()

如果此视图具有或包含焦点,则返回true

void hide()
boolean onTouchEvent(MotionEvent event)

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

void setIsZoomInEnabled(boolean isEnabled)
void setIsZoomOutEnabled(boolean isEnabled)
void setOnZoomInClickListener(View.OnClickListener listener)
void setOnZoomOutClickListener(View.OnClickListener listener)
void setZoomSpeed(long speed)
void show()

Inherited methods

From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.view.ViewParent
From interface android.view.ViewManager
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public constructors

ZoomControls

Added in API level 1
ZoomControls (Context context)

Parameters
context Context

ZoomControls

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

Parameters
context Context
attrs AttributeSet

Public methods

getAccessibilityClassName

Added in API level 23
CharSequence getAccessibilityClassName ()

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

Returns
CharSequence

hasFocus

Added in API level 1
boolean hasFocus ()

如果此视图具有或包含焦点,则返回true

Returns
boolean true if this view has or contains focus

hide

Added in API level 1
void hide ()

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.

setIsZoomInEnabled

Added in API level 1
void setIsZoomInEnabled (boolean isEnabled)

Parameters
isEnabled boolean

setIsZoomOutEnabled

Added in API level 1
void setIsZoomOutEnabled (boolean isEnabled)

Parameters
isEnabled boolean

setOnZoomInClickListener

Added in API level 1
void setOnZoomInClickListener (View.OnClickListener listener)

Parameters
listener View.OnClickListener

setOnZoomOutClickListener

Added in API level 1
void setOnZoomOutClickListener (View.OnClickListener listener)

Parameters
listener View.OnClickListener

setZoomSpeed

Added in API level 1
void setZoomSpeed (long speed)

Parameters
speed long

show

Added in API level 1
void show ()

Hooray!