Class RedactionView
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.view.KeyEvent.Callback
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
public class RedactionView extends FrameLayout
Responsible for the UI used to apply redactions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
RedactionView.RedactionViewListener
Listener receiving calls when redaction events are triggered.
-
Field Summary
Fields Modifier and Type Field Description public final static int
REDACTION_BUTTON_ICON_WIDTH_DP
-
Constructor Summary
Constructors Constructor Description RedactionView(Context context)
RedactionView(Context context, AttributeSet attrs)
RedactionView(Context context, AttributeSet attrs, int defStyleAttr)
RedactionView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
Method Summary
Modifier and Type Method Description void
collapseRedactionOptions()
Collapses redaction menu options if expanded void
setRedactionButtonVisible(boolean visible, boolean animate)
Shows the button used to open the redaction menu. boolean
isRedactionButtonExpanded()
Returns true
if redaction button is visible and expanded.boolean
isButtonRedactionButtonVisible()
Returns true
if redaction button is visible.void
setBottomOffset(int bottomOffset)
Sets the bottom offset for the redaction button, used to make sure it doesn't overlay any other view. int
getRedactionButtonWidth()
Returns the width in pixels of the redaction button. void
setListener(@Nullable() RedactionView.RedactionViewListener listener)
Sets the RedactionViewListener to notify when an action was clicked. boolean
isRedactionAnnotationPreviewEnabled()
Returns whether the redaction annotation preview mode is enabled or not. void
setRedactionAnnotationPreviewEnabled(boolean enable)
Enables or disables redaction annotation preview mode. -
-
Constructor Detail
-
RedactionView
RedactionView(Context context)
-
RedactionView
RedactionView(Context context, AttributeSet attrs)
-
RedactionView
RedactionView(Context context, AttributeSet attrs, int defStyleAttr)
-
RedactionView
RedactionView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
-
Method Detail
-
collapseRedactionOptions
void collapseRedactionOptions()
Collapses redaction menu options if expanded
-
setRedactionButtonVisible
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.
-
isRedactionButtonExpanded
boolean isRedactionButtonExpanded()
Returns
true
if redaction button is visible and expanded.- Returns:
true
if redaction button is visible and expanded.
-
isButtonRedactionButtonVisible
boolean isButtonRedactionButtonVisible()
Returns
true
if redaction button is visible.- Returns:
true
if redaction button is visible.
-
setBottomOffset
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.
-
getRedactionButtonWidth
int getRedactionButtonWidth()
Returns the width in pixels of the redaction button.
- Returns:
the width in pixels of the redaction button.
-
setListener
void setListener(@Nullable() RedactionView.RedactionViewListener listener)
Sets the RedactionViewListener to notify when an action was clicked.
- Parameters:
listener
- The RedactionViewListener to notify ornull
to clear the listener.
-
isRedactionAnnotationPreviewEnabled
boolean isRedactionAnnotationPreviewEnabled()
Returns whether the redaction annotation preview mode is enabled or not.
- Returns:
true
if redaction annotation preview mode is enabled,false
otherwise.
-
setRedactionAnnotationPreviewEnabled
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.
-
-
-
-