Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1456f29a authored by czq's avatar czq
Browse files

Fix TextAppearanceInfo related APIs

1. Add a builder for TextAppearanceInfo, remove the constructor using TextView.
2. Remove maxLength attribute, add shadowColor.
3. Replace -1 with FontStyle.FONT_WEIGHT_UNSPECIFIED for textFontWeight.

Bug: 256995042

Test: atest android.view.inputmethod.cts.CursorAnchorInfoTest#testBuilder
atest android.view.inputmethod.cts.CursorAnchorInfoTest#testEquality
atest android.view.inputmethod.cts.CursorAnchorInfoTest#testTextAppearanceInfoWithEmptyEditText
atest android.view.inputmethod.cts.InputMethodServiceTest#testOnUpdateCursorAnchorInfo

Change-Id: I80faea43e6a96110171f61e18a6d744e719bdf58
parent 2111954a
Loading
Loading
Loading
Loading
+33 −7
Original line number Diff line number Diff line
@@ -53961,23 +53961,22 @@ package android.view.inputmethod {
  }
  public final class TextAppearanceInfo implements android.os.Parcelable {
    ctor public TextAppearanceInfo(@NonNull android.widget.TextView);
    method public int describeContents();
    method @Nullable public String getFontFamilyName();
    method @Nullable public String getFontFeatureSettings();
    method @Nullable public String getFontVariationSettings();
    method @ColorInt public int getHighlightTextColor();
    method @ColorInt public int getHintTextColor();
    method public float getLetterSpacing();
    method public int getLineBreakStyle();
    method public int getLineBreakWordStyle();
    method public int getMaxLength();
    method @ColorInt public int getLinkTextColor();
    method @ColorInt public int getShadowColor();
    method @Px public float getShadowDx();
    method @Px public float getShadowDy();
    method @Px public float getShadowRadius();
    method @Nullable public String getSystemFontFamilyName();
    method @ColorInt public int getTextColor();
    method @ColorInt public int getTextColorHighlight();
    method @ColorInt public int getTextColorHint();
    method @Nullable public android.content.res.ColorStateList getTextColorLink();
    method @IntRange(from=0xffffffff, to=android.graphics.fonts.FontStyle.FONT_WEIGHT_MAX) public int getTextFontWeight();
    method @IntRange(from=android.graphics.fonts.FontStyle.FONT_WEIGHT_UNSPECIFIED, to=android.graphics.fonts.FontStyle.FONT_WEIGHT_MAX) public int getTextFontWeight();
    method @NonNull public android.os.LocaleList getTextLocales();
    method public float getTextScaleX();
    method @Px public float getTextSize();
@@ -53989,6 +53988,33 @@ package android.view.inputmethod {
    field @NonNull public static final android.os.Parcelable.Creator<android.view.inputmethod.TextAppearanceInfo> CREATOR;
  }
  public static final class TextAppearanceInfo.Builder {
    ctor public TextAppearanceInfo.Builder();
    method @NonNull public android.view.inputmethod.TextAppearanceInfo build();
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setAllCaps(boolean);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setElegantTextHeight(boolean);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setFallbackLineSpacing(boolean);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setFontFeatureSettings(@Nullable String);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setFontVariationSettings(@Nullable String);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setHighlightTextColor(@ColorInt int);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setHintTextColor(@ColorInt int);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setLetterSpacing(float);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setLineBreakStyle(int);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setLineBreakWordStyle(int);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setLinkTextColor(@ColorInt int);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setShadowColor(@ColorInt int);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setShadowDx(@Px float);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setShadowDy(@Px float);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setShadowRadius(@Px float);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setSystemFontFamilyName(@Nullable String);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setTextColor(@ColorInt int);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setTextFontWeight(@IntRange(from=android.graphics.fonts.FontStyle.FONT_WEIGHT_UNSPECIFIED, to=android.graphics.fonts.FontStyle.FONT_WEIGHT_MAX) int);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setTextLocales(@NonNull android.os.LocaleList);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setTextScaleX(float);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setTextSize(@Px float);
    method @NonNull public android.view.inputmethod.TextAppearanceInfo.Builder setTextStyle(int);
  }
  public final class TextAttribute implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.os.PersistableBundle getExtras();