AccessibilityNodeInfo.RangeInfo


public static final class AccessibilityNodeInfo.RangeInfo
extends Object

java.lang.Object
   ↳ android.view.accessibility.AccessibilityNodeInfo.RangeInfo


Class with information if a node is a range.

Summary

Constants

int RANGE_TYPE_FLOAT

Range type: float.

int RANGE_TYPE_INT

Range type: integer.

int RANGE_TYPE_PERCENT

Range type: percent with values from zero to one hundred.

Public constructors

RangeInfo(int type, float min, float max, float current)

Creates a new range.

Public methods

float getCurrent()

Gets the current value.

float getMax()

Gets the maximum value.

float getMin()

Gets the minimum value.

int getType()

Gets the range type.

static AccessibilityNodeInfo.RangeInfo obtain(int type, float min, float max, float current)

This method was deprecated in API level 33. Object pooling has been discontinued. Create a new instance using the constructor AccessibilityNodeInfo.RangeInfo#RangeInfo(int, float, float, float) instead.

Inherited methods

Constants

RANGE_TYPE_FLOAT

Added in API level 19
public static final int RANGE_TYPE_FLOAT

Range type: float.

Constant Value: 1 (0x00000001)

RANGE_TYPE_INT

Added in API level 19
public static final int RANGE_TYPE_INT

Range type: integer.

Constant Value: 0 (0x00000000)

RANGE_TYPE_PERCENT

Added in API level 19
public static final int RANGE_TYPE_PERCENT

Range type: percent with values from zero to one hundred.

Constant Value: 2 (0x00000002)

Public constructors

RangeInfo

Added in API level 30
public RangeInfo (int type, 
                float min, 
                float max, 
                float current)

Creates a new range.

Parameters
type int: The type of the range.

min float: The minimum value. Use Float.NEGATIVE_INFINITY if the range has no minimum.

max float: The maximum value. Use Float.POSITIVE_INFINITY if the range has no maximum.

current float: The current value.

Public methods

getCurrent

Added in API level 19
public float getCurrent ()

Gets the current value.

Returns
float The current value.

getMax

Added in API level 19
public float getMax ()

Gets the maximum value.

Returns
float The maximum value, or Float.POSITIVE_INFINITY if no maximum exists.

getMin

Added in API level 19
public float getMin ()

Gets the minimum value.

Returns
float The minimum value, or Float.NEGATIVE_INFINITY if no minimum exists.

getType

Added in API level 19
public int getType ()

Gets the range type.

Returns
int The range type.

obtain

Added in API level 19
Deprecated in API level 33
public static AccessibilityNodeInfo.RangeInfo obtain (int type, 
                float min, 
                float max, 
                float current)

This method was deprecated in API level 33.
Object pooling has been discontinued. Create a new instance using the constructor AccessibilityNodeInfo.RangeInfo#RangeInfo(int, float, float, float) instead.

Instantiates a new RangeInfo.

Parameters
type int: The type of the range.

min float: The minimum value. Use Float.NEGATIVE_INFINITY if the range has no minimum.

max float: The maximum value. Use Float.POSITIVE_INFINITY if the range has no maximum.

current float: The current value.

Returns
AccessibilityNodeInfo.RangeInfo