0

I'd like to change the layout and color of the suggestion box I get in my Google Maps-API based app in Android Studio. I have no idea whether I should look into the code of Google Maps or somewhere else.

the link contains an image with the suggestbox I'm talking about

This is the code of the TextView:

        <AutoCompleteTextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="50dp"
        android:layout_toRightOf="@+id/ic_magnify"
        android:textSize="15sp"
        android:textColor="#ecf0f1"
        android:id="@+id/input_search"
        android:background="@null"
        android:imeOptions="actionSearch"
        android:inputType="text"
        />

And I use the PlaceAutocompleteAdapter to autosuggest the possible locations.

Simon Kuhn
  • 13
  • 5
  • That depends on how you implemented it. Please show us some codes. You can start by that `SearchView`. Then we'll be able to help you better. Also, this might help: https://stackoverflow.com/questions/27240200/changing-the-background-color-of-searchview-autocomplete-dropdown – ʍѳђઽ૯ท Aug 09 '18 at 19:48
  • @Mohsen I edited the question. I'm sorry I didn't know where to look so I could add any code. Hope you can do something more with this! – Simon Kuhn Aug 09 '18 at 20:00
  • It's alright, you set the background `@null`. Could you change the color of this to for ex. : `#FFFFFF` and see what happens? This should make the background white. – ʍѳђઽ૯ท Aug 09 '18 at 20:11
  • @Mohsen No this doesn't seem to work. This background color refers to the background color of the textfield. Therefore this one is .@null. Any other suggestions? – Simon Kuhn Aug 09 '18 at 21:45
  • 1
    I do not have a SearchView. I achieved the searching option with android:imeOptions="actionSearch". Also, I don't see how the link you provided could help me :( – Simon Kuhn Aug 10 '18 at 09:27

1 Answers1

0

Fixed the problem by styling the dropdown popup. I added android:popupBackground="#2d3e50" to the AutoCompleteTextView-style which changed the color to the one I needed.

Simon Kuhn
  • 13
  • 5