public final class

OptionPickerInspectorView

extends FrameLayout
implements TextWatcher View.OnClickListener View.OnFocusChangeListener PropertyInspectorView
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.pspdfkit.ui.inspector.views.OptionPickerInspectorView

Class Overview

Picker for picking values from fixed list of options.

Summary

Nested Classes
interface OptionPickerInspectorView.OnOptionPickedListener Listener for option selection changes. 
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
OptionPickerInspectorView(Context context, List<String> options, List<Integer> defaultSelectedOptions, boolean isMultiSelectEnabled, boolean isEditable, String defaultCustomValue, OptionPickerInspectorView.OnOptionPickedListener listener)
Construct options picker.
Public Methods
void afterTextChanged(Editable s)
void beforeTextChanged(CharSequence s, int start, int count, int after)
void bindController(PropertyInspectorController controller)
Bind to property inspector controller.
String getCustomValue()
Gets current custom value.
int getPropertyInspectorMaxHeight()
Returns maximum height that this view with all its detail views will occupy.
int getPropertyInspectorMinHeight()
Height of the parent PropertyInspector that this view would like it to have.
List<Integer> getSelectedOptions()
Returns list of all selected options indexes.
int getSuggestedHeight()
Returns best height of this view when shown in inspector.
View getView()
Casts the inspector view to the View class and returns it.
void onClick(View v)
void onFocusChange(View v, boolean hasFocus)
void onTextChanged(CharSequence s, int start, int before, int count)
void setCustomValue(String customValue)
Sets new custom value.
void setFilters(InputFilter[] filters)
Sets the list of input filters that will be used in the custom value edit box.
void setInputType(int inputType)
Sets the type of content in the custom value edit box.
void setSelectedOptions(List<Integer> selectedOptions, boolean notifyListeners)
Sets selected option.
void unbindController()
Unbind from property inspector controller.
Protected Methods
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[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.text.TextWatcher
From interface android.view.KeyEvent.Callback
From interface android.view.View.OnClickListener
From interface android.view.View.OnFocusChangeListener
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.pspdfkit.ui.inspector.PropertyInspectorView

Public Constructors

public 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.

Public Methods

public void afterTextChanged (Editable s)

public void beforeTextChanged (CharSequence s, int start, int count, int after)

public void bindController (PropertyInspectorController controller)

Bind to property inspector controller.

public 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.

public 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.

public 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.

public List<Integer> getSelectedOptions ()

Returns list of all selected options indexes.

public 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.

public View getView ()

Casts the inspector view to the View class and returns it.

public void onClick (View v)

public void onFocusChange (View v, boolean hasFocus)

public void onTextChanged (CharSequence s, int start, int before, int count)

public void setCustomValue (String customValue)

Sets new custom value. Valid only when option picker is editable.

Parameters
customValue Custom value to set. null to clear custom value.

public void setFilters (InputFilter[] filters)

Sets the list of input filters that will be used in the custom value edit box.

public void setInputType (int inputType)

Sets the type of content in the custom value edit box.

public void setSelectedOptions (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.

public void unbindController ()

Unbind from property inspector controller.

Protected Methods

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)