Change the color of the text in the search dialog box

I created my application using the theme described here .

<style name="MyThemeNameHere" parent="@android:style/Theme.NoTitleBar">
    <item name="android:windowBackground">@drawable/background</item>
    <item name="android:textColor">#eee</item>
<style>

It works like a charm in most applications. The background is quite dark, while the text is bright and the text looks good and easy to read.

Now in the dialog box that the android creates for me, the background is white, but the color of the text lifts my style and becomes very bright and therefore extremely difficult to read. I also tried setting it android:backgroundto a dark color. This fixed the problem in the search dialog, but caused the whole text image, etc., to get a dark background, not transparent.

I want to either set the color or background only in the search dialog. How to do it?

+3
source share
1 answer

As Mark Philip noted, a solution can be found in this question: Android Styling / Theming Only Search Dialog

Basically, it should be written like this

<style name="master" paret="@android:style/Theme.NoTitleBar">
    <item name="android:textColorPrimary">#EEEEEE</item>
    <item name="android:textColorSecondary">#EEEEEE</item>
    <item name="android:textColorTertiary">#EEEEEE</item>
</style>

The main reason was that I wrote a style android:textColorthat should never be stylized.

+2
source

All Articles