Class AnnotationEditor
-
- All Implemented Interfaces:
public class AnnotationEditor
For internal usage only.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
AnnotationEditor.OnDismissedListener
Listener to be called once the annotation editor has been dismissed. Also used to notify if the user asked to remove the edited annotation from the document.
-
Field Summary
Fields Modifier and Type Field Description public final static String
FRAGMENT_EDITOR_TAG
-
Method Summary
Modifier and Type Method Description static AnnotationEditor
forAnnotation(@NonNull() Annotation annotation, @NonNull() PdfFragment fragment, @NonNull() OnEditRecordedListener onEditRecordedListener)
Create an editor for the given annotation
.static AnnotationEditor
restoreFromState(@NonNull() PdfFragment fragment, @NonNull() OnEditRecordedListener onEditRecordedListener)
Restore and retrieve a previously created annotation editor instance. void
show(boolean readOnly)
Show the annotation editor. void
show()
Show the annotation editor. Maybe<Annotation>
getAnnotation(@NonNull() PdfDocument document)
void
setOnDismissedListener(@Nullable() AnnotationEditor.OnDismissedListener onDismissedListener)
Sets a listener to be notified of a cancellation. -
-
Method Detail
-
forAnnotation
@Nullable() static AnnotationEditor forAnnotation(@NonNull() Annotation annotation, @NonNull() PdfFragment fragment, @NonNull() OnEditRecordedListener onEditRecordedListener)
Create an editor for the given
annotation
.- Parameters:
annotation
- The annotation to edit.fragment
- PdfFragment instance.onEditRecordedListener
- The listener used to report edits.- Returns:
An annotation editor, if available for the given annotation, or
null
if no suitable annotation editor is available.
-
restoreFromState
@Nullable() static AnnotationEditor restoreFromState(@NonNull() PdfFragment fragment, @NonNull() OnEditRecordedListener onEditRecordedListener)
Restore and retrieve a previously created annotation editor instance. Call this method as soon as the document has been loaded, to restore any previously created annotation editor from the saved instance state. This method will return
null
if no editor was restored.- Parameters:
fragment
- PdfFragment instance.onEditRecordedListener
- The listener used to report edits.- Returns:
The restored annotation editor, or
null
if no editor was restored.
-
show
@MainThread() void show(boolean readOnly)
Show the annotation editor.
- Parameters:
readOnly
- if true, the annotation editor will start in read only mode (if such exists for the given annotation).
-
show
void show()
Show the annotation editor.
-
getAnnotation
@NonNull() Maybe<Annotation> getAnnotation(@NonNull() PdfDocument document)
-
setOnDismissedListener
void setOnDismissedListener(@Nullable() AnnotationEditor.OnDismissedListener onDismissedListener)
Sets a listener to be notified of a cancellation. Calling this method will replace any previously set listener. You may provide
null
to clear the listener.- Parameters:
onDismissedListener
- OnDismissedListener that should be notified, ornull
to clear the listener.
-
-
-
-