public class Cue
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Cue.AnchorType
The type of anchor, which may be unset.
|
static interface |
Cue.LineType
The type of line, which may be unset.
|
Modifier and Type | Field and Description |
---|---|
static int |
ANCHOR_TYPE_END
Anchors the right (for horizontal positions) or bottom (for vertical positions) edge of the cue
box.
|
static int |
ANCHOR_TYPE_MIDDLE
Anchors the middle of the cue box.
|
static int |
ANCHOR_TYPE_START
Anchors the left (for horizontal positions) or top (for vertical positions) edge of the cue
box.
|
static float |
DIMEN_UNSET
An unset position or width.
|
float |
line
The position of the
lineAnchor of the cue box within the viewport in the direction
orthogonal to the writing direction, or DIMEN_UNSET . |
static int |
LINE_TYPE_FRACTION
|
static int |
LINE_TYPE_NUMBER
|
int |
lineAnchor
The cue box anchor positioned by
line . |
int |
lineType
The type of the
line value. |
float |
position
The fractional position of the
positionAnchor of the cue box within the viewport in
the direction orthogonal to line , or DIMEN_UNSET . |
int |
positionAnchor
The cue box anchor positioned by
position . |
float |
size
The size of the cue box in the writing direction specified as a fraction of the viewport size
in that direction, or
DIMEN_UNSET . |
java.lang.CharSequence |
text
The cue text.
|
android.text.Layout.Alignment |
textAlignment
The alignment of the cue text within the cue box, or null if the alignment is undefined.
|
static int |
TYPE_UNSET
An unset anchor or line type value.
|
Constructor and Description |
---|
Cue(java.lang.CharSequence text)
Constructs a cue whose
textAlignment is null, whose type parameters are set to
TYPE_UNSET and whose dimension parameters are set to DIMEN_UNSET . |
Cue(java.lang.CharSequence text,
android.text.Layout.Alignment textAlignment,
float line,
int lineType,
int lineAnchor,
float position,
int positionAnchor,
float size) |
public static final float DIMEN_UNSET
public static final int TYPE_UNSET
public static final int ANCHOR_TYPE_START
public static final int ANCHOR_TYPE_MIDDLE
public static final int ANCHOR_TYPE_END
public static final int LINE_TYPE_FRACTION
public static final int LINE_TYPE_NUMBER
public final java.lang.CharSequence text
CharSequence
may be decorated with styling spans.public final android.text.Layout.Alignment textAlignment
public final float line
lineAnchor
of the cue box within the viewport in the direction
orthogonal to the writing direction, or DIMEN_UNSET
. When set, the interpretation of
the value depends on the value of lineType
.
For horizontal text and lineType
equal to LINE_TYPE_FRACTION
, this is the
fractional vertical position relative to the top of the viewport.
public final int lineType
line
value.
LINE_TYPE_FRACTION
indicates that line
is a fractional position within the
viewport.
LINE_TYPE_NUMBER
indicates that line
is a line number, where the size of each
line is taken to be the size of the first line of the cue. When line
is greater than
or equal to 0, lines count from the start of the viewport (the first line is numbered 0). When
line
is negative, lines count from the end of the viewport (the last line is numbered
-1). For horizontal text the size of the first line of the cue is its height, and the start
and end of the viewport are the top and bottom respectively.
public final int lineAnchor
line
. One of ANCHOR_TYPE_START
,
ANCHOR_TYPE_MIDDLE
, ANCHOR_TYPE_END
and TYPE_UNSET
.
For the normal case of horizontal text, ANCHOR_TYPE_START
, ANCHOR_TYPE_MIDDLE
and ANCHOR_TYPE_END
correspond to the top, middle and bottom of the cue box
respectively.
public final float position
positionAnchor
of the cue box within the viewport in
the direction orthogonal to line
, or DIMEN_UNSET
.
For horizontal text, this is the horizontal position relative to the left of the viewport. Note that positioning is relative to the left of the viewport even in the case of right-to-left text.
public final int positionAnchor
position
. One of ANCHOR_TYPE_START
,
ANCHOR_TYPE_MIDDLE
, ANCHOR_TYPE_END
and TYPE_UNSET
.
For the normal case of horizontal text, ANCHOR_TYPE_START
, ANCHOR_TYPE_MIDDLE
and ANCHOR_TYPE_END
correspond to the left, middle and right of the cue box
respectively.
public final float size
DIMEN_UNSET
.public Cue(java.lang.CharSequence text)
textAlignment
is null, whose type parameters are set to
TYPE_UNSET
and whose dimension parameters are set to DIMEN_UNSET
.text
- See text
.public Cue(java.lang.CharSequence text, android.text.Layout.Alignment textAlignment, float line, int lineType, int lineAnchor, float position, int positionAnchor, float size)
text
- See text
.textAlignment
- See textAlignment
.line
- See line
.lineType
- See lineType
.lineAnchor
- See lineAnchor
.position
- See position
.positionAnchor
- See positionAnchor
.size
- See size
.