15

I've used Google Place API and integrated Place Autocomplete Fragment. Can i change its Foreground or background color. It seems bit dull in my device.

enter image description here

And I also want to know that can I set "powered by Google" sentence to at the bottom part of the screen. I have seen some application which have it on bottom.

Kuls
  • 2,047
  • 21
  • 39
  • See my answer on https://stackoverflow.com/questions/35618457/how-do-you-change-the-styling-of-a-fragment-google-place-autocomplete/40706129#40706129 – saschpe Nov 20 '16 at 16:00
  • You can take a look at [Anoop answer](https://stackoverflow.com/a/41692260/6239277) – Rafiz Guliyev Jan 22 '20 at 17:22

2 Answers2

3

You just use this code in java.

placeAutoComplete.getView().setBackgroundColor(Color.WHITE);

You free to change the color of the background Place Autocomplete Fragment, in the example I use color WHITE for the background.

R Rifa Fauzi Komara
  • 1,915
  • 6
  • 27
  • 54
  • Thank you, that works! val placeAutoComplete = supportFragmentManager.findFragmentById(R.id.autocomplete_fragment) as AutocompleteSupportFragment – Liker777 Apr 10 '22 at 16:15
1

If you place that fragment in another layout you are able to modify as you want. Make nested such: <...CardView...> <..Your Fragment...>

The logo issue, since you decided to use all autonomous API instead of creating your own layout and integrating, it comes up by default which will stay stable there. Implement your view and use the Places API data, then you be able to make some modifications as changing place. BUT you HAVE TO display the logo in that case of-course.

Check this link also explains attributions of Places API: https://developers.google.com/places/android-api/attributions

Vurgun M
  • 97
  • 1
  • 5