Class ContentEditingStylingBar
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.view.KeyEvent.Callback
,android.view.View.OnClickListener
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
,android.widget.CompoundButton.OnCheckedChangeListener
,android.widget.RadioGroup.OnCheckedChangeListener
,com.pspdfkit.ui.special_mode.manager.ContentEditingManager.OnContentEditingContentChangeListener
,com.pspdfkit.ui.special_mode.manager.ContentEditingManager.OnContentEditingModeChangeListener
public class ContentEditingStylingBar extends FrameLayout implements View.OnClickListener, ContentEditingManager.OnContentEditingModeChangeListener, ContentEditingManager.OnContentEditingContentChangeListener, RadioGroup.OnCheckedChangeListener, CompoundButton.OnCheckedChangeListener
Bottom auxiliary bar displayed when editing documents. Provides buttons for increasing and reducing the font size and clearing fields
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ContentEditingStylingBar.OnContentEditingBarLifecycleListener
Listener for the lifecycle of the ContentEditingStylingBar.
-
Field Summary
Fields Modifier and Type Field Description public boolean
isDisplayed
-
Constructor Summary
Constructors Constructor Description ContentEditingStylingBar(Context context)
ContentEditingStylingBar(Context context, AttributeSet attrs)
ContentEditingStylingBar(Context context, AttributeSet attrs, int defStyleAttr)
ContentEditingStylingBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
Method Summary
Modifier and Type Method Description boolean
isDisplayed()
True when content editing bar is currently displayed on the screen. void
setVisibility(int visibility)
void
onClick(View v)
void
addOnContentEditingBarLifecycleListener(@NonNull() ContentEditingStylingBar.OnContentEditingBarLifecycleListener listener)
Adds an OnContentEditingBarLifecycleListener for listening to the content editing bar lifecycle. void
removeOnContentEditingBarLifecycleListener(@NonNull() ContentEditingStylingBar.OnContentEditingBarLifecycleListener listener)
Removes a previously added OnContentEditingBarLifecycleListener. void
bindController(@NonNull() ContentEditingController controller)
Binds to form editing controller. void
unbindController()
Unbinds from content editing controller. void
onEnterContentEditingMode(@NonNull() ContentEditingController controller)
Called when entering content editing mode. void
onExitContentEditingMode(@NonNull() ContentEditingController controller)
Called when exiting text selection mode. int
getBackgroundColor()
Returns background color set to the content editing bar. void
setBackgroundColor(int backgroundColor)
Sets background color to the content editing bar. void
setFontNameText(@NonNull() String fontName, boolean isFontResolved)
Sets the name of the font void
setFontSizeText(String fontSize, String fontSizeUnit)
Sets the size of the font void
setTextColor(int textColor)
Sets color of the text on this content editing bar and the font color image void
setIconsColor(int iconColor)
Sets color of the icons on this content editing styling bar. void
setFontButtonsColor(int fontButtonsColor)
Sets the background color of the font name and size buttons void
setFontButtonsColorChecked(int fontButtonsColorChecked)
Sets the checked background color of checkable buttons (bold/italic) void
setFontSmallButtonsColor(int fontSmallButtonsColor)
void
setIconBorderColor(int iconBorderColor)
Sets the color of the border around the font icon filled image void
onCheckedChanged(CompoundButton buttonView, boolean isChecked)
void
onCheckedChanged(RadioGroup group, int checkedId)
void
onContentSelectionChange(UUID contentId, int selStart, int selEnd, StyleInfo styleInfo, boolean styleWasChanged)
Called when the cursor position/selection has changed Mainly used to update the content editing toolbar to show the proper text style for the current cursor position. void
onStartEditingContentBlock(UUID contentId)
Called when the provided block goes into editing mode (need to change the frame style and display the editing widget now) void
onFinishEditingContentBlock(UUID contentId)
Called when the provided block goes out of editing mode (loses focus, or global content editing mode is being finished) void
onTextBlockStyleChange(UUID contentId, TextBlockStyleInfo textBlockStyleInfo)
Called when a style that affects the whole textblock has successfully been changed. -
-
Constructor Detail
-
ContentEditingStylingBar
ContentEditingStylingBar(Context context)
-
ContentEditingStylingBar
ContentEditingStylingBar(Context context, AttributeSet attrs)
-
ContentEditingStylingBar
ContentEditingStylingBar(Context context, AttributeSet attrs, int defStyleAttr)
-
ContentEditingStylingBar
ContentEditingStylingBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
-
Method Detail
-
isDisplayed
boolean isDisplayed()
True when content editing bar is currently displayed on the screen.
-
setVisibility
void setVisibility(int visibility)
-
addOnContentEditingBarLifecycleListener
void addOnContentEditingBarLifecycleListener(@NonNull() ContentEditingStylingBar.OnContentEditingBarLifecycleListener listener)
Adds an OnContentEditingBarLifecycleListener for listening to the content editing bar lifecycle. If the listener has already been added previously, this method will be a no-op. Passing
null
is not allowed and will result in an exception.- Parameters:
listener
- OnContentEditingBarLifecycleListener that should be notified.
-
removeOnContentEditingBarLifecycleListener
void removeOnContentEditingBarLifecycleListener(@NonNull() ContentEditingStylingBar.OnContentEditingBarLifecycleListener listener)
Removes a previously added OnContentEditingBarLifecycleListener. Upon calling this method the
listener
will no longer be notified of any lifecycle changes. If the listener has not been added previously, this method will be a no-op. Passingnull
is not allowed, and will result in an exception.- Parameters:
listener
- OnContentEditingBarLifecycleListener that should be removed.
-
bindController
void bindController(@NonNull() ContentEditingController controller)
Binds to form editing controller. Animates form editing bar into view.
-
unbindController
void unbindController()
Unbinds from content editing controller. Animates content editing bar out of view.
-
onEnterContentEditingMode
void onEnterContentEditingMode(@NonNull() ContentEditingController controller)
Called when entering content editing mode.
- Parameters:
controller
- Provided controller for content editing mode mode actions.
-
onExitContentEditingMode
void onExitContentEditingMode(@NonNull() ContentEditingController controller)
Called when exiting text selection mode.
- Parameters:
controller
- Provided controller for text selection mode actions.
-
getBackgroundColor
int getBackgroundColor()
Returns background color set to the content editing bar.
- Returns:
Background color applied to this content editing bar.
-
setBackgroundColor
void setBackgroundColor(int backgroundColor)
Sets background color to the content editing bar.
- Parameters:
backgroundColor
- Background color to be applied to this content editing bar.
-
setFontNameText
void setFontNameText(@NonNull() String fontName, boolean isFontResolved)
Sets the name of the font
- Parameters:
fontName
- the current font nameisFontResolved
- indicates if we have a proper font match.
-
setFontSizeText
void setFontSizeText(String fontSize, String fontSizeUnit)
Sets the size of the font
- Parameters:
fontSize
- the current font sizefontSizeUnit
- the current font size unit used like pt
-
setTextColor
void setTextColor(int textColor)
Sets color of the text on this content editing bar and the font color image
- Parameters:
textColor
- Text color on content editing bar.
-
setIconsColor
void setIconsColor(int iconColor)
Sets color of the icons on this content editing styling bar.
- Parameters:
iconColor
- Tint of the icons on the bar.
-
setFontButtonsColor
void setFontButtonsColor(int fontButtonsColor)
Sets the background color of the font name and size buttons
- Parameters:
fontButtonsColor
- the background color to use for the font buttons.
-
setFontButtonsColorChecked
void setFontButtonsColorChecked(int fontButtonsColorChecked)
Sets the checked background color of checkable buttons (bold/italic)
- Parameters:
fontButtonsColorChecked
- the checked background color to use for the buttons.
-
setFontSmallButtonsColor
void setFontSmallButtonsColor(int fontSmallButtonsColor)
-
setIconBorderColor
void setIconBorderColor(int iconBorderColor)
Sets the color of the border around the font icon filled image
- Parameters:
iconBorderColor
- the color of the border around the font icon filled image
-
onCheckedChanged
void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
-
onCheckedChanged
void onCheckedChanged(RadioGroup group, int checkedId)
-
onContentSelectionChange
void onContentSelectionChange(UUID contentId, int selStart, int selEnd, StyleInfo styleInfo, boolean styleWasChanged)
Called when the cursor position/selection has changed Mainly used to update the content editing toolbar to show the proper text style for the current cursor position.
- Parameters:
contentId
- id of the content blockselStart
- start position of the selectionselEnd
- end position of the selection, also the cursor positionstyleInfo
- style info of the content block
-
onStartEditingContentBlock
void onStartEditingContentBlock(UUID contentId)
Called when the provided block goes into editing mode (need to change the frame style and display the editing widget now)
- Parameters:
contentId
- id of the content block
-
onFinishEditingContentBlock
void onFinishEditingContentBlock(UUID contentId)
Called when the provided block goes out of editing mode (loses focus, or global content editing mode is being finished)
- Parameters:
contentId
- id of the content block
-
onTextBlockStyleChange
void onTextBlockStyleChange(UUID contentId, TextBlockStyleInfo textBlockStyleInfo)
Called when a style that affects the whole textblock has successfully been changed.
- Parameters:
contentId
- id of the changed content blocktextBlockStyleInfo
- style info of the changed content block
-
-
-
-