Change Searchview focus color - android

I want to change the searchview color on selection/focus.
I am using ActionBarSherlock with default theme. I tried changing theme but didn't have any luck there.
Here's an image in which searchview focus color is yellow:
How can I change it to transparent?

Simplest way here is to write a selector for it and place your search image in it.

Related

How to change color of searchView's search icon color programatically inside edittext?

I have SearchView in my toolbar
and I am wondering how can I change search icon inside SearchView Edittext drawableleft icon color programatically?
searchView = menu.findItem(R.id.action_search)?.actionView as? SearchView
I know using findViewById of SearchView I can find components of SearchView and do it
But it doesn't work and I would like to know if it possible to change edittext underline color programatically?
Here is my image you can see what I mean and I have changed the close button color I want to have the same for other components
link
val searchText = searchView?.findViewById(R.id.search_src_text) as SearchView.SearchAutoComplete
searchText.compoundDrawables[0].setTint(Color.RED)
It should work
val searchIcon = searchView.findViewById(R.id.search_mag_icon) as ImageView
searchIcon.setColorFilter(Color.Red)
I make some researches and find info that HintIcon is private field and you can't change in programmatically. I'm not sure about that but only one way that I found yet was about changing XML attribute.
app:searchHintIcon="#drawable/ic_search"
After that, the whole icon was changed so you could just create a simple search vector with a colour that is needed.
Probably there are other ways to change it but right now I'm not really sure.

How to align magnifier icon in SearchView precisely?

I want to customize the default Android SearchView to make it look like this:
I could use reflection for accessing to propeties of SearchView and use ImageSpan to add the magnifier icon before "Search" (the hint text) then set it as hint text for SearchView's EditText.
But I also need the magnifier to be align in the SearchView with exact pixel values as illustrated in the image above. I haven't figure out any way to achieve this yet.
How can I implement it?

how can I customize and change the background color of spinner in android?

I want to change the background color of spinner and customize spinner. When I used this code in xml android:background="#000000" the color changed but the arrow on the spinner disappears. How can I cuztomize spinner and change the background color without disappearing the arrow?
The arrow is black (or close to it) by default, so it won't show up on a black background. You can change the arrow with the android:dropDownSelector attribute in your XML.
The "background" attribute on a spinner refers to a drawable which contains the background color and the arrow. By specifying a color for the background, there is no longer any arrow. To fix this you need to provide a new 9 patch drawable with the arrow in it.

Customize UP arrow ActionBarSherlock

I use ActionBarSherlock. In one of my Activities I have SearchView. When it expands i change background of ABS from gree to white. So I need to change Up arrow too. Well, the question is: how can i change its color or set ImageResource on it from code?

How to change spinner's dialog style ?

How to change spinner's dialog style ? I need to change background color from white.
Did you read the Android docs? If you go to http://developer.android.com/reference/android/widget/Spinner.html and do a CTRL+F search for color you should find what you are looking for

Categories

Resources