docs/javadoc/reference/com/facebook/widget/text/span/BetterImageSpan.html
|
|
Summary: Nested Classes | Constants | Ctors | Methods | Inherited Methods | [Expand All]
public class
extends ReplacementSpan
| java.lang.Object | | ↳ | android.text.style.CharacterStyle | | | ↳ | android.text.style.MetricAffectingSpan | | | | ↳ | android.text.style.ReplacementSpan | | | | | ↳ | com.facebook.widget.text.span.BetterImageSpan |
| Known Direct Subclasses
| DraweeSpan | Span that contains a Drawee. |
|
A better implementation of image spans that also supports centering images against the text.
In order to migrate from ImageSpan, replace new ImageSpan(drawable, alignment) with new BetterImageSpan(drawable, BetterImageSpan.normalizeAlignment(alignment)).
There are 2 main differences between BetterImageSpan and ImageSpan: 1. Pass in ALIGN_CENTER to center images against the text. 2. ALIGN_BOTTOM no longer unnecessarily increases the size of the text: DynamicDrawableSpan (ImageSpan's parent) adjusts sizes as if alignment was ALIGN_BASELINE which can lead to unnecessary whitespace.
| Nested Classes |
|---|
| @interface |
| Constants |
|---|
| int |
| int |
| int |
| Public Constructors |
|---|
| Public Methods |
|---|
| void |
| Drawable |
| int |
| Returns the width of the image span and increases the height if font metrics are available. |
| final static int |
| A helper function to allow dropping in BetterImageSpan as a replacement to ImageSpan, and allowing for center alignment if passed in. |
| void |
| [Expand] Inherited Methods | | --- | | From class android.text.style.ReplacementSpan
| abstract void | draw(Canvas arg0, CharSequence arg1, int arg2, int arg3, float arg4, int arg5, int arg6, int arg7, Paint arg8) | | abstract int | getSize(Paint arg0, CharSequence arg1, int arg2, int arg3, Paint.FontMetricsInt arg4) | | void | updateDrawState(TextPaint arg0) | | void | updateMeasureState(TextPaint arg0) |
| | From class android.text.style.MetricAffectingSpan
| CharacterStyle | getUnderlying() | | abstract void | updateMeasureState(TextPaint arg0) |
| | From class android.text.style.CharacterStyle
| CharacterStyle | getUnderlying() | | abstract void | updateDrawState(TextPaint arg0) | | static CharacterStyle | wrap(CharacterStyle arg0) |
| | From class java.lang.Object
| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |
|
Constant Value: 1 (0x00000001)
Constant Value: 0 (0x00000000)
Constant Value: 2 (0x00000002)
Returns the width of the image span and increases the height if font metrics are available.
A helper function to allow dropping in BetterImageSpan as a replacement to ImageSpan, and allowing for center alignment if passed in.
+Generated by Doclava. +