For now it is white and I need to put it in black color, I found several tutorials, but I did not find one that works, how do I do this?
Code:
searchViewPesquisa = (SearchView) findViewById(R.id.searchViewPesquisa);
EditText searchEditText = (EditText) searchViewPesquisa.findViewById(android.support.v7.appcompat.R.id.search_src_text);
searchEditText.setTextColor(getResources().getColor(R.color.textColorThird));
searchEditText.setHintTextColor(getResources().getColor(R.color.textColorThird));
searchViewPesquisa.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
searchViewPesquisa.setIconified(false);
}
});
xml:
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
app:cardBackgroundColor="@color/colorBackgroud">
<android.support.v7.widget.SearchView
android:id="@+id/searchViewPesquisa"
style="@style/SearchViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.v7.widget.CardView>
style:
<style name="SearchViewStyle" parent="Widget.AppCompat.SearchView">
<item name="searchHintIcon">@drawable/ic_search_black_24dp</item>
<item name="closeIcon">@drawable/ic_close</item>
<item name="searchIcon">@drawable/ic_search_black_24dp</item>
</style>