to top
Android APIs
public class

ZoomControls

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

Class Overview

The ZoomControls class displays a simple set of controls used for zooming and provides callbacks to register for events.

Summary

[Expand]
Inherited XML Attributes
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Constants
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
ZoomControls(Context context)
ZoomControls(Context context, AttributeSet attrs)
Public Methods
boolean hasFocus()
Returns true if this view has or contains focus
void hide()
void onInitializeAccessibilityEvent(AccessibilityEvent event)
Initializes an AccessibilityEvent with information about this View which is the event source.
void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)
Initializes an AccessibilityNodeInfo with information about this view.
boolean onTouchEvent(MotionEvent event)
Implement this method to handle touch screen motion events.
void setIsZoomInEnabled(boolean isEnabled)
void setIsZoomOutEnabled(boolean isEnabled)
void setOnZoomInClickListener(View.OnClickListener listener)
void setOnZoomOutClickListener(View.OnClickListener listener)
void setZoomSpeed(long speed)
void show()
[Expand]
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.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public ZoomControls (Context context)

Added in API level 1

public ZoomControls (Context context, AttributeSet attrs)

Added in API level 1

Public Methods

public boolean hasFocus ()

Added in API level 1

Returns true if this view has or contains focus

Returns
  • true if this view has or contains focus

public void hide ()

Added in API level 1

public void onInitializeAccessibilityEvent (AccessibilityEvent event)

Added in API level 14

Initializes an AccessibilityEvent with information about this View which is the event source. In other words, the source of an accessibility event is the view whose state change triggered firing the event.

Example: Setting the password property of an event in addition to properties set by the super implementation:

 public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
     super.onInitializeAccessibilityEvent(event);
     event.setPassword(true);
 }

If an View.AccessibilityDelegate has been specified via calling setAccessibilityDelegate(AccessibilityDelegate) its onInitializeAccessibilityEvent(View, AccessibilityEvent) is responsible for handling this call.

Note: Always call the super implementation before adding information to the event, in case the default implementation has basic information to add.

Parameters
event The event to initialize.

public void onInitializeAccessibilityNodeInfo (AccessibilityNodeInfo info)

Added in API level 14

Initializes an AccessibilityNodeInfo with information about this view. The base implementation sets:

Subclasses should override this method, call the super implementation, and set additional attributes.

If an View.AccessibilityDelegate has been specified via calling setAccessibilityDelegate(AccessibilityDelegate) its onInitializeAccessibilityNodeInfo(View, AccessibilityNodeInfo) is responsible for handling this call.

Parameters
info The instance to initialize.

public boolean onTouchEvent (MotionEvent event)

Added in API level 1

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 The motion event.
Returns
  • True if the event was handled, false otherwise.

public void setIsZoomInEnabled (boolean isEnabled)

Added in API level 1

public void setIsZoomOutEnabled (boolean isEnabled)

Added in API level 1

public void setOnZoomInClickListener (View.OnClickListener listener)

Added in API level 1

public void setOnZoomOutClickListener (View.OnClickListener listener)

Added in API level 1

public void setZoomSpeed (long speed)

Added in API level 1

public void show ()

Added in API level 1