public final class Cue extends Object
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
Cue.AnchorType |
The type of anchor, which may be unset.
|
static class |
Cue.Builder |
A builder for
Cue objects. |
static interface |
Cue.LineType |
The type of line, which may be unset.
|
static interface |
Cue.TextSizeType |
The type of default text size for this cue, which may be unset.
|
static interface |
Cue.VerticalType |
The type of vertical layout for this cue, which may be unset (i.e.
|
| Modifier and Type | Field | 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.
|
Bitmap |
bitmap |
The cue image, or null if this is a text cue.
|
float |
bitmapHeight |
The bitmap height as a fraction of the of the viewport size, or
DIMEN_UNSET if the
bitmap should be displayed at its natural height given the bitmap dimensions and the specified
size. |
static float |
DIMEN_UNSET |
An unset position, width or size.
|
static Cue |
EMPTY |
The empty cue.
|
float |
line |
The position of the cue box within the viewport in the direction orthogonal to the writing
direction (determined by
verticalType), or DIMEN_UNSET. |
static int |
LINE_TYPE_FRACTION |
|
static int |
LINE_TYPE_NUMBER |
|
int |
lineAnchor |
|
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 |
shearDegrees |
The shear angle in degrees to be applied to this Cue, expressed in graphics coordinates.
|
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. |
CharSequence |
text |
The cue text, or null if this is an image cue.
|
static int |
TEXT_SIZE_TYPE_ABSOLUTE |
Text size is measured in number of pixels.
|
static int |
TEXT_SIZE_TYPE_FRACTIONAL |
Text size is measured as a fraction of the viewport size minus the view padding.
|
static int |
TEXT_SIZE_TYPE_FRACTIONAL_IGNORE_PADDING |
Text size is measured as a fraction of the viewport size, ignoring the view padding
|
Layout.Alignment |
textAlignment |
The alignment of the cue text within the cue box, or null if the alignment is undefined.
|
float |
textSize |
The default text size for this cue's text, or
DIMEN_UNSET if this cue has no default
text size. |
int |
textSizeType |
The default text size type for this cue's text, or
TYPE_UNSET if this cue has no
default text size. |
static int |
TYPE_UNSET |
An unset anchor, line, text size or vertical type value.
|
static int |
VERTICAL_TYPE_LR |
Vertical left-to-right (e.g.
|
static int |
VERTICAL_TYPE_RL |
Vertical right-to-left (e.g.
|
int |
verticalType |
The vertical formatting of this Cue, or
TYPE_UNSET if the cue has no vertical setting
(and so should be horizontal). |
int |
windowColor |
The fill color of the window.
|
boolean |
windowColorSet |
Specifies whether or not the
windowColor property is set. |
| Constructor | Description |
|---|---|
Cue(CharSequence text) |
Deprecated.
Use
Cue.Builder. |
Cue(CharSequence text,
Layout.Alignment textAlignment,
float line,
int lineType,
int lineAnchor,
float position,
int positionAnchor,
float size) |
Deprecated.
Use
Cue.Builder. |
Cue(CharSequence text,
Layout.Alignment textAlignment,
float line,
int lineType,
int lineAnchor,
float position,
int positionAnchor,
float size,
boolean windowColorSet,
int windowColor) |
Deprecated.
Use
Cue.Builder. |
Cue(CharSequence text,
Layout.Alignment textAlignment,
float line,
int lineType,
int lineAnchor,
float position,
int positionAnchor,
float size,
int textSizeType,
float textSize) |
Deprecated.
Use
Cue.Builder. |
| Modifier and Type | Method | Description |
|---|---|---|
Cue.Builder |
buildUpon() |
Returns a new
Cue.Builder initialized with the same values as this Cue. |
public static final Cue EMPTY
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 static final int TEXT_SIZE_TYPE_FRACTIONAL
public static final int TEXT_SIZE_TYPE_FRACTIONAL_IGNORE_PADDING
public static final int TEXT_SIZE_TYPE_ABSOLUTE
public static final int VERTICAL_TYPE_RL
public static final int VERTICAL_TYPE_LR
@Nullable public final CharSequence text
CharSequence may be decorated
with styling spans.@Nullable public final Layout.Alignment textAlignment
@Nullable public final Bitmap bitmap
public final float line
verticalType), or DIMEN_UNSET. When set, the
interpretation of the value depends on the value of lineType.
The measurement direction depends on verticalType:
TYPE_UNSET (i.e. horizontal), this is the vertical position relative to the
top of the viewport.
VERTICAL_TYPE_LR this is the horizontal position relative to the left of the
viewport.
VERTICAL_TYPE_RL this is the horizontal position relative to the right of
the viewport.
@LineType public final int lineType
line value.
LINE_TYPE_FRACTION indicates that line is a fractional position within
the viewport (measured to the part of the cue box determined by lineAnchor).
LINE_TYPE_NUMBER indicates that line is a viewport line number. The
viewport is divided into lines (each equal in size to the first line of the cue box). The
cue box is positioned to align with the viewport lines as follows:
lineAnchor) is ignored.
line is greater than or equal to 0 the first line in the cue box is
aligned with a viewport line, with 0 meaning the first line of the viewport.
line is negative the last line in the cue box is aligned with a
viewport line, with -1 meaning the last line of the viewport.
@AnchorType public final int lineAnchor
line when lineType is LINE_TYPE_FRACTION.
One of:
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.
The measurement direction depends on verticalType.
TYPE_UNSET (i.e. horizontal), 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.
VERTICAL_TYPE_LR and VERTICAL_TYPE_RL (i.e. vertical), this is the
vertical position relative to the top of the viewport.
@AnchorType 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 final float bitmapHeight
DIMEN_UNSET if the
bitmap should be displayed at its natural height given the bitmap dimensions and the specified
size.public final boolean windowColorSet
windowColor property is set.public final int windowColor
@TextSizeType public final int textSizeType
TYPE_UNSET if this cue has no
default text size.public final float textSize
DIMEN_UNSET if this cue has no default
text size.@VerticalType public final int verticalType
TYPE_UNSET if the cue has no vertical setting
(and so should be horizontal).public final float shearDegrees
@Deprecated public Cue(CharSequence text)
Cue.Builder.textAlignment is null, whose type parameters are set to
TYPE_UNSET and whose dimension parameters are set to DIMEN_UNSET.text - See text.@Deprecated public Cue(CharSequence text, @Nullable Layout.Alignment textAlignment, float line, @LineType int lineType, @AnchorType int lineAnchor, float position, @AnchorType int positionAnchor, float size)
Cue.Builder.text - See text.textAlignment - See textAlignment.line - See line.lineType - See lineType.lineAnchor - See lineAnchor.position - See position.positionAnchor - See positionAnchor.size - See size.@Deprecated public Cue(CharSequence text, @Nullable Layout.Alignment textAlignment, float line, @LineType int lineType, @AnchorType int lineAnchor, float position, @AnchorType int positionAnchor, float size, @TextSizeType int textSizeType, float textSize)
Cue.Builder.text - See text.textAlignment - See textAlignment.line - See line.lineType - See lineType.lineAnchor - See lineAnchor.position - See position.positionAnchor - See positionAnchor.size - See size.textSizeType - See textSizeType.textSize - See textSize.@Deprecated public Cue(CharSequence text, @Nullable Layout.Alignment textAlignment, float line, @LineType int lineType, @AnchorType int lineAnchor, float position, @AnchorType int positionAnchor, float size, boolean windowColorSet, int windowColor)
Cue.Builder.text - See text.textAlignment - See textAlignment.line - See line.lineType - See lineType.lineAnchor - See lineAnchor.position - See position.positionAnchor - See positionAnchor.size - See size.windowColorSet - See windowColorSet.windowColor - See windowColor.public Cue.Builder buildUpon()
Cue.Builder initialized with the same values as this Cue.