public class

ZoomView

extends View
java.lang.Object
   ↳ com.neomades.ui.View
     ↳ com.neomades.ui.ZoomView

Class Overview

Scrollable and Zoomable view.

By default, the ZoomView is horizontally stretched in MATCH_PARENT and vertically stretched in MATCH_PARENT. Its content view added with setContent(View) is scaled to fit the size of the zoom view by changing the aspect ratio of the view if necessary.

It's possible to zoom by using Pinch and DoubleTap gesture.

Cross Platform Considerations

ZoomView is available only for Android and iOS.

See Also

Summary

[Expand]
Inherited XML Attributes
From class com.neomades.ui.View
[Expand]
Inherited Constants
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
Public Constructors
ZoomView()
Creates a new ZoomView.
Public Methods
float getZoomScale()
Returns the zoom scale level.
void setContent(View view)
Sets content of the ZoomView.
void setZoomScale(float scale)
Sets the zoom scale of the content.
void setZoomViewListener(ZoomViewListener listener)
Attaches a zoom scale change listener.
[Expand]
Inherited Methods
From class com.neomades.ui.View
From class java.lang.Object

Public Constructors

public ZoomView ()

Creates a new ZoomView.

Public Methods

public float getZoomScale ()

Returns the zoom scale level.

Returns
  • the zoom scale level: 1.0 (no zoom) or a number greater than 1.0 for zoom level

public void setContent (View view)

Sets content of the ZoomView. The content view is scaled to fit the size of the zoom view by changing the aspect ratio of the view if necessary.

Parameters
view ZoomView content of the view
Throws
CrossThreadException if the method is called from outside the UI-Thread
IllegalStateException if the layout has already a parent

public void setZoomScale (float scale)

Sets the zoom scale of the content.

Parameters
scale 1.0 (no zoom) or a number greater than 1.0 for zoom level

public void setZoomViewListener (ZoomViewListener listener)

Attaches a zoom scale change listener.