Android place picker style actionbar

1.1k Views Asked by At

Im trying to use Place Picker library in my application but seems I'm having trouble with the style of the Place Picker screen. Can someone tell me how can I style this screen and is it stylable at all? Here is what I'm getting on my device:

enter image description here

and here is my AppTheme that I use:

<!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. TODO -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorPrimaryDark</item>


        <!--style for switchCompat-->
        <item name="colorControlActivated">@color/white</item>
        <item name="colorSwitchThumbNormal">@color/white</item>
        <item name="android:colorForeground">@color/white</item>

        <!--<item name="actionBarStyle">@style/Widget.AppTheme.ActionBar</item>-->
        <item name="buttonStyle">@style/My.Button</item>
    </style>

EDIT: This is only happening on my Note 2 device with android 4.4, does anyone knows a fix for this?

2

There are 2 best solutions below

0
On BEST ANSWER

for android versions below 5.0 use PlaceAutocomplete.MODE_OVERLAY

 private void launchLocationAutoComplete() {
        try {
            Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY).build(this);
            startActivityForResult(intent, PLACE_AUTOCOMPLETE_REQUEST_CODE);
        } catch (GooglePlayServicesRepairableException e) {
            Log.e(TAG, "GooglePlayServicesRepairableException", e);
        } catch (GooglePlayServicesNotAvailableException e) {
            Log.e(TAG, "GooglePlayServicesNotAvailableException", e);
        }
    }
1
On
    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:minHeight="?attr/actionBarSize"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

use like this style and background because you use noaction bar for your activity. check up color primary and use darkness color more than white. style code which one you use in toolbar it could be like this code:

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />