English | Site Directory

Android - An Open Handset Alliance Project

android.widget
public class

android.widget.ZoomDialog

java.lang.Object
android.app.Dialog DialogInterface KeyEvent.Callback Window.Callback
android.widget.ZoomDialog

A Dialog that is used to display the ZoomSlider.

Summary

Constants inherited from interface android.content.DialogInterface
Fields inherited from class android.app.Dialog

Public Constructors

          ZoomDialog(Context context)

Public Methods

        void  doZoom(boolean in)
Move the zoom up or down by 1.
        boolean  onKeyDown(int keyCode, KeyEvent event)
A key was pressed down.
        boolean  onTouchEvent(MotionEvent event)
Called when a touch screen event was not handled by any of the views under it.
        int  setCurrent(int level)
Sets the level on the dialog's zoom slider.
        void  setParams(int start, int end, int current, OnZoomChangedListener zoomListener, boolean notifyOnChange)
Delegates to the underlying ZoomSlider
        void  setPosition(View view, int x, int y)
Set the position of the ZoomDialog by supplying the co-ordinates of where you would like the currently selected zoom level should appear and the View on which the dialog should be displayed.

Protected Methods

        void  onStop()
Called to tell you that you're stopping.
Methods inherited from class android.app.Dialog
Methods inherited from class java.lang.Object
Methods inherited from interface android.view.Window.Callback
Methods inherited from interface android.view.KeyEvent.Callback
Methods inherited from interface android.content.DialogInterface

Details

Public Constructors

public ZoomDialog(Context context)

Public Methods

public void doZoom(boolean in)

Move the zoom up or down by 1. Checks boundary conditions so it will not change the zoom level beyond the supplied start and end.

public boolean onKeyDown(int keyCode, KeyEvent event)

A key was pressed down.

If the focused view didn't want this event, this method is called.

The default implementation handles KEYCODE_BACK to close the dialog.

public boolean onTouchEvent(MotionEvent event)

Called when a touch screen event was not handled by any of the views under it. This is most useful to process touch events that happen outside of your window bounds, where there is no view to receive it.

Parameters

event The touch screen event being processed.

public int setCurrent(int level)

Sets the level on the dialog's zoom slider. Checks boundary conditions so it will not change the zoom level beyond the supplied start and end. This will not cause a callback to the ZoomSlider.OnZoomChangedListener.

Parameters

level The level to set on the zoom slider.

Returns

  • The new zoom level (if level is outside the supplied start and end, the return value will be different).

public void setParams(int start, int end, int current, OnZoomChangedListener zoomListener, boolean notifyOnChange)

public void setPosition(View view, int x, int y)

Set the position of the ZoomDialog by supplying the co-ordinates of where you would like the currently selected zoom level should appear and the View on which the dialog should be displayed. The dialog will be displayed at the specified position if the entire dialog fits within the dimensions of the supplied view otherwise it will be moved towards the center of the screen until it does fit.

Parameters

view the view in which to display the dialog.
x the offset from the left of the screen.
y the offset from the top of the screen.

Protected Methods

protected void onStop()

Called to tell you that you're stopping.
Build m5-rc15i - 10 Jun 2008 13:54