AnnotationsView


class AnnotationsView : ViewGroup


A custom Android ViewGroup responsible for drawing a collection of annotations onto a Canvas. Each set of page annotations can have its own transformation matrix. It also supports annotating like text highlighting.

This inherits ViewGroup but does not support adding arbitrary children via addView or in a layout.

Summary

Nested types

Defines the current interaction mode of the AnnotationsView.

Mode for creating new highlight annotations.

Mode for selecting existing annotations (e.g. erase, drag, scale).

Callback interface for events related to the creation and modification of annotations.

Callback interface for annotation hit events.

Callback interface for gesture coordination events.

Public constructors

AnnotationsView(context: Context, attrs: AttributeSet?, defStyleAttr: Int)

Public functions

Unit

Adds a listener for events related to the finalized creation or failure of annotations.

Unit

Adds a listener for annotation hit events.

open Unit
addView(child: View?)
open Unit
addView(child: View?, index: Int)
open Unit
addView(child: View?, params: ViewGroup.LayoutParams?)
open Unit
addView(child: View?, index: Int, params: ViewGroup.LayoutParams?)
open Boolean
Unit

Removes a listener that was previously added via addOnAnnotationEditListener.

Unit

Removes a listener that was previously added via addOnAnnotationLocatedListener.

Unit

Sets a listener to be notified when this view claims or abandons the current gesture stream.

Unit

Sets the TextBoundsProvider used to retrieve text boundary information during highlighting.

Unit
@MainThread
updateDisplayState(
    pdfViewportState: PdfViewportState,
    annotations: SparseArray<List<KeyedPdfAnnotation>>
)

Updates both the content and the layout positioning of the annotations in a single atomic operation.

Protected functions

open Unit
onDraw(canvas: Canvas)
open Unit
onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int)
open Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

Public properties

AnnotationsView.AnnotationMode?

The current interaction mode, determining how touch events are handled for annotations.

Inherited functions

From android.view.View
Unit
addFocusables(views: ArrayList<View>, direction: Int)
Unit
Unit
Unit
ViewPropertyAnimator
Unit
Unit
Unit
Boolean
Boolean
awakenScrollBars(startDelay: Int)
Boolean
awakenScrollBars(startDelay: Int, invalidate: Boolean)
Unit
Unit
Unit
Unit
Boolean
open Boolean
open Boolean
open Boolean
Boolean
Boolean
Unit
Unit
Unit
Boolean
Unit
Unit
Unit
Int
Int
Int
Unit
WindowInsets
Int
Int
Int
AccessibilityNodeInfo
open Unit
Unit
Boolean
Boolean
dispatchNestedFling(velocityX: Float, velocityY: Float, consumed: Boolean)
Boolean
dispatchNestedPreFling(velocityX: Float, velocityY: Float)
Boolean
dispatchNestedPrePerformAccessibilityAction(
    action: Int,
    arguments: Bundle?
)
Boolean
dispatchNestedPreScroll(
    dx: Int,
    dy: Int,
    consumed: IntArray?,
    offsetInWindow: IntArray?
)
Boolean
dispatchNestedScroll(
    dxConsumed: Int,
    dyConsumed: Int,
    dxUnconsumed: Int,
    dyUnconsumed: Int,
    offsetInWindow: IntArray?
)
Boolean
Unit
draw(canvas: Canvas)
Unit
OnBackInvokedDispatcher?
T
<T : View> findViewById(id: Int)
T
<T : View> findViewWithTag(tag: Any)
Boolean
View
focusSearch(direction: Int)
Unit
forceHasOverlappingRendering(hasOverlappingRendering: Boolean)
Unit
Unit
generateDisplayHash(
    hashAlgorithm: String,
    bounds: Rect?,
    executor: Executor,
    callback: DisplayHashResultCallback
)
IntArray
Boolean
getClipBounds(outRect: Rect)
Bitmap
Unit
getDrawingRect(outRect: Rect)
ArrayList<View>
getFocusables(direction: Int)
Unit
Boolean
Boolean
getGlobalVisibleRect(r: Rect, globalOffset: Point)
Unit
getHitRect(outRect: Rect)
open Int
@ViewDebug.ExportedProperty(category = "layout", mapping = [@ViewDebug.IntToString(from = 0, to = "RESOLVED_DIRECTION_LTR"), @ViewDebug.IntToString(from = 1, to = "RESOLVED_DIRECTION_RTL")])
getLayoutDirection()
Boolean
Unit
Unit
Unit
ViewParent
open ViewParent
Any
getTag(key: Int)
open Int
@ViewDebug.ExportedProperty(category = "text", mapping = [@ViewDebug.IntToString(from = 0, to = "INHERIT"), @ViewDebug.IntToString(from = 1, to = "GRAVITY"), @ViewDebug.IntToString(from = 2, to = "TEXT_START"), @ViewDebug.IntToString(from = 3, to = "TEXT_END"), @ViewDebug.IntToString(from = 4, to = "CENTER"), @ViewDebug.IntToString(from = 5, to = "VIEW_START"), @ViewDebug.IntToString(from = 6, to = "VIEW_END")])
getTextAlignment()
open Int
@ViewDebug.ExportedProperty(category = "text", mapping = [@ViewDebug.IntToString(from = 0, to = "INHERIT"), @ViewDebug.IntToString(from = 1, to = "FIRST_STRONG"), @ViewDebug.IntToString(from = 2, to = "ANY_RTL"), @ViewDebug.IntToString(from = 3, to = "LTR"), @ViewDebug.IntToString(from = 4, to = "RTL"), @ViewDebug.IntToString(from = 5, to = "LOCALE"), @ViewDebug.IntToString(from = 6, to = "FIRST_STRONG_LTR"), @ViewDebug.IntToString(from = 7, to = "FIRST_STRONG_RTL")])
getTextDirection()
Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Unit
Unit
invalidate(dirty: Rect)
Unit
invalidate(l: Int, t: Int, r: Int, b: Int)
Unit
Unit
open Boolean
open Boolean
open Boolean
open Boolean
Boolean
open View
keyboardNavigationClusterSearch(currentCluster: View, direction: Int)
Unit
measure(widthMeasureSpec: Int, heightMeasureSpec: Int)
Unit
Unit
Unit
Unit
WindowInsets
Unit
Boolean
Boolean
Unit
Unit
InputConnection
Unit
onCreateViewTranslationRequest(
    supportedFormats: IntArray,
    requestsCollector: Consumer<ViewTranslationRequest>
)
Unit
onCreateVirtualViewTranslationRequests(
    virtualIds: LongArray,
    supportedFormats: IntArray,
    requestsCollector: Consumer<ViewTranslationRequest>
)
Unit
Boolean
Unit
Unit
Boolean
Unit
Unit
Unit
onFocusChanged(
    gainFocus: Boolean,
    direction: Int,
    previouslyFocusedRect: Rect?
)
Boolean
Unit
Boolean
Unit
Unit
Boolean
onKeyDown(keyCode: Int, event: KeyEvent)
Boolean
onKeyLongPress(keyCode: Int, event: KeyEvent)
Boolean
onKeyMultiple(keyCode: Int, repeatCount: Int, event: KeyEvent)
Boolean
onKeyPreIme(keyCode: Int, event: KeyEvent)
Boolean
onKeyShortcut(keyCode: Int, event: KeyEvent)
Boolean
onKeyUp(keyCode: Int, event: KeyEvent)
Unit
onOverScrolled(
    scrollX: Int,
    scrollY: Int,
    clampedX: Boolean,
    clampedY: Boolean
)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
ContentInfo?
Unit
Unit
onRtlPropertiesChanged(layoutDirection: Int)
Parcelable?
Unit
onScreenStateChanged(screenState: Int)
Unit
onScrollCaptureSearch(
    localVisibleRect: Rect,
    windowOffset: Point,
    targets: Consumer<ScrollCaptureTarget>
)
Unit
onScrollChanged(l: Int, t: Int, oldl: Int, oldt: Int)
Boolean
onSetAlpha(alpha: Int)
Unit
onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int)
Unit
Boolean
Unit
Unit
Unit
Unit
onVisibilityChanged(changedView: View, visibility: Int)
Unit
onWindowFocusChanged(hasWindowFocus: Boolean)
Unit
Unit
Boolean
overScrollBy(
    deltaX: Int,
    deltaY: Int,
    scrollX: Int,
    scrollY: Int,
    scrollRangeX: Int,
    scrollRangeY: Int,
    maxOverScrollX: Int,
    maxOverScrollY: Int,
    isTouchEvent: Boolean
)
Boolean
performAccessibilityAction(action: Int, arguments: Bundle?)
Boolean
Boolean
Boolean
Boolean
performHapticFeedback(feedbackConstant: Int)
Boolean
Boolean
performHapticFeedback(feedbackConstant: Int, flags: Int)
Boolean
Boolean
ContentInfo?
Unit
playSoundEffect(soundConstant: Int)
Boolean
post(action: Runnable)
Boolean
postDelayed(action: Runnable, delayMillis: Long)
Unit
Unit
postInvalidate(left: Int, top: Int, right: Int, bottom: Int)
Unit
postInvalidateDelayed(delayMilliseconds: Long)
Unit
postInvalidateDelayed(
    delayMilliseconds: Long,
    left: Int,
    top: Int,
    right: Int,
    bottom: Int
)
Unit
Unit
postInvalidateOnAnimation(left: Int, top: Int, right: Int, bottom: Int)
Unit
Unit
postOnAnimationDelayed(action: Runnable, delayMillis: Long)
Unit
Unit
Boolean
Unit
Unit
Unit
Unit
Unit
open Unit

This function is deprecated. Deprecated in Java

Boolean
Boolean
requestFocus(direction: Int)
Boolean
open Unit
Unit
Unit
Boolean
Boolean
requestRectangleOnScreen(rectangle: Rect, immediate: Boolean)
Boolean
requestRectangleOnScreen(rectangle: Rect, immediate: Boolean, source: Int)
Unit
Unit
T
<T : View> requireViewById(id: Int)
Unit
Unit
Unit
saveAttributeDataForStyleable(
    context: Context,
    styleable: IntArray,
    attrs: AttributeSet?,
    t: TypedArray,
    defStyleAttr: Int,
    defStyleRes: Int
)
Unit
Unit
scheduleDrawable(who: Drawable, what: Runnable, when: Long)
Unit
scrollBy(x: Int, y: Int)
Unit
scrollTo(x: Int, y: Int)
Unit
Unit
Unit
setAccessibilityDataSensitive(accessibilityDataSensitive: Int)
Unit
setAllowClickWhenDisabled(clickableWhenDisabled: Boolean)
Unit
Unit
Unit
setAutofillHints(vararg autofillHints: String)
Unit
Unit
Unit
Unit
Unit
setHandwritingBoundsOffsets(
    offsetLeft: Float,
    offsetTop: Float,
    offsetRight: Float,
    offsetBottom: Float
)
Unit
setHasTransientState(hasTransientState: Boolean)
Unit
setIsCredential(isCredential: Boolean)
Unit
setIsHandwritingDelegate(isHandwritingDelegate: Boolean)
Unit
Unit
setLayerType(layerType: Int, paint: Paint?)
Unit
setLeftTopRightBottom(left: Int, top: Int, right: Int, bottom: Int)
Unit
setMeasuredDimension(measuredWidth: Int, measuredHeight: Int)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
setOnReceiveContentListener(
    mimeTypes: Array<String>?,
    listener: OnReceiveContentListener?
)
Unit
Unit
Unit
Unit
setPadding(left: Int, top: Int, right: Int, bottom: Int)
Unit
setPaddingRelative(start: Int, top: Int, end: Int, bottom: Int)
Unit
Unit
setRenderEffect(renderEffect: RenderEffect?)
Unit
Unit
setScrollIndicators(indicators: Int, mask: Int)
Unit
setTag(key: Int, tag: Any)
Unit
Unit
Unit
setWillNotCacheDrawing(willNotCacheDrawing: Boolean)
Unit
setWillNotDraw(willNotDraw: Boolean)
Boolean
Boolean
ActionMode
ActionMode
Unit
Boolean
startDrag(
    data: ClipData,
    shadowBuilder: View.DragShadowBuilder,
    myLocalState: Any,
    flags: Int
)
Boolean
startDragAndDrop(
    data: ClipData,
    shadowBuilder: View.DragShadowBuilder,
    myLocalState: Any,
    flags: Int
)
Boolean
Unit
open String
Unit
Unit
Unit
Unit
Unit
Boolean
Boolean
Boolean
From android.view.ViewGroup
Unit
Unit
addExtraDataToAccessibilityNodeInfo(
    info: AccessibilityNodeInfo,
    extraDataKey: String,
    arguments: Bundle?
)
Unit
addFocusables(views: ArrayList<View>, direction: Int, focusableMode: Int)
Unit
addKeyboardNavigationClusters(
    views: MutableCollection<View>,
    direction: Int
)
Boolean
Unit
Unit
addView(child: View, width: Int, height: Int)
Boolean
addViewInLayout(child: View, index: Int, params: ViewGroup.LayoutParams)
Boolean
addViewInLayout(
    child: View,
    index: Int,
    params: ViewGroup.LayoutParams,
    preventRequestLayout: Boolean
)
Unit
attachLayoutAnimationParameters(
    child: View,
    params: ViewGroup.LayoutParams,
    index: Int,
    count: Int
)
Unit
attachViewToParent(child: View, index: Int, params: ViewGroup.LayoutParams)
Unit
Boolean
Boolean
Unit
Unit
childHasTransientStateChanged(
    child: View,
    childHasTransientState: Boolean
)
Unit
Unit
Unit
Unit
Unit
debug(depth: Int)
Unit
Unit
Unit
Unit
detachViewsFromParent(start: Int, count: Int)
WindowInsets
Boolean
Unit
Unit
dispatchCreateViewTranslationRequest(
    viewIds: MutableMap<AutofillIdLongArray>,
    supportedFormats: IntArray,
    capability: TranslationCapability,
    requests: MutableList<ViewTranslationRequest>
)
Unit
Boolean
Unit
Unit
Unit
Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
Unit
Unit
Unit
Unit
Unit
Unit
dispatchScrollCaptureSearch(
    localVisibleRect: Rect,
    windowOffset: Point,
    targets: Consumer<ScrollCaptureTarget>
)
Unit
Unit
Unit
Unit
Unit
Unit
Boolean
Boolean
Boolean
dispatchUnhandledMove(focused: View, direction: Int)
Unit
dispatchVisibilityChanged(changedView: View, visibility: Int)
Unit
Unit
Unit
WindowInsets
WindowInsetsAnimation.Bounds
Unit
Unit
Boolean
drawChild(canvas: Canvas, child: View, drawingTime: Long)
Unit
Unit
View
OnBackInvokedDispatcher?
Unit
findViewsWithText(
    outViews: ArrayList<View>,
    text: CharSequence,
    flags: Int
)
View
focusSearch(focused: View, direction: Int)
Unit
Boolean
ViewGroup.LayoutParams
ViewGroup.LayoutParams
ViewGroup.LayoutParams
View
getChildAt(index: Int)
Int
getChildDrawingOrder(drawingPosition: Int)
Int
getChildDrawingOrder(childCount: Int, drawingPosition: Int)
Boolean
Boolean
getChildVisibleRect(child: View, r: Rect, offset: Point)
Boolean
Boolean
Int
Unit
invalidateChild(child: View, dirty: Rect)
ViewParent
invalidateChildInParent(location: IntArray, dirty: Rect)
Unit
Unit
layout(l: Int, t: Int, r: Int, b: Int)
Unit
measureChild(
    child: View,
    parentWidthMeasureSpec: Int,
    parentHeightMeasureSpec: Int
)
Unit
measureChildWithMargins(
    child: View,
    parentWidthMeasureSpec: Int,
    widthUsed: Int,
    parentHeightMeasureSpec: Int,
    heightUsed: Int
)
Unit
measureChildren(widthMeasureSpec: Int, heightMeasureSpec: Int)
Unit
notifySubtreeAccessibilityStateChanged(
    child: View,
    source: View,
    changeType: Int
)
Unit
Unit
Unit
IntArray
Unit
onDescendantInvalidated(child: View, target: View)
Unit
Boolean
Boolean
Boolean
onNestedFling(
    target: View,
    velocityX: Float,
    velocityY: Float,
    consumed: Boolean
)
Boolean
onNestedPreFling(target: View, velocityX: Float, velocityY: Float)
Boolean
onNestedPrePerformAccessibilityAction(
    target: View,
    action: Int,
    args: Bundle?
)
Unit
onNestedPreScroll(target: View, dx: Int, dy: Int, consumed: IntArray)
Unit
onNestedScroll(
    target: View,
    dxConsumed: Int,
    dyConsumed: Int,
    dxUnconsumed: Int,
    dyUnconsumed: Int
)
Unit
onNestedScrollAccepted(child: View, target: View, axes: Int)
Boolean
onRequestFocusInDescendants(direction: Int, previouslyFocusedRect: Rect)
Boolean
PointerIcon
onResolvePointerIcon(event: MotionEvent, pointerIndex: Int)
Boolean
onStartNestedScroll(child: View, target: View, nestedScrollAxes: Int)
Unit
Unit
onViewAdded(child: View)
Unit
Unit
propagateRequestedFrameRate(frameRate: Float, forceOverride: Boolean)
Unit
Unit
Unit
Unit
removeDetachedView(child: View, animate: Boolean)
Unit
Unit
removeViewAt(index: Int)
Unit
Unit
removeViews(start: Int, count: Int)
Unit
removeViewsInLayout(start: Int, count: Int)
Unit
requestChildFocus(child: View, focused: View)
Boolean
requestChildRectangleOnScreen(
    child: View,
    rectangle: Rect,
    immediate: Boolean
)
Unit
Boolean
requestFocus(direction: Int, previouslyFocusedRect: Rect)
Boolean
Unit
Boolean
Unit
Unit
Unit
Unit
Unit
Unit
Boolean
Boolean
Boolean
showContextMenuForChild(originalView: View, x: Float, y: Float)
ActionMode
startActionModeForChild(
    originalView: View,
    callback: ActionMode.Callback
)
ActionMode
startActionModeForChild(
    originalView: View,
    callback: ActionMode.Callback,
    type: Int
)
Unit
Unit
Unit
Unit
From android.view.ViewParent
Boolean
requestChildRectangleOnScreen(
    child: View,
    rectangle: Rect,
    immediate: Boolean,
    source: Int
)

Inherited properties

From android.view.View
open View.AccessibilityDelegate
open Int
open AccessibilityNodeProvider
open CharSequence?
open Int
open Int
open String?
open String?
open Float
open Animation
open Matrix?
open IBinder
open MutableMap<IntInt>
open Array<String>?
AutofillId
open Int
open AutofillValue?
open Drawable
open BlendMode?
open ColorStateList?
open PorterDuff.Mode?
open Int
Int
open Float
open Int
open Float
open Rect
Boolean
ContentCaptureSession?
open CharSequence
Int
Context
open ContextMenu.ContextMenuInfo
Boolean
open Display
IntArray
open Bitmap
open Int
open Int
open Long
open Float
open Int
open Boolean
open Boolean
open Int
open Drawable
open Int
open BlendMode?
open ColorStateList?
open PorterDuff.Mode?
open Float
open Handler
open Float
open Float
open Float
open Float
open Int
open Runnable?
Boolean
Int
open Int
open Int
open Drawable?
open Drawable?
open Int
open Int
open Int
open Int
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
Boolean
Boolean
open Boolean
Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
Boolean
Boolean
open Boolean
open Boolean
open Boolean
Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
Boolean
open Boolean
open Boolean
Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open Boolean
open KeyEvent.DispatcherState
open Int
open Int
open Int
open ViewGroup.LayoutParams
Int
open Float
open Int
open Matrix
Int
Int
Int
Int
Int
open Int
open Int
open Int
open Int
open Int
open Int
open Int
open Int
open View.OnFocusChangeListener
open Int
open ViewOutlineProvider
open Int
open Int
open Int
open Int
open Int
open Int
open Int
open Int
final ViewParent
open ViewParent
OutcomeReceiver<GetCredentialResponseGetCredentialException>?
GetCredentialRequest?
open Float
open Float
open PointerIcon
MutableList<Rect>
open Array<String>?
open Float
open Resources
Boolean
Int
open Float
open Int
open AttachedSurfaceControl?
open View
open WindowInsets
open Float
open Float
open Float
open Float
open Float
open Int
open Int
open Int
open Int
open Int
open Int
Int
Int
open Int
open Int
CharSequence?
open StateListAnimator
open Int
open Int
open CharSequence?
open MutableList<Rect>
open Int
open Any
open Int
open Int
open CharSequence?
Int
open Float
open Int
open TouchDelegate
open ArrayList<View>
open Float
open String
open Float
open Float
open Float
open Long
open Int
open Int
open Drawable?
open Drawable?
open Int
open ViewTranslationResponse?
open ViewTreeObserver
open Int
Int
open Int
open WindowId
open WindowInsetsController?
open Int
open IBinder
open Int
open Float
open Float
open Float
From android.view.ViewGroup

Public constructors

AnnotationsView

Added in 1.0.0-alpha19
AnnotationsView(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
)

Public functions

addOnAnnotationEditListener

Added in 1.0.0-alpha19
fun addOnAnnotationEditListener(
    listener: AnnotationsView.OnAnnotationEditListener
): Unit

Adds a listener for events related to the finalized creation or failure of annotations.

Registered listeners will be notified when an in-progress interaction successfully produces a new PdfAnnotation, or if an error occurs during the process.

Parameters
listener: AnnotationsView.OnAnnotationEditListener

The listener to be added to the registry.

addOnAnnotationLocatedListener

Added in 1.0.0-alpha19
fun addOnAnnotationLocatedListener(
    listener: AnnotationsView.OnAnnotationLocatedListener
): Unit

Adds a listener for annotation hit events.

addView

open fun addView(child: View?): Unit

addView

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

addView

open fun addView(child: View?, params: ViewGroup.LayoutParams?): Unit

addView

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

onTouchEvent

open fun onTouchEvent(event: MotionEvent?): Boolean

removeOnAnnotationEditListener

Added in 1.0.0-alpha19
fun removeOnAnnotationEditListener(
    listener: AnnotationsView.OnAnnotationEditListener
): Unit

Removes a listener that was previously added via addOnAnnotationEditListener.

removeOnAnnotationLocatedListener

Added in 1.0.0-alpha19
fun removeOnAnnotationLocatedListener(
    listener: AnnotationsView.OnAnnotationLocatedListener
): Unit

Removes a listener that was previously added via addOnAnnotationLocatedListener.

setOnGestureClaimListener

Added in 1.0.0-alpha19
fun setOnGestureClaimListener(
    listener: AnnotationsView.OnGestureClaimListener?
): Unit

Sets a listener to be notified when this view claims or abandons the current gesture stream.

Parameters
listener: AnnotationsView.OnGestureClaimListener?

The listener to receive gesture coordination signals, or null to clear.

setTextBoundsProvider

Added in 1.0.0-alpha19
fun setTextBoundsProvider(textBoundsProvider: TextBoundsProvider): Unit

Sets the TextBoundsProvider used to retrieve text boundary information during highlighting.

Parameters
textBoundsProvider: TextBoundsProvider

The provider implementation to be used for text boundary lookups.

updateDisplayState

Added in 1.0.0-alpha19
@MainThread
fun updateDisplayState(
    pdfViewportState: PdfViewportState,
    annotations: SparseArray<List<KeyedPdfAnnotation>>
): Unit

Updates both the content and the layout positioning of the annotations in a single atomic operation.

Parameters
pdfViewportState: PdfViewportState

The latest layout snapshot (zoom, scroll, and pagebounds) from the PDF renderer.

annotations: SparseArray<List<KeyedPdfAnnotation>>

A SparseArray indexed with page num containing the list of KeyedPdfAnnotation objects to be rendered.

Protected functions

onDraw

protected open fun onDraw(canvas: Canvas): Unit

onLayout

protected open fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int): Unit

onMeasure

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

Public properties

interactionMode

Added in 1.0.0-alpha19
var interactionModeAnnotationsView.AnnotationMode?

The current interaction mode, determining how touch events are handled for annotations.

Set to AnnotationMode.Select to enable selecting existing annotations, or AnnotationMode.Highlight to create new text highlights. If null, touch interactions for annotations are disabled on AnnotationsView and its children.

This property must only be modified on the UI thread.