Class FormEditingBar
-
- 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
,com.pspdfkit.ui.special_mode.manager.FormManager.OnFormElementEditingModeChangeListener
,com.pspdfkit.ui.special_mode.manager.FormManager.OnFormElementUpdatedListener
,com.pspdfkit.ui.special_mode.manager.FormManager.OnFormElementViewUpdatedListener
public class FormEditingBar extends FrameLayout implements View.OnClickListener, FormManager.OnFormElementUpdatedListener, FormManager.OnFormElementEditingModeChangeListener, FormManager.OnFormElementViewUpdatedListener
Bottom auxiliary bar displayed when filling forms. Provides buttons for navigating between form fields in tab order, clearing form field and finishing with form editing.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
FormEditingBar.OnFormEditingBarLifecycleListener
Listener for the lifecycle of the FormEditingBar.
-
Field Summary
Fields Modifier and Type Field Description public boolean
isDisplayed
-
Constructor Summary
Constructors Constructor Description FormEditingBar(Context context)
FormEditingBar(Context context, AttributeSet attrs)
FormEditingBar(Context context, AttributeSet attrs, int defStyleAttr)
FormEditingBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
Method Summary
Modifier and Type Method Description boolean
isDisplayed()
True when form input bar is currently displayed on the screen. void
setVisibility(int visibility)
int
getBackgroundColor()
Returns background color set to the form editing bar. void
setBackgroundColor(int backgroundColor)
Sets background color to the form editing bar. int
getTextColor()
Return color of the text on this form editing bar. void
setTextColor(int textColor)
Sets color of the text on this form editing bar. int
getIconsColor()
Returns color of the icons on this form editing bar. void
setIconsColor(int iconColor)
Sets color of the icons on this form editing bar. int
getPrevIcon()
Return resource id of the icon marking navigation to the previous form. void
setPrevIcon(int prevIconResId)
Sets resource id of the icon marking navigation to the previous form. int
getNextIcon()
Return resource id of the icon marking navigation to the next form. void
setNextIcon(int nextIconResId)
Sets resource id of the icon marking navigation to the next form. void
onClick(View v)
void
addOnFormEditingBarLifecycleListener(@NonNull() FormEditingBar.OnFormEditingBarLifecycleListener listener)
Adds an OnFormEditingBarLifecycleListener for listening to the form editing bar lifecycle. void
removeOnFormEditingBarLifecycleListener(@NonNull() FormEditingBar.OnFormEditingBarLifecycleListener listener)
Removes a previously added OnFormEditingBarLifecycleListener. void
bindController(@NonNull() FormEditingController controller)
Binds to form editing controller. void
unbindController()
Unbinds from form editing controller. void
onEnterFormElementEditingMode(@NonNull() FormEditingController controller)
Called when form element editing mode has been entered. void
onChangeFormElementEditingMode(@NonNull() FormEditingController controller)
Called then form element editing mode changes, meaning another form element is being selected for editing. void
onExitFormElementEditingMode(@NonNull() FormEditingController controller)
Called when form element editing mode has been exited. void
onFormElementUpdated(@NonNull() FormElement formElement)
Called when form element gets updated. void
onFormElementViewUpdated(@NonNull() FormElement formElement)
Called whenever form element view gets updated, listeners should update their UI accordingly. void
onFormElementValidationSuccess(@NonNull() FormElement formElement)
Called when form element validation succeeded. void
onFormElementValidationFailed(@NonNull() FormElement formElement, @NonNull() String validationError)
Called when form element validation fails. -
-
Constructor Detail
-
FormEditingBar
FormEditingBar(Context context)
-
FormEditingBar
FormEditingBar(Context context, AttributeSet attrs)
-
FormEditingBar
FormEditingBar(Context context, AttributeSet attrs, int defStyleAttr)
-
FormEditingBar
FormEditingBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
-
-
Method Detail
-
isDisplayed
boolean isDisplayed()
True when form input bar is currently displayed on the screen.
-
setVisibility
void setVisibility(int visibility)
-
getBackgroundColor
int getBackgroundColor()
Returns background color set to the form editing bar.
- Returns:
Background color applied to this form editing bar.
-
setBackgroundColor
void setBackgroundColor(int backgroundColor)
Sets background color to the form editing bar.
- Parameters:
backgroundColor
- Background color to be applied to this form editing bar.
-
getTextColor
int getTextColor()
Return color of the text on this form editing bar.
- Returns:
Text color on form editing bar.
-
setTextColor
void setTextColor(int textColor)
Sets color of the text on this form editing bar.
- Parameters:
textColor
- Text color on form editing bar.
-
getIconsColor
int getIconsColor()
Returns color of the icons on this form editing bar.
- Returns:
Tint of the icons on the bar.
-
setIconsColor
void setIconsColor(int iconColor)
Sets color of the icons on this form editing bar.
- Parameters:
iconColor
- Tint of the icons on the bar.
-
getPrevIcon
int getPrevIcon()
Return resource id of the icon marking navigation to the previous form.
- Returns:
Previous form navigation button icon.
-
setPrevIcon
void setPrevIcon(int prevIconResId)
Sets resource id of the icon marking navigation to the previous form.
- Parameters:
prevIconResId
- Previous form navigation button icon.
-
getNextIcon
int getNextIcon()
Return resource id of the icon marking navigation to the next form.
- Returns:
Next form navigation button icon.
-
setNextIcon
void setNextIcon(int nextIconResId)
Sets resource id of the icon marking navigation to the next form.
- Parameters:
nextIconResId
- Next form navigation button icon.
-
addOnFormEditingBarLifecycleListener
void addOnFormEditingBarLifecycleListener(@NonNull() FormEditingBar.OnFormEditingBarLifecycleListener listener)
Adds an OnFormEditingBarLifecycleListener for listening to the form 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
- OnFormEditingBarLifecycleListener that should be notified.
-
removeOnFormEditingBarLifecycleListener
void removeOnFormEditingBarLifecycleListener(@NonNull() FormEditingBar.OnFormEditingBarLifecycleListener listener)
Removes a previously added OnFormEditingBarLifecycleListener. 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
- OnFormEditingBarLifecycleListener that should be removed.
-
bindController
void bindController(@NonNull() FormEditingController controller)
Binds to form editing controller. Animates form editing bar into view.
-
unbindController
void unbindController()
Unbinds from form editing controller. Animates form editing bar out of view.
-
onEnterFormElementEditingMode
void onEnterFormElementEditingMode(@NonNull() FormEditingController controller)
Called when form element editing mode has been entered.
- Parameters:
controller
- Controller for managing form element editing.
-
onChangeFormElementEditingMode
void onChangeFormElementEditingMode(@NonNull() FormEditingController controller)
Called then form element editing mode changes, meaning another form element is being selected for editing.
- Parameters:
controller
- Controller for managing form element editing.
-
onExitFormElementEditingMode
void onExitFormElementEditingMode(@NonNull() FormEditingController controller)
Called when form element editing mode has been exited.
- Parameters:
controller
- Controller for managing form element editing.
-
onFormElementUpdated
void onFormElementUpdated(@NonNull() FormElement formElement)
Called when form element gets updated.
- Parameters:
formElement
- Form element that has been updated.
-
onFormElementViewUpdated
void onFormElementViewUpdated(@NonNull() FormElement formElement)
Called whenever form element view gets updated, listeners should update their UI accordingly.
-
onFormElementValidationSuccess
void onFormElementValidationSuccess(@NonNull() FormElement formElement)
Called when form element validation succeeded.
- Parameters:
formElement
- Form element that failed to validate.
-
onFormElementValidationFailed
void onFormElementValidationFailed(@NonNull() FormElement formElement, @NonNull() String validationError)
Called when form element validation fails.
- Parameters:
formElement
- Form element that failed to validate.validationError
- Localized validation error.
-
-
-
-