Class OptionPickerInspectorView
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.text.NoCopySpan
,android.text.TextWatcher
,android.view.KeyEvent.Callback
,android.view.View.OnClickListener
,android.view.View.OnFocusChangeListener
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
,com.pspdfkit.ui.inspector.PropertyInspectorView
public final class OptionPickerInspectorView extends FrameLayout implements PropertyInspectorView, View.OnClickListener, View.OnFocusChangeListener, TextWatcher
Picker for picking values from fixed list of options.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
OptionPickerInspectorView.OnOptionPickedListener
Listener for option selection changes.
-
Field Summary
Fields Modifier and Type Field Description public String
customValue
public final List<Integer>
selectedOptions
-
Constructor Summary
Constructors Constructor Description OptionPickerInspectorView(Context context, List<String> options, List<Integer> defaultSelectedOptions, boolean isMultiSelectEnabled, boolean isEditable, String defaultCustomValue, OptionPickerInspectorView.OnOptionPickedListener listener)
Construct options picker.
-
Method Summary
Modifier and Type Method Description String
getCustomValue()
Gets current custom value. void
setCustomValue(@Nullable() String customValue)
Sets new custom value. List<Integer>
getSelectedOptions()
Returns list of all selected options indexes. void
onClick(View v)
void
setSelectedOptions(@NonNull() List<Integer> selectedOptions, boolean notifyListeners)
Sets selected option. void
setInputType(int inputType)
Sets the type of content in the custom value edit box. void
setFilters(@NonNull() Array<InputFilter> filters)
Sets the list of input filters that will be used in the custom value edit box. void
beforeTextChanged(CharSequence s, int start, int count, int after)
void
onTextChanged(CharSequence s, int start, int before, int count)
void
afterTextChanged(Editable s)
void
onFocusChange(View v, boolean hasFocus)
View
getView()
Casts the inspector view to the View class and returns it. void
bindController(@NonNull() PropertyInspectorController controller)
Bind to property inspector controller. void
unbindController()
Unbind from property inspector controller. int
getPropertyInspectorMinHeight()
Height of the parent PropertyInspector that this view would like it to have. int
getPropertyInspectorMaxHeight()
Returns maximum height that this view with all its detail views will occupy. int
getSuggestedHeight()
Returns best height of this view when shown in inspector. -
-
Constructor Detail
-
OptionPickerInspectorView
OptionPickerInspectorView(Context context, List<String> options, List<Integer> defaultSelectedOptions, boolean isMultiSelectEnabled, boolean isEditable, String defaultCustomValue, OptionPickerInspectorView.OnOptionPickedListener listener)
Construct options picker.- Parameters:
context
- The context to use.options
- List of available options.defaultSelectedOptions
- Indexes of selected options.isMultiSelectEnabled
- Whether the options can be multi selected or only single option can be selected at a time.isEditable
- Whether custom value is supported.defaultCustomValue
- Default custom value.listener
- Listener for color picker changes.
-
-
Method Detail
-
getCustomValue
@Nullable() String getCustomValue()
Gets current custom value. Valid only when option picker is editable.
- Returns:
Custom value or
null
if no value has been set or option picker is not editable.
-
setCustomValue
void setCustomValue(@Nullable() String customValue)
Sets new custom value. Valid only when option picker is editable.
- Parameters:
customValue
- Custom value to set.
-
getSelectedOptions
List<Integer> getSelectedOptions()
Returns list of all selected options indexes.
-
setSelectedOptions
void setSelectedOptions(@NonNull() List<Integer> selectedOptions, boolean notifyListeners)
Sets selected option.
- Parameters:
selectedOptions
- List of option indexes that ought to be selected.notifyListeners
- Whether to notify listeners about the change.
-
setInputType
void setInputType(int inputType)
Sets the type of content in the custom value edit box.
-
setFilters
void setFilters(@NonNull() Array<InputFilter> filters)
Sets the list of input filters that will be used in the custom value edit box.
-
beforeTextChanged
void beforeTextChanged(CharSequence s, int start, int count, int after)
-
onTextChanged
void onTextChanged(CharSequence s, int start, int before, int count)
-
afterTextChanged
void afterTextChanged(Editable s)
-
onFocusChange
void onFocusChange(View v, boolean hasFocus)
-
bindController
void bindController(@NonNull() PropertyInspectorController controller)
Bind to property inspector controller.
-
unbindController
void unbindController()
Unbind from property inspector controller.
-
getPropertyInspectorMinHeight
int getPropertyInspectorMinHeight()
Height of the parent PropertyInspector that this view would like it to have.
- Returns:
Hint for the minimum inspector height or 0 if no min height is specified.
-
getPropertyInspectorMaxHeight
int getPropertyInspectorMaxHeight()
Returns maximum height that this view with all its detail views will occupy.
- Returns:
Hint for the maximum inspector height or 0 if no max height is specified.
-
getSuggestedHeight
int getSuggestedHeight()
Returns best height of this view when shown in inspector. This is used to suggest initial height to inspector parent.
- Returns:
Hint for the view height after being shown in inspector.
-
-
-
-