Class UnitSelectionEditText

  • All Implemented Interfaces:
    android.graphics.drawable.Drawable.Callback , android.view.KeyEvent.Callback , android.view.ViewTreeObserver.OnPreDrawListener , android.view.accessibility.AccessibilityEventSource , androidx.appcompat.widget.EmojiCompatConfigurationView , androidx.core.view.OnReceiveContentViewBehavior , androidx.core.view.TintableBackgroundView , androidx.core.widget.TintableCompoundDrawablesView

    
    public class UnitSelectionEditText
    extends ScreenAdjustingEditText
                        

    Edit text with blocked selection to prevent user interacting with a unit label.

    • Constructor Detail

      • UnitSelectionEditText

        UnitSelectionEditText(Context context)
      • UnitSelectionEditText

        UnitSelectionEditText(Context context, AttributeSet attrs, int defStyle)
    • Method Detail

      • getDefaultValue

         int getDefaultValue()

        Returns default value.

        Returns:

        default value.

      • setDefaultValue

         void setDefaultValue(int defaultValue)

        Sets default value of the unit.

        Parameters:
        defaultValue - default value of the unit.
      • getMinimumValue

         int getMinimumValue()

        Returns minimum value of the unit.

        Returns:

        minimum value.

      • setMinimumValue

         void setMinimumValue(int minimumValue)

        Sets minimum value of the unit.

        Parameters:
        minimumValue - minimum value of the unit.
      • getMaximumValue

         int getMaximumValue()

        Returns maximum value of the unit.

        Returns:

        maximum value.

      • setMaximumValue

         void setMaximumValue(int maximumValue)

        Sets maximum value of the unit.

        Parameters:
        maximumValue - maximum value.
      • parseValue

         int parseValue(@NonNull() String s)

        Returns the parsed value of the unit. Returns default value if the input is malformed. Returns maximum value if the input value is over the maximum value. Returns minimum value if the input value is under the minimum value.

        Parameters:
        s - Input value to parse.
        Returns:

        parsed value of the unit.

      • setTextToDefault

         void setTextToDefault()

        Sets text to default value and notifies the listener if not null.

      • getValue

         int getValue()

        Gets current value.

      • focusCheck

         void focusCheck()

        Checks if the view has the focus and select the editable value.