Package com.naver.ads.ui
Class CenteredImageSpan
-
- All Implemented Interfaces:
-
android.text.style.UpdateAppearance,android.text.style.UpdateLayout
public final class CenteredImageSpan extends ImageSpan
Span that replaces the text it's attached to with a Drawable that can be aligned with center and vertical.
-
-
Field Summary
Fields Modifier and Type Field Description private final Contextcontextprivate final IntegerdrawableResprivate final RectdrawableBoundprivate final PointFdrawableOffsetprivate final FloatmarginLeftprivate final FloatmarginRight
-
Constructor Summary
Constructors Constructor Description CenteredImageSpan(Context context, Integer drawableRes, Rect drawableBound, PointF drawableOffset, Float marginLeft, Float marginRight)Constructs a CenteredImageSpan from a Context, DrawableRes, drawableBound, marginLeft, and marginRight. CenteredImageSpan(Context context, Integer drawableRes, Rect drawableBound, PointF drawableOffset, Float marginLeft)Constructs a CenteredImageSpan from a Context, DrawableRes, drawableBound, marginLeft, and marginRight. CenteredImageSpan(Context context, Integer drawableRes, Rect drawableBound, PointF drawableOffset)Constructs a CenteredImageSpan from a Context, DrawableRes, drawableBound, marginLeft, and marginRight. CenteredImageSpan(Context context, Integer drawableRes, Rect drawableBound)Constructs a CenteredImageSpan from a Context, DrawableRes, drawableBound, marginLeft, and marginRight. CenteredImageSpan(Context context, Integer drawableRes)Constructs a CenteredImageSpan from a Context, DrawableRes, drawableBound, marginLeft, and marginRight.
-
Method Summary
Modifier and Type Method Description final ContextgetContext()the context used to retrieve the drawable from resources. final IntegergetDrawableRes()the drawable resource id based on which the drawable is retrieved. final RectgetDrawableBound()the specified bounding rectangle for the drawable final PointFgetDrawableOffset()the offset to adjust the x-axis and y-axis position of the drawable. final FloatgetMarginLeft()the extra space on the left side of image. final FloatgetMarginRight()the extra space on the right side of image. DrawablegetDrawable()IntegergetSize(Paint paint, CharSequence text, Integer start, Integer end, Paint.FontMetricsInt fm)Unitdraw(Canvas canvas, CharSequence text, Integer start, Integer end, Float x, Integer top, Integer y, Integer bottom, Paint paint)-
-
Constructor Detail
-
CenteredImageSpan
CenteredImageSpan(Context context, Integer drawableRes, Rect drawableBound, PointF drawableOffset, Float marginLeft, Float marginRight)
Constructs a CenteredImageSpan from a Context, DrawableRes, drawableBound, marginLeft, and marginRight.
-
CenteredImageSpan
CenteredImageSpan(Context context, Integer drawableRes, Rect drawableBound, PointF drawableOffset, Float marginLeft)
Constructs a CenteredImageSpan from a Context, DrawableRes, drawableBound, marginLeft, and marginRight.
-
CenteredImageSpan
CenteredImageSpan(Context context, Integer drawableRes, Rect drawableBound, PointF drawableOffset)
Constructs a CenteredImageSpan from a Context, DrawableRes, drawableBound, marginLeft, and marginRight.
-
CenteredImageSpan
CenteredImageSpan(Context context, Integer drawableRes, Rect drawableBound)
Constructs a CenteredImageSpan from a Context, DrawableRes, drawableBound, marginLeft, and marginRight.
-
CenteredImageSpan
CenteredImageSpan(Context context, Integer drawableRes)
Constructs a CenteredImageSpan from a Context, DrawableRes, drawableBound, marginLeft, and marginRight.
-
-
Method Detail
-
getContext
final Context getContext()
the context used to retrieve the drawable from resources.
-
getDrawableRes
final Integer getDrawableRes()
the drawable resource id based on which the drawable is retrieved.
-
getDrawableBound
final Rect getDrawableBound()
the specified bounding rectangle for the drawable
-
getDrawableOffset
final PointF getDrawableOffset()
the offset to adjust the x-axis and y-axis position of the drawable.
-
getMarginLeft
final Float getMarginLeft()
the extra space on the left side of image.
-
getMarginRight
final Float getMarginRight()
the extra space on the right side of image.
-
getDrawable
Drawable getDrawable()
-
getSize
Integer getSize(Paint paint, CharSequence text, Integer start, Integer end, Paint.FontMetricsInt fm)
-
-
-
-