0

I am trying to customize the AutoCompleteTextView with Google place search but facing following issues with the UI. Refer the sample screenshots below: enter image description here

  1. 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" />
    
  2. 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"
            />
    
  3. 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). enter image description here

This is the adapter I'm using if that matters:

PlaceAutoCompleteAdapter mAdapter = new PlaceAutoCompleteAdapter(mContext, R.layout.custom_item, mGoogleApiClient, placeSearchBounds, null);
user846316
  • 6,037
  • 6
  • 31
  • 40
  • this question is already well explained [here](http://stackoverflow.com/questions/6107500/how-to-wrap-lengthy-text-in-a-spinner) – Bali Nov 22 '16 at 08:34
  • They are not same. This is about AutoCompleteTextView not EditText or TextView in general. – user846316 Nov 22 '16 at 08:47

0 Answers0