public class

RedactionView

extends FrameLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.pspdfkit.ui.redaction.RedactionView

Class Overview

Responsible for the UI used to apply redactions.

Summary

Nested Classes
interface RedactionView.OnRedactionButtonVisibilityChangedListener Listener receiving calls when redaction button collapses or expands. 
interface RedactionView.RedactionViewListener Listener receiving calls when redaction events are triggered. 
Constants
int REDACTION_BUTTON_ICON_WIDTH_DP Redaction button icon width that does not slide out of the screen and remain visible.
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
RedactionView(Context context)
RedactionView(Context context, AttributeSet attrs)
RedactionView(Context context, AttributeSet attrs, int defStyleAttr)
RedactionView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
void collapseRedactionOptions(boolean animateRedactionButton)
Collapses redaction menu options if expanded and animates redaction button.
int getRedactionButtonWidth()
Returns the width in pixels of the redaction button.
boolean isButtonRedactionButtonVisible()
Returns true if redaction button is visible.
boolean isRedactionAnnotationPreviewEnabled()
Returns whether the redaction annotation preview mode is enabled or not.
boolean isRedactionButtonExpanded()
Returns true if redaction button is visible and expanded.
void setBottomOffset(int bottomOffset)
Sets the bottom offset for the redaction button, used to make sure it doesn't overlay any other view.
void setListener(RedactionView.RedactionViewListener listener)
Sets the RedactionView.RedactionViewListener to notify when an action was clicked.
void setOnRedactionButtonVisibilityChangedListener(RedactionView.OnRedactionButtonVisibilityChangedListener onRedactionButtonVisibilityChangedListener)
Sets the RedactionView.OnRedactionButtonVisibilityChangedListener to notify when the redaction button collapses or expands.
void setRedactionAnnotationPreviewEnabled(boolean enable)
Enables or disables redaction annotation preview mode.
void setRedactionButtonVisible(boolean visible, boolean animate)
Shows the button used to open the redaction menu.
Protected Methods
boolean fitSystemWindows(Rect insets)
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Constants

public static final int REDACTION_BUTTON_ICON_WIDTH_DP

Redaction button icon width that does not slide out of the screen and remain visible.

Constant Value: 48 (0x00000030)

Public Constructors

public RedactionView (Context context)

public RedactionView (Context context, AttributeSet attrs)

public RedactionView (Context context, AttributeSet attrs, int defStyleAttr)

public RedactionView (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public Methods

public void collapseRedactionOptions (boolean animateRedactionButton)

Collapses redaction menu options if expanded and animates redaction button.

Parameters
animateRedactionButton if true animate redaction button moving it partially outside the view.

public int getRedactionButtonWidth ()

Returns the width in pixels of the redaction button.

Returns
  • the width in pixels of the redaction button.

public boolean isButtonRedactionButtonVisible ()

Returns true if redaction button is visible.

Returns
  • true if redaction button is visible.

public boolean isRedactionAnnotationPreviewEnabled ()

Returns whether the redaction annotation preview mode is enabled or not.

Returns
  • true if redaction annotation preview mode is enabled, false otherwise.

public boolean isRedactionButtonExpanded ()

Returns true if redaction button is visible and expanded.

Returns
  • true if redaction button is visible and expanded.

public void setBottomOffset (int bottomOffset)

Sets the bottom offset for the redaction button, used to make sure it doesn't overlay any other view.

Parameters
bottomOffset The offset to apply from the bottom in px.

public void setListener (RedactionView.RedactionViewListener listener)

Sets the RedactionView.RedactionViewListener to notify when an action was clicked.

Parameters
listener The RedactionView.RedactionViewListener to notify or null to clear the listener.

public void setOnRedactionButtonVisibilityChangedListener (RedactionView.OnRedactionButtonVisibilityChangedListener onRedactionButtonVisibilityChangedListener)

Sets the RedactionView.OnRedactionButtonVisibilityChangedListener to notify when the redaction button collapses or expands.

Parameters
onRedactionButtonVisibilityChangedListener to notify or null to clear the listener.

public void setRedactionAnnotationPreviewEnabled (boolean enable)

Enables or disables redaction annotation preview mode.

Parameters
enable true to show redaction annotations as redacted, false to show them as marks.

public void setRedactionButtonVisible (boolean visible, boolean animate)

Shows the button used to open the redaction menu.

Parameters
visible true to make the button visible, false to hide it again.
animate true to perform an animation when showing it, false otherwise.

Protected Methods

protected boolean fitSystemWindows (Rect insets)