Android API Chinese (51) -- ZoomButtonsController

Source: Internet
Author: User

 

Preface

This chapter is about android. widget. ZoomButtonsController. Its version is Android 2.2 r1 and translated from "zookeeper". You are welcome to visit his blog: http://www.cnblogs.com/mxgsa/. thank you again for "zookeeper "! I look forward to your participation in Android Chinese API translation, contact me over140@gmail.com.

 

Statement

You are welcome to repost, but please keep the original source of the article :)

Blog Garden: http://www.cnblogs.com/

Android Chinese translation group: http://code.taobao.org/project/view/404/

 

Body

I. Structure

Public class ZoomButtonsController extends View implements View. OnTouchListener

Java. lang. Object

Android. widget. ZoomButtonsController

Ii. Overview

ZoomButtonsController displays and hides the scaling control and locates its position in the parent view. It can also be used as a container for the zoom control, allowing some additional buttons to be displayed in the zoom control window.

Generally, when the client presses or moves the display container, it needs to call the setVisible (ture) method (setVisible (false) instead of calling it) to hide the space, it will automatically hide). At the same time, when the owner cannot further scale, the client should call setZoomInEnabled (boolean) and setZoomOutEnabled (boolean)

To timely update.

If you want to work with a custom view, goonDetachedFromWindow()Method ).

 

Iii. Constructor

PublicZoomButtonsController(View ownerView)

ZoomButtonsController Constructor

Parameters

The visible control that the ownerView is scaled by the zoom control. The display of the zoom control will be consistent with that of the visual control.

 

Iv. Public Methods

Public ViewGroupGetContainer()

Gets the parent container of the zoom control.

The client can add other visual controls and put them in the container together with the zoom control.

Return

The container of the zoom control. Its layout will be consistent with that of its child control.

 

Public ViewGetZoomControls()

Obtain the zoom control View

Return

Zoom control View

 

Public booleanIsAutoDismissed()

Auto-disable after obtaining whether the zoom control is displayed

Return

Auto-disable after the zoom control is displayed

 

Public booleanIsVisible()

Whether the scaling control is visible to users

Return

True or false

 

Public voidSetAutoDismissed(Boolean autoDismiss)

Set whether the zoom control is displayed and disable it automatically

Parameters

AutoDismiss true or false

 

Public voidSetFocusable(Boolean focusable)

Sets whether the zoom control gets the focus. If the control gets the focus, you can use the trackball and arrow keys to perform operations. Otherwise, you can only perform operations by touch.

Parameters

Focusable True and false

 

Public voidSetOnZoomListener(ZoomButtonsController. OnZoomListener listener)

Set ZoomButtonsController. OnZoomListener to listen to receive callback for scaling

Parameters

Listener: whether to scale the listener

 

Public voidSetVisible(Boolean visible)

Sets whether the scaling control is visible to users.

Parameters

Whether the visible scaling control is visible to users (true or false)

 

Public voidSetZoomInEnabled(Boolean enabled)

Whether to allow space Amplification

Parameters

Whether enabled allows space amplification (true or false)

 

Public voidSetZoomOutEnabled(Boolean enabled)

Whether to allow controls to zoom out

Parameters

Enabled: whether to allow the control to be reduced (true or false)

 

Public voidSetZoomSpeed(Long speed)

Sets the latency from scaling buttons to scaling callback.

Parameters

The interval between scaling callback of speed in milliseconds.

 

5. Supplement

Article Selection

Android Google map

Googlemap loads multiple overlay memory overflow

Sample Code

    

End

The collection has been released. Proceed...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.