From 5dddb70b4eb37acd2d7a7abe6604153b6089eea9 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Wed, 2 Jul 2014 15:46:04 -0700 Subject: [PATCH] Add style for SearchView BUG: 6420978 Change-Id: I31d9f7e66c2404388ccbe6d2e43a005deb0b7c25 --- api/current.txt | 9 ++ core/java/android/widget/SearchView.java | 121 ++++++++++-------- .../android/widget/SuggestionsAdapter.java | 33 +++-- ...ic_clear_search_api_disabled_holo_dark.png | Bin 0 -> 739 bytes .../ic_clear_search_api_holo_dark.png | Bin 0 -> 874 bytes .../ic_go_search_api_holo_dark.png | Bin 0 -> 468 bytes ...ic_clear_search_api_disabled_holo_dark.png | Bin 0 -> 379 bytes .../ic_clear_search_api_holo_dark.png | Bin 0 -> 423 bytes .../ic_go_search_api_holo_dark.png | Bin 0 -> 245 bytes ...ic_clear_search_api_disabled_holo_dark.png | Bin 0 -> 1045 bytes .../ic_clear_search_api_holo_dark.png | Bin 0 -> 1286 bytes .../ic_go_search_api_holo_dark.png | Bin 0 -> 629 bytes core/res/res/drawable/ic_clear_holo_dark.xml | 22 ++++ .../textfield_searchview_holo_dark.xml | 3 +- .../textfield_searchview_holo_light.xml | 3 +- .../textfield_searchview_right_holo_dark.xml | 6 +- .../textfield_searchview_right_holo_light.xml | 6 +- .../res/layout/search_dropdown_item_1line.xml | 26 ---- .../search_dropdown_item_icons_2line.xml | 31 +++-- core/res/res/layout/search_view.xml | 51 +++----- core/res/res/values/attrs.xml | 46 ++++--- core/res/res/values/public.xml | 9 ++ core/res/res/values/styles.xml | 24 ++++ core/res/res/values/styles_material.xml | 15 ++- core/res/res/values/symbols.xml | 1 - core/res/res/values/themes.xml | 30 +---- core/res/res/values/themes_material.xml | 24 +--- 27 files changed, 238 insertions(+), 222 deletions(-) create mode 100644 core/res/res/drawable-hdpi/ic_clear_search_api_disabled_holo_dark.png create mode 100644 core/res/res/drawable-hdpi/ic_clear_search_api_holo_dark.png create mode 100644 core/res/res/drawable-hdpi/ic_go_search_api_holo_dark.png create mode 100644 core/res/res/drawable-mdpi/ic_clear_search_api_disabled_holo_dark.png create mode 100644 core/res/res/drawable-mdpi/ic_clear_search_api_holo_dark.png create mode 100644 core/res/res/drawable-mdpi/ic_go_search_api_holo_dark.png create mode 100644 core/res/res/drawable-xhdpi/ic_clear_search_api_disabled_holo_dark.png create mode 100644 core/res/res/drawable-xhdpi/ic_clear_search_api_holo_dark.png create mode 100644 core/res/res/drawable-xhdpi/ic_go_search_api_holo_dark.png create mode 100644 core/res/res/drawable/ic_clear_holo_dark.xml delete mode 100644 core/res/res/layout/search_dropdown_item_1line.xml diff --git a/api/current.txt b/api/current.txt index f9eebfe07e1de..9f3392d68c0b4 100644 --- a/api/current.txt +++ b/api/current.txt @@ -391,6 +391,7 @@ package android { field public static final int clipOrientation = 16843274; // 0x101020a field public static final int clipToPadding = 16842987; // 0x10100eb field public static final int clipToPath = 16843817; // 0x1010429 + field public static final int closeIcon = 16843907; // 0x1010483 field public static final int codes = 16843330; // 0x1010242 field public static final int collapseColumns = 16843083; // 0x101014b field public static final int color = 16843173; // 0x10101a5 @@ -414,6 +415,7 @@ package android { field public static final int columnDelay = 16843215; // 0x10101cf field public static final int columnOrderPreserved = 16843640; // 0x1010378 field public static final int columnWidth = 16843031; // 0x1010117 + field public static final int commitIcon = 16843911; // 0x1010487 field public static final int compatibleWidthLimitDp = 16843621; // 0x1010365 field public static final int completionHint = 16843122; // 0x1010172 field public static final int completionHintView = 16843123; // 0x1010173 @@ -598,6 +600,7 @@ package android { field public static final int gestureStrokeType = 16843385; // 0x1010279 field public static final int gestureStrokeWidth = 16843380; // 0x1010274 field public static final int glEsVersion = 16843393; // 0x1010281 + field public static final int goIcon = 16843908; // 0x1010484 field public static final int gradientRadius = 16843172; // 0x10101a4 field public static final int grantUriPermissions = 16842779; // 0x101001b field public static final int gravity = 16842927; // 0x10100af @@ -951,6 +954,7 @@ package android { field public static final int publicKey = 16843686; // 0x10103a6 field public static final int queryActionMsg = 16843227; // 0x10101db field public static final int queryAfterZeroResults = 16843394; // 0x1010282 + field public static final int queryBackground = 16843913; // 0x1010489 field public static final int queryHint = 16843608; // 0x1010358 field public static final int quickContactBadgeStyleSmallWindowLarge = 16843443; // 0x10102b3 field public static final int quickContactBadgeStyleSmallWindowMedium = 16843442; // 0x10102b2 @@ -1026,6 +1030,7 @@ package android { field public static final int scrollbars = 16842974; // 0x10100de field public static final int scrollingCache = 16843006; // 0x10100fe field public static final deprecated int searchButtonText = 16843269; // 0x1010205 + field public static final int searchIcon = 16843909; // 0x1010485 field public static final int searchKeyphrase = 16843873; // 0x1010461 field public static final int searchKeyphraseId = 16843872; // 0x1010460 field public static final int searchKeyphraseSupportedLocales = 16843874; // 0x1010462 @@ -1037,6 +1042,7 @@ package android { field public static final int searchSuggestPath = 16843223; // 0x10101d7 field public static final int searchSuggestSelection = 16843224; // 0x10101d8 field public static final int searchSuggestThreshold = 16843373; // 0x101026d + field public static final int searchViewStyle = 16843906; // 0x1010482 field public static final int secondaryProgress = 16843064; // 0x1010138 field public static final int secondaryProgressTint = 16843881; // 0x1010469 field public static final int secondaryProgressTintMode = 16843882; // 0x101046a @@ -1130,6 +1136,7 @@ package android { field public static final int strokeLineJoin = 16843816; // 0x1010428 field public static final int strokeOpacity = 16843810; // 0x1010422 field public static final int strokeWidth = 16843811; // 0x1010423 + field public static final int submitBackground = 16843914; // 0x101048a field public static final int subtitle = 16843473; // 0x10102d1 field public static final int subtitleTextAppearance = 16843825; // 0x1010431 field public static final int subtitleTextStyle = 16843513; // 0x10102f9 @@ -1138,6 +1145,7 @@ package android { field public static final int subtypeLocale = 16843673; // 0x1010399 field public static final int suggestActionMsg = 16843228; // 0x10101dc field public static final int suggestActionMsgColumn = 16843229; // 0x10101dd + field public static final int suggestionRowLayout = 16843912; // 0x1010488 field public static final int summary = 16843241; // 0x10101e9 field public static final int summaryColumn = 16843426; // 0x10102a2 field public static final int summaryOff = 16843248; // 0x10101f0 @@ -1317,6 +1325,7 @@ package android { field public static final int visibilityMode = 16843902; // 0x101047e field public static final int visible = 16843156; // 0x1010194 field public static final int vmSafeMode = 16843448; // 0x10102b8 + field public static final int voiceIcon = 16843910; // 0x1010486 field public static final int voiceLanguage = 16843349; // 0x1010255 field public static final int voiceLanguageModel = 16843347; // 0x1010253 field public static final int voiceMaxResults = 16843350; // 0x1010256 diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java index d8a6867569c87..0a3c7ff3219ef 100644 --- a/core/java/android/widget/SearchView.java +++ b/core/java/android/widget/SearchView.java @@ -99,6 +99,26 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { */ private static final String IME_OPTION_NO_MICROPHONE = "nm"; + private final SearchAutoComplete mQueryTextView; + private final View mSearchEditFrame; + private final View mSearchPlate; + private final View mSubmitArea; + private final ImageView mSearchButton; + private final ImageView mSubmitButton; + private final ImageView mCloseButton; + private final ImageView mVoiceButton; + private final ImageView mSearchHintIcon; + private final View mDropDownAnchor; + private final int mSearchIconResId; + + // Resources used by SuggestionsAdapter to display suggestions. + private final int mSuggestionRowLayout; + private final int mSuggestionCommitIconResId; + + // Intents used for voice searching. + private final Intent mVoiceWebSearchIntent; + private final Intent mVoiceAppSearchIntent; + private OnQueryTextListener mOnQueryChangeListener; private OnCloseListener mOnCloseListener; private OnFocusChangeListener mOnQueryTextFocusChangeListener; @@ -108,16 +128,6 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { private boolean mIconifiedByDefault; private boolean mIconified; private CursorAdapter mSuggestionsAdapter; - private View mSearchButton; - private View mSubmitButton; - private View mSearchPlate; - private View mSubmitArea; - private ImageView mCloseButton; - private View mSearchEditFrame; - private View mVoiceButton; - private SearchAutoComplete mQueryTextView; - private View mDropDownAnchor; - private ImageView mSearchHintIcon; private boolean mSubmitButtonEnabled; private CharSequence mQueryHint; private boolean mQueryRefinement; @@ -161,10 +171,6 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { } }; - // For voice searching - private final Intent mVoiceWebSearchIntent; - private final Intent mVoiceAppSearchIntent; - // A weak map of drawables we've gotten from other packages, so we don't load them // more than once. private final WeakHashMap mOutsideDrawablesCache = @@ -242,7 +248,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { } public SearchView(Context context, AttributeSet attrs) { - this(context, attrs, 0); + this(context, attrs, R.attr.searchViewStyle); } public SearchView(Context context, AttributeSet attrs, int defStyleAttr) { @@ -252,22 +258,39 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { public SearchView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); - LayoutInflater inflater = (LayoutInflater) context - .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - inflater.inflate(R.layout.search_view, this, true); + final TypedArray a = context.obtainStyledAttributes( + attrs, R.styleable.SearchView, defStyleAttr, defStyleRes); + final LayoutInflater inflater = (LayoutInflater) context.getSystemService( + Context.LAYOUT_INFLATER_SERVICE); + final int layoutResId = a.getResourceId(R.styleable.SearchView_layout, 0); + inflater.inflate(layoutResId, this, true); - mSearchButton = findViewById(R.id.search_button); mQueryTextView = (SearchAutoComplete) findViewById(R.id.search_src_text); mQueryTextView.setSearchView(this); mSearchEditFrame = findViewById(R.id.search_edit_frame); mSearchPlate = findViewById(R.id.search_plate); mSubmitArea = findViewById(R.id.submit_area); - mSubmitButton = findViewById(R.id.search_go_btn); + mSearchButton = (ImageView) findViewById(R.id.search_button); + mSubmitButton = (ImageView) findViewById(R.id.search_go_btn); mCloseButton = (ImageView) findViewById(R.id.search_close_btn); - mVoiceButton = findViewById(R.id.search_voice_btn); + mVoiceButton = (ImageView) findViewById(R.id.search_voice_btn); mSearchHintIcon = (ImageView) findViewById(R.id.search_mag_icon); + // Set up icons and backgrounds. + mSearchPlate.setBackground(a.getDrawable(R.styleable.SearchView_queryBackground)); + mSubmitArea.setBackground(a.getDrawable(R.styleable.SearchView_submitBackground)); + mSearchIconResId = a.getResourceId(R.styleable.SearchView_searchIcon, 0); + mSearchButton.setImageResource(mSearchIconResId); + mSubmitButton.setImageDrawable(a.getDrawable(R.styleable.SearchView_goIcon)); + mCloseButton.setImageDrawable(a.getDrawable(R.styleable.SearchView_closeIcon)); + mVoiceButton.setImageDrawable(a.getDrawable(R.styleable.SearchView_voiceIcon)); + mSearchHintIcon.setImageDrawable(a.getDrawable(R.styleable.SearchView_searchIcon)); + + // Extract dropdown layout resource IDs for later use. + mSuggestionRowLayout = a.getResourceId(R.styleable.SearchView_suggestionRowLayout, 0); + mSuggestionCommitIconResId = a.getResourceId(R.styleable.SearchView_commitIcon, 0); + mSearchButton.setOnClickListener(mOnClickListener); mCloseButton.setOnClickListener(mOnClickListener); mSubmitButton.setOnClickListener(mOnClickListener); @@ -279,6 +302,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { mQueryTextView.setOnItemClickListener(mOnItemClickListener); mQueryTextView.setOnItemSelectedListener(mOnItemSelectedListener); mQueryTextView.setOnKeyListener(mTextKeyListener); + // Inform any listener of focus changes mQueryTextView.setOnFocusChangeListener(new OnFocusChangeListener() { @@ -288,36 +312,30 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { } } }); - - TypedArray a = context.obtainStyledAttributes( - attrs, R.styleable.SearchView, defStyleAttr, defStyleRes); setIconifiedByDefault(a.getBoolean(R.styleable.SearchView_iconifiedByDefault, true)); - int maxWidth = a.getDimensionPixelSize(R.styleable.SearchView_maxWidth, -1); + + final int maxWidth = a.getDimensionPixelSize(R.styleable.SearchView_maxWidth, -1); if (maxWidth != -1) { setMaxWidth(maxWidth); } - CharSequence queryHint = a.getText(R.styleable.SearchView_queryHint); + + final CharSequence queryHint = a.getText(R.styleable.SearchView_queryHint); if (!TextUtils.isEmpty(queryHint)) { setQueryHint(queryHint); } - int imeOptions = a.getInt(R.styleable.SearchView_imeOptions, -1); + + final int imeOptions = a.getInt(R.styleable.SearchView_imeOptions, -1); if (imeOptions != -1) { setImeOptions(imeOptions); } - int inputType = a.getInt(R.styleable.SearchView_inputType, -1); + + final int inputType = a.getInt(R.styleable.SearchView_inputType, -1); if (inputType != -1) { setInputType(inputType); } a.recycle(); - boolean focusable = true; - - a = context.obtainStyledAttributes(attrs, R.styleable.View, defStyleAttr, defStyleRes); - focusable = a.getBoolean(R.styleable.View_focusable, focusable); - a.recycle(); - setFocusable(focusable); - // Save voice intent for later queries/launching mVoiceWebSearchIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH); mVoiceWebSearchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); @@ -342,6 +360,14 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { updateQueryHint(); } + int getSuggestionRowLayout() { + return mSuggestionRowLayout; + } + + int getSuggestionCommitIconResId() { + return mSuggestionCommitIconResId; + } + /** * Sets the SearchableInfo for this SearchView. Properties in the SearchableInfo are used * to display labels, hints, suggestions, create intents for launching search results screens @@ -1046,22 +1072,18 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { return result; } - private int getSearchIconId() { - TypedValue outValue = new TypedValue(); - getContext().getTheme().resolveAttribute(com.android.internal.R.attr.searchViewSearchIcon, - outValue, true); - return outValue.resourceId; - } - private CharSequence getDecoratedHint(CharSequence hintText) { // If the field is always expanded, then don't add the search icon to the hint - if (!mIconifiedByDefault) return hintText; + if (!mIconifiedByDefault) { + return hintText; + } - SpannableStringBuilder ssb = new SpannableStringBuilder(" "); // for the icon - ssb.append(hintText); - Drawable searchIcon = getContext().getDrawable(getSearchIconId()); - int textSize = (int) (mQueryTextView.getTextSize() * 1.25); + final Drawable searchIcon = getContext().getDrawable(mSearchIconResId); + final int textSize = (int) (mQueryTextView.getTextSize() * 1.25); searchIcon.setBounds(0, 0, textSize, textSize); + + final SpannableStringBuilder ssb = new SpannableStringBuilder(" "); // for the icon + ssb.append(hintText); ssb.setSpan(new ImageSpan(searchIcon), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); return ssb; } @@ -1363,11 +1385,6 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { } }; - @Override - public void onRtlPropertiesChanged(int layoutDirection) { - mQueryTextView.setLayoutDirection(layoutDirection); - } - /** * Query rewriting. */ diff --git a/core/java/android/widget/SuggestionsAdapter.java b/core/java/android/widget/SuggestionsAdapter.java index c8917e034ce82..63493477332ff 100644 --- a/core/java/android/widget/SuggestionsAdapter.java +++ b/core/java/android/widget/SuggestionsAdapter.java @@ -64,11 +64,13 @@ class SuggestionsAdapter extends ResourceCursorAdapter implements OnClickListene static final int REFINE_BY_ENTRY = 1; static final int REFINE_ALL = 2; - private SearchManager mSearchManager; - private SearchView mSearchView; - private SearchableInfo mSearchable; - private Context mProviderContext; - private WeakHashMap mOutsideDrawablesCache; + private final SearchManager mSearchManager; + private final SearchView mSearchView; + private final SearchableInfo mSearchable; + private final Context mProviderContext; + private final WeakHashMap mOutsideDrawablesCache; + private final int mCommitIconResId; + private boolean mClosed = false; private int mQueryRefinement = REFINE_BY_ENTRY; @@ -94,18 +96,18 @@ class SuggestionsAdapter extends ResourceCursorAdapter implements OnClickListene */ private static final long DELETE_KEY_POST_DELAY = 500L; - public SuggestionsAdapter(Context context, SearchView searchView, - SearchableInfo searchable, + public SuggestionsAdapter(Context context, SearchView searchView, SearchableInfo searchable, WeakHashMap outsideDrawablesCache) { - super(context, - com.android.internal.R.layout.search_dropdown_item_icons_2line, - null, // no initial cursor - true); // auto-requery + super(context, searchView.getSuggestionRowLayout(), null /* no initial cursor */, + true /* auto-requery */); + mSearchManager = (SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE); mSearchView = searchView; mSearchable = searchable; + mCommitIconResId = searchView.getSuggestionCommitIconResId(); + // set up provider resources (gives us icons, etc.) - Context activityContext = mSearchable.getActivityContext(mContext); + final Context activityContext = mSearchable.getActivityContext(mContext); mProviderContext = mSearchable.getProviderContext(mContext, activityContext); mOutsideDrawablesCache = outsideDrawablesCache; @@ -279,8 +281,13 @@ class SuggestionsAdapter extends ResourceCursorAdapter implements OnClickListene */ @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { - View v = super.newView(context, cursor, parent); + final View v = super.newView(context, cursor, parent); v.setTag(new ChildViewCache(v)); + + // Set up icon. + final ImageView iconRefine = (ImageView) v.findViewById(R.id.edit_query); + iconRefine.setImageResource(mCommitIconResId); + return v; } diff --git a/core/res/res/drawable-hdpi/ic_clear_search_api_disabled_holo_dark.png b/core/res/res/drawable-hdpi/ic_clear_search_api_disabled_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..62ec3df98c88cd813a4c2fcf5fa3bdd1663cce55 GIT binary patch literal 739 zcmV<90v!E`P)_?I(o*okWiI!gd(S!FcOGLfY{q8%Cu8d`-T7^BG|e=5_T^M6R^Bmc zRc`eA{ZGQ-@Uv_-d*F7vcWKXhj}bWIAsdg!4@6Pi^Z9&FY0sp^081zo+H1GlF9w6b z+hVckq&?vdBRJ-@P%f7p{eJ&Vx7&RQBiQ~Q^Jj(U!{PAVYPAx_2&&qV&Fc?)CD3Q zfX9tS;}}NB(8gl1L(l=(Baw&%`+B{;fbvSEa-u-Vs7ESVS!6p2+ABJm&87=e341D) za;eN1?Q~2glXFrSo6qOxm{{ux`(1R{WID*(Zv^>I;yg<0@AZ1!%{;g10sCzzNCqI< zSx`oq0bfA{GJzSuJw`8(icB;bwNq{Q0NCLW%yVQw5WxsKFtJ8<$SDenaOa^$T)_@#;kjI7 z3Wb8}dLcru01`~*3?=!YbeLuDpqxDaaYK>elyw4UtXPRa0u_^$VolA6M@yxLUISX> zJM#RNW+WMbGbJ5pWDJRIEhw1LN;{p-D?;E?sZ=^v(T=5Jg@%Pn+3WRADJb`~(qQs> zz1w(z8jYPnspf~o3R&F2UA&?7hh&Rg2Fo`~qCo VP$`2Frc?j`002ovPDHLkV1l#cR%rkL literal 0 HcmV?d00001 diff --git a/core/res/res/drawable-hdpi/ic_clear_search_api_holo_dark.png b/core/res/res/drawable-hdpi/ic_clear_search_api_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..9b4a1b6078786e3bfdf2fff28160523d0d31e219 GIT binary patch literal 874 zcmV-w1C{)VP)YSk)k1dCF9AnHPN-F8vC zXu#M~FfWzFZ6Cj*t?t@YDgD07Nx1}T%~hd=3=FxPGv}O{Z)UzpPEJ;`@*jv!rRRC( z$V>8|SD+U0t3SaxecG8kt&Zefhq&GDijk3#DhC8>g;2vWXSi2L+rh!XDv!rgQCwVX z#o7fe(VO`A#>U2@a5(&8c6PQIYp!FQFo-?Z%*;#^&O8qWgO58qJ8xmFAX5}*ERBwi z-i<^euM&yGK`a(~)7#ryZ#J790$zO@>=y0?0)g6SG#W}KlLz?S92*k)d;o%4IcsvXzzTm>Q3kwTvR;x9Y4x`Y*l9G~ApwtSRE!yHtYD*HOtUIQ`m-VffL(`!Winbp3&zTQD48Z1n90t&UBwnvbaCNZSiaDINi zg^!aJNiytntUIYJOwk=|(JhcwtEvqRr;41Ac6WEzh{zR^0oSLhy-28QdU~2I8c&fG zDOuQPLV~oJ&#A^pMdS+XD=RA$p2 zmjsp!^%RE3<>P9K&eKN}J7Q$J%8r4iK_S(5s@* z3NrXhW)_50ARf;>O)Kie1v-sqbU9hc%D*hX0F(oZ<6jPtQvd(}07*qoM6N<$f@P?Z AS^xk5 literal 0 HcmV?d00001 diff --git a/core/res/res/drawable-hdpi/ic_go_search_api_holo_dark.png b/core/res/res/drawable-hdpi/ic_go_search_api_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..f062bf7228ae106f2ed3e1457ef70ee811fa2fda GIT binary patch literal 468 zcmV;_0W1EAP)`)~!>Unwso^a;mhB4ipC*IdbGb z2m{&gLD6AkWTeN=&aO(!=)md#ApQsBzuCTh`;7APayw{r&?F>qIRK17(E$vJX|=Vr zpy&W4OaW>;0P1E5hbcR->5WH~S=%!HN+bWMbyV1Elre3g}z_H@sNpn?b~<*U)HAOaP|pkN2p z2MrAk4$z`lfL=xMGf;K|#`)~x;$q~|kLHyTtUA624EA|Q)v*9w8zdVxY-j;CNL=X= z?C9-5eo&Ll#l^)?R8&-z9&G?@jsUd-MWOV7wTzkR?ekGEya51d=}+QSLE5DN0000< KMNUMnLSTaU_s3ZP literal 0 HcmV?d00001 diff --git a/core/res/res/drawable-mdpi/ic_clear_search_api_disabled_holo_dark.png b/core/res/res/drawable-mdpi/ic_clear_search_api_disabled_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..6a34dba70de1c5787f42b61945fa9471963a56a0 GIT binary patch literal 379 zcmV->0fhdEP)z6#wpP&>Luu^Gq>4sq}K}ZTsBI>#fE8r=Jk)L9L#9pp@T~_dni;NrPt+dDxkb53X?C$YRsG}D4WJT#2eZSY*Kxqrkt5X{`KQaGT Z@dh_uieZe0C0GCe002ovPDHLkV1i1OrilOm literal 0 HcmV?d00001 diff --git a/core/res/res/drawable-mdpi/ic_clear_search_api_holo_dark.png b/core/res/res/drawable-mdpi/ic_clear_search_api_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..ee165284a64d5efae607fd628ab6438813a8978f GIT binary patch literal 423 zcmV;Y0a*TtP)qO@?< zS9)~Thr?mVb=^ap_ck%+Wj&7Li|KSa4}#!aRn_JPU|rL+2I`%nDCTLJUZG~o$iSzy z!!YaucnQWQJR_^3?f`I^B+0d?8?w3@rfD|F7yygGU_fBY^E?MX^f(%gdb}?K_=zz9 zE&=?M=Xngk=Pb)gGh7Wm*&2_>x3k&o1>Za2it2X(Ih;0zazv(+$>g3)A%!ED>ZJjp zSrfJ);DQ>GA*JB(I4q&5UWQ@I_x)o6!Ztm@ti~_SZ@^%D%03xw={HN*=7F|ZnX*Bj z!WCWKb3stsmoa~hI)c#+HfP=)AoR6l%)c#G&)%^6w&>G;?O*B-#VbR)qvtH# RwZi}a002ovPDHLkV1iCE#*qL3 literal 0 HcmV?d00001 diff --git a/core/res/res/drawable-mdpi/ic_go_search_api_holo_dark.png b/core/res/res/drawable-mdpi/ic_go_search_api_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..591f734fa8942c430947c73d543d4402974d7391 GIT binary patch literal 245 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1|(OCFP#RY_ISEDhE&{2PLN=&U|<*c9C+2i z)6?_pojWnr3eij*k}DHeY*@Q??Y)10fBRcnSV%DZoD^dG<-|ng{omi-E?=}^!v&r! z1LaU2)<^#xn*CofF)r0}GZaZH@bv7oRMk6XAkyNP$Wyve9JP*H8JqfJz1){?S{Q?C$}LFtE*pN;6zqcJr~0-2O625$Hd0+YLqJ4y!ZC- s$Y4Btp;5|`Q?h_@BZDcg3?l=>wy%AaGw*xJ0{y|@>FVdQ&MBb@0A_hr_y7O^ literal 0 HcmV?d00001 diff --git a/core/res/res/drawable-xhdpi/ic_clear_search_api_disabled_holo_dark.png b/core/res/res/drawable-xhdpi/ic_clear_search_api_disabled_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..272e34abf3c2a997b40a3837b52f75c66e83a7e8 GIT binary patch literal 1045 zcmV+w1nT>VP)gn}N>UbN~0;-#zEdR8_gnZEkbhf6=sSX6IbvUg~w! zebj3zv{S?5>)2kkYM~zLe(E}RgL;4`E7wkd$Lmt}suGHo>%G0b_1SE;Wol~b4zBc@ z$&-3Y*iwx>3ZcQ_;o+8iK7V^`Z0u%FPfr8?enW-WS{Q@Cm6eqzdwY9vTxpUJ{T`MC zm*UZIUtgcOw6ye??7UuETYCz@e9xzXQ)~O-(cRtMw_iX(_xJZd9vvMGlAXllgsBgJ!`O2G!=(ScqY8QzW$6R`hp4J;l;(p2kCUW(Z+DK%;@Oo zXv4z7LOT}7vOr2|27`0a7gya55pB zVH7M1k4m{-&R`~owQif>c4pXgis3ViVyh)a2auVh`c{;C*7K+tfPfT-txV?>!!;K$ zI$(>Va@8eLvx)l`)DlV=Mg?zBylm!NUtkoOi5Wewo)wwSz;j^QUQ0|&OteTyC@H>m zyffid1VZ6a&h=&qxn8a%EQYaA*g;&TI^wRV&{VLC$@KB@@m3rn-ombUJRUCd9n7jF zFb*C@HAcc;=5o1P?A1CIV)51)h{a-!Fg!au+r}xh+_&2T!x#@cum`&;-)=SWhAW-) zO1~R;ZQl)q&03Y=OXHRMcoP35!j1gF#K(3uCo`FL4Q#m0ZEkbhztDaIqLM4J5)#2h P00000NkvXXu0mjfAc*YD literal 0 HcmV?d00001 diff --git a/core/res/res/drawable-xhdpi/ic_clear_search_api_holo_dark.png b/core/res/res/drawable-xhdpi/ic_clear_search_api_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..81da97054265562f8a619026566d57ddcdc8d1e8 GIT binary patch literal 1286 zcmV+h1^N1kP)KcLHp(im%>6V44cLmG+mYG{}Xmpk*$UCw*%x#xNA z1O)|3pae>wJoUxoQ=ilv>z3_OL!^dDeL?E34bHQR&#(hKlHbkmX;oG zYHE6|y1Lq(nwolqz;_y<(dVSv0JOiqziN7V`qIF_z}fWl^n>!;NdS8u!LW(Hqn|S+ zCB-4*E2pNWE)EY5zh6^Rb4s2^O5NwLhB0_QwyU|hIcH{OW`1E|;qTem*&k$~^JLdS zApf+6~v%>IIX5gHQ)PI9527Z(@rVnHyRlaqsO zj3J=C8apO_$Mfi{tgOR*eSIDow~X=g^YgbxMn*o6;^z35j9?a8vysI^6B833$%5Bp z!BsHa-Q8VWQBiT!N5eaGjh2^}ySlo%itvIm?w`52xf?RiCzy}pB7I)eZ#RghM&lp> zEGP@F0e~>}j?3kW=kGR32dy(HDJibExA$!VU6XOQM@L6LBuFRcwHRq#X6=wT#0^{k zNWftDifrjQya+)YWE(3l=H=Fd(c3s&+zE$vIL$_Tty$M#QBhHnX!t!%!^;3d4O??_ za}$KocL{VA8XX!MI#*Isa*S*$jhlluv4koug2Az|v5yHD3}5Z+>?{=Lcoi+TepMK~ zIX*uAx%7|Mv>m!tIl==P7RGA995g9D{PpDIEnYBF$W|b>IgRwn5J>|0H zm+8Ad3dltS4CTXc1@zN2yLYRAhG=ep!*!NG5kh~3cH7(AQ}6;jba07f_^sx{QAVbP z>jj3Gyu3V@04gES6$A(g3>OLu3lpJHv~UUK!y=I@c#(pF0+;5qn-&mMtalU_7axX? z3V?5wkBZ-ZsxhbhG>$%eUHLF_1dP`rnBf|JK%=y&%gRR)nUa%}Rc-)#dYP>gIfMLO zqkNdTga_%O(Hce;6wG|{UhWEwlF_>=){AW^AB`qcJK5s99X>0Gd&NUE?BKyu8umLy zLwiqt3k^c=MIX;3_-E0lBFD&#d|49jFLb6f2*~81B wl^}yRD_1aaVk7?R@^_v<36wwyl>bBd7qYyUgcggtLI3~&07*qoM6N<$f}_S|ng9R* literal 0 HcmV?d00001 diff --git a/core/res/res/drawable-xhdpi/ic_go_search_api_holo_dark.png b/core/res/res/drawable-xhdpi/ic_go_search_api_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..0d0758c234bc676db2a4fe623560297b9f24d0e1 GIT binary patch literal 629 zcmV-*0*d{KP)(T9ixAunMrCr#2uY#t)nxiR-$7P*jY zOGVIDs|)ohyniEONu`zwlFZ@^d?e?x_%VEE{xhQ}dg!5t9`_Ljs2zF;wMhnj0QEqF zP(Rcy8MF_22|edu6?!BQ)(AaQRn?YABo-r)$VXg{Ko-uhC`$}LFYI=^tynCs<@5P3 zKA&#}_g+K8&|^u!L(nUi%Qac4RF0tiR4V0jI-NF?$@GS@4s}U{-K*7VC*^YaXC{*g zy4~(6JR4;XcZz}qNgno8fu%)kb5unfGN%jLrCVfyH-&Ghh{VA;dJ3WdUo-|v6Vhelts>~L3D(m9Ui zbUYqkU@P=Xg{92yA+ukD!QcncnWdu`p8YJ|vv|IVYM@E42Io`-a4=}mX!Kn}uOP0@ zl1F!`T!}xyZq!w|y#cN_;L$)s*JT#fbv5*}Kd1o@hr + + + + + + diff --git a/core/res/res/drawable/textfield_searchview_holo_dark.xml b/core/res/res/drawable/textfield_searchview_holo_dark.xml index 1396f83356f03..73131a5c9a859 100644 --- a/core/res/res/drawable/textfield_searchview_holo_dark.xml +++ b/core/res/res/drawable/textfield_searchview_holo_dark.xml @@ -16,7 +16,6 @@ + android:drawable="@drawable/textfield_search_selected_holo_dark" /> - diff --git a/core/res/res/drawable/textfield_searchview_holo_light.xml b/core/res/res/drawable/textfield_searchview_holo_light.xml index 5198f9cb0c762..cfeb1b51b89d8 100644 --- a/core/res/res/drawable/textfield_searchview_holo_light.xml +++ b/core/res/res/drawable/textfield_searchview_holo_light.xml @@ -16,7 +16,6 @@ + android:drawable="@drawable/textfield_search_selected_holo_light" /> - diff --git a/core/res/res/drawable/textfield_searchview_right_holo_dark.xml b/core/res/res/drawable/textfield_searchview_right_holo_dark.xml index b4f1ca1ce19fa..83b772ea11772 100644 --- a/core/res/res/drawable/textfield_searchview_right_holo_dark.xml +++ b/core/res/res/drawable/textfield_searchview_right_holo_dark.xml @@ -14,9 +14,9 @@ limitations under the License. --> - + + android:drawable="@drawable/textfield_search_right_selected_holo_dark" /> - diff --git a/core/res/res/drawable/textfield_searchview_right_holo_light.xml b/core/res/res/drawable/textfield_searchview_right_holo_light.xml index e521bf6e27450..2b6983ba663dc 100644 --- a/core/res/res/drawable/textfield_searchview_right_holo_light.xml +++ b/core/res/res/drawable/textfield_searchview_right_holo_light.xml @@ -14,9 +14,9 @@ limitations under the License. --> - + + android:drawable="@drawable/textfield_search_right_selected_holo_light" /> - diff --git a/core/res/res/layout/search_dropdown_item_1line.xml b/core/res/res/layout/search_dropdown_item_1line.xml deleted file mode 100644 index eed8b7d9b6334..0000000000000 --- a/core/res/res/layout/search_dropdown_item_1line.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - \ No newline at end of file diff --git a/core/res/res/layout/search_dropdown_item_icons_2line.xml b/core/res/res/layout/search_dropdown_item_icons_2line.xml index 730d606cd9bd7..b135e3d3f5aba 100644 --- a/core/res/res/layout/search_dropdown_item_icons_2line.xml +++ b/core/res/res/layout/search_dropdown_item_icons_2line.xml @@ -22,11 +22,11 @@ android:paddingStart="@dimen/dropdownitem_text_padding_left" android:paddingEnd="4dip" android:layout_width="match_parent" - android:layout_height="?android:attr/searchResultListItemHeight" > + android:layout_height="?attr/searchResultListItemHeight" > - - - - + android:layout_toEndOf="@id/icon1" + android:layout_toStartOf="@id/icon2" + android:layout_above="@id/text2" /> diff --git a/core/res/res/layout/search_view.xml b/core/res/res/layout/search_view.xml index 29c0576ffbde2..1a7324ad7d2ce 100644 --- a/core/res/res/layout/search_view.xml +++ b/core/res/res/layout/search_view.xml @@ -22,8 +22,7 @@ android:id="@+id/search_bar" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="horizontal" - > + android:orientation="horizontal"> + android:textAppearance="?attr/textAppearanceMedium" + android:textColor="?attr/textColorPrimary" + android:visibility="gone" /> + android:contentDescription="@string/searchview_description_search" /> + android:orientation="horizontal" + android:layoutDirection="locale"> + android:visibility="gone" /> + android:orientation="horizontal"> + android:contentDescription="@string/searchview_description_query" /> + android:contentDescription="@string/searchview_description_clear" /> @@ -122,8 +113,7 @@ android:id="@+id/submit_area" android:orientation="horizontal" android:layout_width="wrap_content" - android:layout_height="match_parent" - android:background="?android:attr/searchViewTextFieldRight"> + android:layout_height="match_parent"> + android:contentDescription="@string/searchview_description_submit" /> + android:contentDescription="@string/searchview_description_voice" /> - diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 5aebeced5141a..d0a22ef04660b 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -894,6 +894,9 @@ + + + @@ -910,29 +913,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -6799,9 +6779,11 @@ + + - + @@ -6810,6 +6792,22 @@ + + + + + + + + + + + + + + + + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 3818f106b3882..8e93353107722 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2219,6 +2219,15 @@ + + + + + + + + + diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 50558547a6a9d..d7a71cc9c8189 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -1641,6 +1641,18 @@ please see styles_device_defaults.xml. 48dip + + + + + + @@ -684,7 +696,7 @@ please see styles_device_defaults.xml.