Class ScaleSelectPickerInspectorView
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.view.KeyEvent.Callback
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
,com.pspdfkit.ui.inspector.PropertyInspectorView
public class ScaleSelectPickerInspectorView extends FrameLayout implements PropertyInspectorView
Used by the AnnotationCreationInspectorFactory to display/select the default MeasurementValueConfiguration to be used for creating a measurement annotation. Also used by the AnnotationEditingInspectorFactory to display/select the MeasurementValueConfiguration for the currently edited measurement annotation.
This inspector reacts to clicks in two different ways - If there are MeasurementValueConfigurations available it switches to the ScaleListPickerInspectorDetailView - If no scale is available, it opens ScaleConfigurationPickerInspectorDetailView to create the first scale
-
-
Constructor Summary
Constructors Constructor Description ScaleSelectPickerInspectorView(Context context, String label, MeasurementValueConfiguration defaultValue, MeasurementValueConfigurationPickerListener listener)
Constructor for readonly mode (used in the inspector for the calibration tool) ScaleSelectPickerInspectorView(Context context, String label, MeasurementValueConfiguration defaultValue, AnnotationInspectorFactoryBase inspectorFactory, MeasurementValueConfigurationEditor measurementValueConfigurationEditor, MeasurementValueConfigurationPickerListener listener)
Construct scale picker.
-
Method Summary
Modifier and Type Method Description void
setConfiguration(@Nullable() MeasurementValueConfiguration config, boolean notifyListeners)
Sets value to the scale picker. MeasurementValueConfiguration
getCurrentConfigurationValue()
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
-
ScaleSelectPickerInspectorView
ScaleSelectPickerInspectorView(Context context, String label, MeasurementValueConfiguration defaultValue, MeasurementValueConfigurationPickerListener listener)
Constructor for readonly mode (used in the inspector for the calibration tool)- Parameters:
context
- Themed context for this inspectorlabel
- Label for the inspector valuedefaultValue
- start valuelistener
- listener to notify about value changes
-
ScaleSelectPickerInspectorView
ScaleSelectPickerInspectorView(Context context, String label, MeasurementValueConfiguration defaultValue, AnnotationInspectorFactoryBase inspectorFactory, MeasurementValueConfigurationEditor measurementValueConfigurationEditor, MeasurementValueConfigurationPickerListener listener)
Construct scale picker.- Parameters:
context
- The context to use.defaultValue
- Default scale value selected when showing picker.listener
- Listener for scale picker changes.
-
-
Method Detail
-
setConfiguration
void setConfiguration(@Nullable() MeasurementValueConfiguration config, boolean notifyListeners)
Sets value to the scale picker.
- Parameters:
config
- The MeasurementValueConfiguration to be set.notifyListeners
- If scale has changed, this sets whether or not to notify the external ScalePickerInspectorView.ScalePickerListener about the change.
-
getCurrentConfigurationValue
MeasurementValueConfiguration getCurrentConfigurationValue()
-
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.
-
-
-
-