Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -47478,6 +47478,7 @@ package android.text.style { method public int getVerticalAlignment(); field public static final int ALIGN_BASELINE = 1; // 0x1 field public static final int ALIGN_BOTTOM = 0; // 0x0 field public static final int ALIGN_CENTER = 2; // 0x2 field protected final int mVerticalAlignment; } core/java/android/text/style/DynamicDrawableSpan.java +22 −6 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.text.style; import static java.lang.annotation.RetentionPolicy.SOURCE; import android.annotation.IntDef; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; Loading @@ -25,6 +28,7 @@ import android.graphics.Paint; import android.graphics.Rect; import android.graphics.drawable.Drawable; import java.lang.annotation.Retention; import java.lang.ref.WeakReference; /** Loading Loading @@ -80,10 +84,21 @@ public abstract class DynamicDrawableSpan extends ReplacementSpan { /** * A constant indicating that this span should be vertically centered between * the top and the lowest descender. * @hide */ public static final int ALIGN_CENTER = 2; /** * Defines acceptable alignment types. * @hide */ @Retention(SOURCE) @IntDef(prefix = { "ALIGN_" }, value = { ALIGN_BOTTOM, ALIGN_BASELINE, ALIGN_CENTER }) public @interface AlignmentType {} protected final int mVerticalAlignment; @UnsupportedAppUsage Loading @@ -100,17 +115,18 @@ public abstract class DynamicDrawableSpan extends ReplacementSpan { /** * Creates a {@link DynamicDrawableSpan} based on a vertical alignment.\ * * @param verticalAlignment one of {@link #ALIGN_BOTTOM} or {@link #ALIGN_BASELINE} * @param verticalAlignment one of {@link #ALIGN_BOTTOM}, {@link #ALIGN_BASELINE} or * {@link #ALIGN_CENTER} */ protected DynamicDrawableSpan(int verticalAlignment) { protected DynamicDrawableSpan(@AlignmentType int verticalAlignment) { mVerticalAlignment = verticalAlignment; } /** * Returns the vertical alignment of this span, one of {@link #ALIGN_BOTTOM} or * {@link #ALIGN_BASELINE}. * Returns the vertical alignment of this span, one of {@link #ALIGN_BOTTOM}, * {@link #ALIGN_BASELINE} or {@link #ALIGN_CENTER}. */ public int getVerticalAlignment() { public @AlignmentType int getVerticalAlignment() { return mVerticalAlignment; } Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -47478,6 +47478,7 @@ package android.text.style { method public int getVerticalAlignment(); field public static final int ALIGN_BASELINE = 1; // 0x1 field public static final int ALIGN_BOTTOM = 0; // 0x0 field public static final int ALIGN_CENTER = 2; // 0x2 field protected final int mVerticalAlignment; }
core/java/android/text/style/DynamicDrawableSpan.java +22 −6 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.text.style; import static java.lang.annotation.RetentionPolicy.SOURCE; import android.annotation.IntDef; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; Loading @@ -25,6 +28,7 @@ import android.graphics.Paint; import android.graphics.Rect; import android.graphics.drawable.Drawable; import java.lang.annotation.Retention; import java.lang.ref.WeakReference; /** Loading Loading @@ -80,10 +84,21 @@ public abstract class DynamicDrawableSpan extends ReplacementSpan { /** * A constant indicating that this span should be vertically centered between * the top and the lowest descender. * @hide */ public static final int ALIGN_CENTER = 2; /** * Defines acceptable alignment types. * @hide */ @Retention(SOURCE) @IntDef(prefix = { "ALIGN_" }, value = { ALIGN_BOTTOM, ALIGN_BASELINE, ALIGN_CENTER }) public @interface AlignmentType {} protected final int mVerticalAlignment; @UnsupportedAppUsage Loading @@ -100,17 +115,18 @@ public abstract class DynamicDrawableSpan extends ReplacementSpan { /** * Creates a {@link DynamicDrawableSpan} based on a vertical alignment.\ * * @param verticalAlignment one of {@link #ALIGN_BOTTOM} or {@link #ALIGN_BASELINE} * @param verticalAlignment one of {@link #ALIGN_BOTTOM}, {@link #ALIGN_BASELINE} or * {@link #ALIGN_CENTER} */ protected DynamicDrawableSpan(int verticalAlignment) { protected DynamicDrawableSpan(@AlignmentType int verticalAlignment) { mVerticalAlignment = verticalAlignment; } /** * Returns the vertical alignment of this span, one of {@link #ALIGN_BOTTOM} or * {@link #ALIGN_BASELINE}. * Returns the vertical alignment of this span, one of {@link #ALIGN_BOTTOM}, * {@link #ALIGN_BASELINE} or {@link #ALIGN_CENTER}. */ public int getVerticalAlignment() { public @AlignmentType int getVerticalAlignment() { return mVerticalAlignment; } Loading