I am trying to customize the AutoCompleteTextView with Google place search but facing following issues with the UI. Refer the sample screenshots below:
The drop down list overlaps with some part of the text view. I want it to start at bottom edge of the text view. Here is the layout I'm using for the AutoCompleteTextView:
<AutoCompleteTextView android:id="@+id/searchPlace" android:layout_width="fill_parent" android:layout_height="wrap_content" android:imeOptions="actionNext" android:gravity="start" android:layout_marginTop="10dp" android:singleLine="true" android:maxLines="1" android:textColor="@color/black" android:inputType="textFilter|textNoSuggestions|textVisiblePassword" android:background="@android:color/white" />
When the result text is longer than the width of the AutoCompleteTextView, I want to make the result list item multi-line so that entire text can be visible. I tried with custom layout for the text view but its not working. Here is the layout of the list item:
<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/autoCompleteItem" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="?android:attr/listPreferredItemHeightSmall" android:textSize="@dimen/font_18" android:singleLine="false" android:padding="5dp" android:background="@color/white" android:textColor="@color/black" />
Once I select the text from the suggestions and the text is longer than AutoCompleteTextView width, the text is justified at the end of the text. I would like it to be at the start of the view. i.e. It should display the starting text and ellipsize the ending text. (Layout as in question#1 above).
This is the adapter I'm using if that matters:
PlaceAutoCompleteAdapter mAdapter = new PlaceAutoCompleteAdapter(mContext, R.layout.custom_item, mGoogleApiClient, placeSearchBounds, null);