9package org.libreoffice.overlay;
11import android.content.Context;
12import android.graphics.Canvas;
13import android.graphics.Color;
14import android.graphics.Paint;
15import android.graphics.PointF;
16import android.graphics.RectF;
17import android.util.AttributeSet;
18import android.view.MotionEvent;
19import android.view.View;
36import java.util.ArrayList;
85 super(context, attrs);
89 super(context, attrs, defStyleAttr);
97 setOnTouchListener(
this);
296 if (page.top < midPoint.y && midPoint.y < page.bottom) {
372 public boolean onTouch(View view, MotionEvent event) {
373 PointF
point =
new PointF(event.getX(), event.getY());
374 switch (event.getActionMasked()) {
375 case MotionEvent.ACTION_DOWN: {
415 case MotionEvent.ACTION_UP: {
433 case MotionEvent.ACTION_MOVE: {
Main activity of the LibreOffice App.
void dragStart(PointF point)
void dragEnd(PointF point)
void setScreenRect(RectF position)
void dragging(PointF point)
final RectF mDocumentPosition
void reposition(float x, float y)
Change the position of the handle.
CalcSelectionBox is the selection frame for the current highlighted area/cells in Calc.
void dragEnd(PointF point)
End of a touch and drag action on the box.
void reposition(RectF rect)
void dragging(PointF point)
Box has been dragged.
boolean contains(float x, float y)
Hit test.
void dragStart(PointF point)
Start of a touch and drag action on the box.
boolean contains(float x, float y)
Hit test.
void setVisible(boolean visible)
Set element visibility.
void draw(Canvas canvas)
Trigger drawing the element on the canvas.
boolean isVisible()
Is element visible?
Handles the cursor drawing on the canvas.
void cycleAlpha()
Cycle the alpha color of the cursor, makes the.
void reposition(RectF rect)
Reposition the cursor on screen.
This class is responsible to draw and reposition the selection rectangle.
void dragging(PointF position)
Dragging is in process.
void dragStart(PointF position)
Dragging on the screen has started.
void setVisible(boolean visible)
Set the visibility of the graphic selection.
void reset()
Reset the selection.
void dragEnd(PointF position)
Dragging has ended.
void reposition(RectF scaledRectangle)
Viewport has changed, reposition the selection to the new rectangle.
void setPageNumberString(String pageNumberString)
Selection handle for showing and manipulating the end of a selection.
Selection handle that is used to manipulate the cursor.
Selection handle for showing and manipulating the start of a selection.
Selection handle is a common class for "start", "middle" and "end" types of selection handles.
void dragEnd(PointF point)
End of a touch and drag action on the handle.
void dragging(PointF point)
Handle has been dragged.
void dragStart(PointF point)
Start of a touch and drag action on the handle.
Document overlay view is responsible for showing the client drawn overlay elements like cursor,...
static final String LOGTAG
SelectionHandle mHandleMiddle
DocumentOverlayView(Context context)
void showGraphicSelection()
Show the graphic selection on the view.
SelectionHandle mDragHandle
CalcSelectionBox mCalcSelectionBox
void setCalcHeadersController(CalcHeadersController calcHeadersController)
static RectF convertToScreen(RectF inputRect, float x, float y, float zoom)
Convert the input rectangle from document to screen coordinates according to current viewport data (x...
List< RectF > mPartPageRectangles
void showPageNumberRect()
Calculate and show page number according to current viewport position.
boolean mPageNumberAvailable
static final int CURSOR_BLINK_TIME
List< RectF > mSelections
SelectionHandle mHandleStart
void showCellSelection(RectF cellCursorRect)
void changeSelections(List< RectF > selectionRects)
Change the text selection rectangles.
void hideHandle(SelectionHandle.HandleType type)
Hide the handle.
void showHandle(SelectionHandle.HandleType type)
Show the handle.
PageNumberRect mPageNumberRect
SelectionHandle mHandleEnd
void changeCursorPosition(RectF position)
Change the cursor position.
List< RectF > mScaledSelections
boolean mGraphicSelectionMove
void hideGraphicSelection()
Hide the graphic selection.
boolean mSelectionsVisible
void showAdjustLengthLine(boolean isRow, final CalcHeadersView view)
boolean onTouch(View view, MotionEvent event)
Handle the triggered touch event.
void initialize(LayerView layerView)
Initialize the selection and cursor view.
void setPartPageRectangles(List< RectF > rectangles)
Set part page rectangles and initialize a page number rectangle object (canvas element).
void hideSelections()
Hide text selection rectangles.
void showSelections()
Show text selection rectangles.
CalcHeadersController mCalcHeadersController
AdjustLengthLine mAdjustLengthLine
void changeGraphicSelection(RectF rectangle)
Change the graphic selection rectangle.
void onDraw(Canvas canvas)
Drawing on canvas.
void showCursor()
Show the cursor on the view.
void hideCursor()
Hide the cursor.
Runnable cursorAnimation
Cursor animation function.
boolean mAdjustLengthLineDragging
SelectionHandle getHandleForType(SelectionHandle.HandleType type)
Returns the handle instance for the input type.
boolean mCalcSelectionBoxDragging
RectF getCurrentCursorPosition()
void repositionWithViewport(float x, float y, float zoom)
GraphicSelection mGraphicSelection
DocumentOverlayView(Context context, AttributeSet attrs)
void positionHandle(SelectionHandle.HandleType type, RectF position)
Change the handle document position.
void showHeaderSelection(RectF rect)
DocumentOverlayView(Context context, AttributeSet attrs, int defStyleAttr)
void hidePageNumberRect()
Hide page number rectangle canvas element.
PointF convertViewPointToLayerPoint(PointF viewPoint)
ImmutableViewportMetrics are used to store the viewport metrics in way that we can access a version o...
final float viewportRectLeft
final float viewportRectTop
A view rendered by the layer compositor.
GeckoLayerClient getLayerClient()
ImmutableViewportMetrics getViewportMetrics()
static RectF scale(RectF rect, float scale)
static void assign(final RectF target, final RectF source)
Assign rectangle values from source to target.
static boolean fuzzyEquals(RectF a, RectF b)
def run(arg=None, arg2=-1)