How to change the search color?

I would like to change the color of the progress and the color of the thumb in the search bar. I used drawable to change the color of the progress, but the thickness of the progress has changed. Is there a way to change the color and the color of the run.

Picture

I want to change the default search color as the second in the image.

+6
source share
2 answers

It is very simple if you use the material theme in your project.

Just check what style you use in the manifest for your application. It will be something like below:

<application android:allowBackup="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme"> 

Now follow @style/AppTheme

You might want to install the parent theme: Theme.AppCompat.Light.DarkActionBar

Note. The colorAccent attribute will give the desired color to all your widgets.

  <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/PrimaryColor</item> <item name="colorPrimaryDark">@color/DarkPrimaryColor</item> <item name="colorAccent">@color/DarkPrimaryColor</item> <item name="android:textColorSecondary">@color/PrimaryColor</item> <item name="android:itemBackground">@color/DarkPrimaryColor</item> <item name="android:textColor">@color/TextIconsColor</item> </style> 

So, if you want, you can create this custom theme for your layouts or activities for the entire theme of the application.

This works for me and its as recommended by the developer. Link: Google Developers

+6
source

You can use this. The library supports excellent customization.

0
source

Source: https://habr.com/ru/post/1012855/


All Articles