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

Commit c99fd2f9 authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Add highlight API for search result range

The search result highlight API is added next to the highlight APIs
becasue of following reasons.
- The search result API draws always top of the developer given
  highlight APIs.
- highlight and focused highlight color should be customizable by
  themeing.

Bug: 244502332
Test: atest android.widget.cts.TextViewSearchResultHighlightTest
Change-Id: Idb52e7080ee33a5315878e42a3d7349bc3a90627
parent bf3823e8
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -744,6 +744,7 @@ package android {
    field public static final int focusableInTouchMode = 16842971; // 0x10100db
    field public static final int focusedByDefault = 16844100; // 0x1010544
    field @Deprecated public static final int focusedMonthDateColor = 16843587; // 0x1010343
    field public static final int focusedSearchResultHighlightColor;
    field public static final int font = 16844082; // 0x1010532
    field public static final int fontFamily = 16843692; // 0x10103ac
    field public static final int fontFeatureSettings = 16843959; // 0x10104b7
@@ -1355,6 +1356,7 @@ package android {
    field public static final int searchHintIcon = 16843988; // 0x10104d4
    field public static final int searchIcon = 16843907; // 0x1010483
    field public static final int searchMode = 16843221; // 0x10101d5
    field public static final int searchResultHighlightColor;
    field public static final int searchSettingsDescription = 16843402; // 0x101028a
    field public static final int searchSuggestAuthority = 16843222; // 0x10101d6
    field public static final int searchSuggestIntentAction = 16843225; // 0x10101d9
@@ -59275,6 +59277,7 @@ package android.widget {
    method public void append(CharSequence, int, int);
    method public void beginBatchEdit();
    method public boolean bringPointIntoView(int);
    method public boolean bringPointIntoView(@IntRange(from=0) int, boolean);
    method public void clearComposingText();
    method public void debug(int);
    method public boolean didTouchFocusSelect();
@@ -59312,6 +59315,8 @@ package android.widget {
    method public int getExtendedPaddingTop();
    method public android.text.InputFilter[] getFilters();
    method public int getFirstBaselineToTopHeight();
    method @ColorInt public int getFocusedSearchResultHighlightColor();
    method public int getFocusedSearchResultIndex();
    method @Nullable public String getFontFeatureSettings();
    method @Nullable public String getFontVariationSettings();
    method public boolean getFreezesText();
@@ -59356,6 +59361,8 @@ package android.widget {
    method public android.text.TextPaint getPaint();
    method public int getPaintFlags();
    method public String getPrivateImeOptions();
    method @ColorInt public int getSearchResultHighlightColor();
    method @Nullable public int[] getSearchResultHighlights();
    method public int getSelectionEnd();
    method public int getSelectionStart();
    method @ColorInt public int getShadowColor();
@@ -59440,6 +59447,8 @@ package android.widget {
    method public void setFallbackLineSpacing(boolean);
    method public void setFilters(android.text.InputFilter[]);
    method public void setFirstBaselineToTopHeight(@IntRange(from=0) @Px int);
    method public void setFocusedSearchResultHighlightColor(@ColorInt int);
    method public void setFocusedSearchResultIndex(int);
    method public void setFontFeatureSettings(@Nullable String);
    method public boolean setFontVariationSettings(@Nullable String);
    method protected boolean setFrame(int, int, int, int);
@@ -59487,6 +59496,8 @@ package android.widget {
    method public void setPrivateImeOptions(String);
    method public void setRawInputType(int);
    method public void setScroller(android.widget.Scroller);
    method public void setSearchResultHighlightColor(@ColorInt int);
    method public void setSearchResultHighlights(@Nullable int...);
    method public void setSelectAllOnFocus(boolean);
    method public void setShadowLayer(float, float, float, int);
    method public final void setShowSoftInputOnFocus(boolean);
@@ -59526,6 +59537,7 @@ package android.widget {
    method public void setWidth(int);
    field public static final int AUTO_SIZE_TEXT_TYPE_NONE = 0; // 0x0
    field public static final int AUTO_SIZE_TEXT_TYPE_UNIFORM = 1; // 0x1
    field public static final int FOCUSED_SEARCH_RESULT_INDEX_NONE = -1; // 0xffffffff
  }
  public enum TextView.BufferType {
+351 −2

File changed.

Preview size limit exceeded, changes collapsed.

+17 −0
Original line number Diff line number Diff line
@@ -5138,6 +5138,15 @@
        <attr name="textLocale" format="string" />
        <!-- Color of the text selection highlight. -->
        <attr name="textColorHighlight" />
        <!-- Color of search results highlight.
             This color is typically used when TextView/EditText shows search result in-app text
             search invoked with Ctrl+F. -->
        <attr name="searchResultHighlightColor" format="color" />
        <!-- Color of focused search result highlight.
             This color is typically used when TextView/EditText shows search result in-app text
             search invoked with Ctrl+F. -->
        <attr name="focusedSearchResultHighlightColor" format="color" />
        <!-- Color of the hint text. -->
        <attr name="textColorHint" />
        <!-- Color of the links. -->
@@ -5215,6 +5224,14 @@
        <attr name="textColor" />
        <!-- Color of the text selection highlight. -->
        <attr name="textColorHighlight" />
        <!-- Color of search results highlight.
             This color is typically used when TextView/EditText shows search result in-app text
             search invoked with Ctrl+F. -->
        <attr name="searchResultHighlightColor" format="color" />
        <!-- Color of focused search result highlight.
             This color is typically used when TextView/EditText shows search result in-app text
             search invoked with Ctrl+F. -->
        <attr name="focusedSearchResultHighlightColor" format="color" />
        <!-- Color of the hint text. -->
        <attr name="textColorHint" />
        <!-- Base text color, typeface, size, and style. -->
+2 −0
Original line number Diff line number Diff line
@@ -126,6 +126,8 @@
    <public name="keyboardLayoutType" />
    <public name="allowUpdateOwnership" />
    <public name="isCredential"/>
    <public name="searchResultHighlightColor" />
    <public name="focusedSearchResultHighlightColor" />
  </staging-public-group>

  <staging-public-group type="id" first-id="0x01cd0000">