library / com.otaliastudios.zoom / ZoomLayout

ZoomLayout

open class ZoomLayout : FrameLayout, OnGlobalLayoutListener, ZoomApi

Uses ZoomEngine to allow zooming and pan events onto a view hierarchy. The hierarchy must be contained in a single view, added to this layout (like what you do with a ScrollView).

If the hierarchy has clickable children that should react to touch events, you are required to call setHasClickableChildren or use the attribute. This is off by default because it is more expensive in terms of performance.

Currently padding to this view / margins to the child view are NOT supported.

Constructors

<init>

ZoomLayout(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)

Properties

engine

val engine: ZoomEngine

Functions

addView

open fun addView(child: View, index: Int, params: LayoutParams): Unit

computeHorizontalScrollOffset

open fun computeHorizontalScrollOffset(): Int

computeHorizontalScrollRange

open fun computeHorizontalScrollRange(): Int

computeVerticalScrollOffset

open fun computeVerticalScrollOffset(): Int

computeVerticalScrollRange

open fun computeVerticalScrollRange(): Int

drawChild

open fun drawChild(canvas: Canvas, child: View, drawingTime: Long): Boolean

onAttachedToWindow

open fun onAttachedToWindow(): Unit

onDetachedFromWindow

open fun onDetachedFromWindow(): Unit

onGlobalLayout

open fun onGlobalLayout(): Unit

onInterceptTouchEvent

open fun onInterceptTouchEvent(ev: MotionEvent): Boolean

onMeasure

open fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int): Unit

onTouchEvent

open fun onTouchEvent(ev: MotionEvent): Boolean

setHasClickableChildren

fun setHasClickableChildren(hasClickableChildren: Boolean): Unit

Whether the view hierarchy inside has (or will have) clickable children. This is false by default.