CurvedTextView

public class CurvedTextView implements ArcLayout.Widget


CurvedTextView is a component allowing developers to easily write curved text following the curvature of the largest circle that can be inscribed in the view. ArcLayout could be used to concatenate multiple curved texts, also layout together with other widgets such as icons.

Summary

Public constructors

CurvedTextView(
    @NonNull Context context,
    @Nullable AttributeSet attrs,
    @NonNull int defStyle
)
CurvedTextView(
    @NonNull Context context,
    @Nullable AttributeSet attrs,
    @NonNull int defStyle,
    @NonNull int defStyleRes
)

Public methods

@Override @NonNull void
@Override @NonNull void
draw(@NonNull Canvas canvas)
@FloatRange(from = 0.0, to = 360.0, toInclusive = true) @NonNull float

Returns the anchor angle used for positioning the text, in degrees.

@ArcLayout.AnchorType @NonNull int

Returns the anchor type for positioning the curved text

@Nullable TextUtils.TruncateAt

Returns where, if anywhere, words that are longer than the view is wide should be ellipsized.

@Nullable String

Returns the font feature settings.

@Nullable String

Returns TrueType or OpenType font variation settings.

@NonNull float

Gets the text letter-space value, which determines the spacing between characters.

@FloatRange(from = 0.0, to = 360.0, toInclusive = true) @NonNull float

Returns the maximum sweep angle in degrees for rendering the text

@FloatRange(from = 0.0, to = 360.0, toInclusive = true) @NonNull float

Returns the sweep angle in degrees for rendering the text

@Override @FloatRange(from = 0.0, to = 360.0, toInclusive = true) @NonNull float

Returns the sweep angle that this widget is drawn with.

@Nullable String

Returns the text to be rendered

@ColorInt @NonNull int

Returns the color for rendering the text

@NonNull float

Returns the text size for rendering the text

@Override @Px @NonNull int

Returns the thickness of this widget inside the arc.

@Nullable Typeface

Gets the current Typeface that is used to style the text.

@NonNull boolean

Returns the curved text layout direction

@Override @NonNull boolean
isPointInsideClickArea(@NonNull float x, @NonNull float y)

See isPointInsideClickArea

@Override @NonNull void
@Override @NonNull void
@Override @NonNull boolean
@NonNull void
setAnchorAngleDegrees(
    @FloatRange(from = 0.0, to = 360.0, toInclusive = true) @NonNull float value
)

Sets the anchor angle used for positioning the text, in degrees.

@NonNull void

Sets the anchor type for positioning the curved text.

@NonNull void
setClockwise(@NonNull boolean value)

Sets the curved text layout direction

@NonNull void

Causes words in the text that are longer than the view's width to be ellipsized.

@NonNull void