Class ScaleCalibrationPickerInspectorView
-
- 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.PropertyInspectorTitleButtonListener
,com.pspdfkit.ui.inspector.PropertyInspectorView
public class ScaleCalibrationPickerInspectorView extends FrameLayout implements PropertyInspectorView, PropertyInspectorTitleButtonListener
Inspector component for setting measurement scale via calibration picker. Calibration picker is added to the distance measurement tools as a way of setting scale by calibrating a distance annotation to the desired length and unit.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ScaleCalibrationPickerInspectorView.CalibrationPickerListener
Listener for calibration value being picked.
-
Field Summary
Fields Modifier and Type Field Description public LineAnnotation
lineAnnotation
-
Constructor Summary
Constructors Constructor Description ScaleCalibrationPickerInspectorView(LineAnnotation lineAnnotation, Context context, String label, Scale.UnitTo defaultUnit, boolean focusValueText, ScaleCalibrationPickerInspectorView.CalibrationPickerListener listener)
Construct calibration picker.
-
Method Summary
Modifier and Type Method Description LineAnnotation
getLineAnnotation()
void
updateCalibration(@Nullable() Scale maybeScale)
void
setCalibration(@Nullable() Float value, @NonNull() Scale.UnitTo unit, boolean notifyListeners)
Sets value to the calibration picker. 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
-
ScaleCalibrationPickerInspectorView
ScaleCalibrationPickerInspectorView(LineAnnotation lineAnnotation, Context context, String label, Scale.UnitTo defaultUnit, boolean focusValueText, ScaleCalibrationPickerInspectorView.CalibrationPickerListener listener)
Construct calibration picker.- Parameters:
lineAnnotation
- the lineannotation whose length we calibratecontext
- The context to use.label
- text describing the calibration valuedefaultUnit
- Default Scale.UnitTo value selected.focusValueText
- iftrue
the value text widget will be focused and the keyboard be shown automatically after showing the inspectorlistener
- Listener for calibration picker changes.
-
-
Method Detail
-
getLineAnnotation
@NonNull() LineAnnotation getLineAnnotation()
-
updateCalibration
void updateCalibration(@Nullable() Scale maybeScale)
-
setCalibration
void setCalibration(@Nullable() Float value, @NonNull() Scale.UnitTo unit, boolean notifyListeners)
Sets value to the calibration picker.
-
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.
-
-
-
-