1

I've been dealing with this for quite a reasonable amount of time, but no success. So any hing, clue ... any idea how to solve this is appreciated.

My issue: I have a search box in my app bar. I used this Link

I want my search view look like the one in Gmail: enter image description here

But mine looks like this: (the search view appears on the bottom, NOT in between the hamburger icon and options menu). enter image description here

Any type of layout I check for the root in delay_auto_complete_text_view and any dimensions I set, the search box does not come to the top. How do I resolve this?

I also have tried the appcompat search view, but can't use that either because of some other issues. (like suggestions in older versions of android, etc.)

here is "app_bar.xml":

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout
    xmlns:android = "http://schemas.android.com/apk/res/android"
    xmlns:app = "http://schemas.android.com/apk/res-auto"
    android:layout_width = "match_parent"
    android:layout_height = "wrap_content"
    >

    <android.support.v7.widget.Toolbar
        android:layoutDirection = "rtl"
        android:id = "@+id/toolbar"
        android:layout_width = "match_parent"
        android:layout_height = "fill_parent"
        android:minHeight = "?attr/actionBarSize"
        android:background = "?attr/colorPrimary"
        app:contentInsetStart = "0dp"
        app:contentInsetEnd = "0dp"
        android:theme = "@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme = "@style/ThemeOverlay.AppCompat.Light"
        />

    <include
        android:id = "@+id/app_bar"
        layout = "@layout/delay_auto_complete_text_view"
        >
    </include>

</android.support.design.widget.AppBarLayout>

and my delay_auto_complete_text_view.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android"
              style = "@style/StyleForHorizontalLinearLayout"
              android:id = "@+id/linear_layout_delay_auto_complete_text_view"
          android:layout_width = "match_parent"
          android:layout_height = "wrap_content"
    >

<LinearLayout
        android:layoutDirection = "rtl"
        android:orientation = "vertical"
        android:id = "@+id/container"
        android:layout_width = "match_parent"
        android:layout_height = "match_parent"
        >

    <com.jahanjooy.khoonat.View.DelayAutoCompleteTextView
            android:id = "@+id/et_book_title"
            android:textColor = "@android:color/white"
            android:inputType = "textCapSentences"
            android:layout_width = "match_parent"
            android:layout_height = "wrap_content"
            android:paddingRight = "20dp"
            android:imeOptions = "flagNoExtractUi|actionSearch"
            />
    <ProgressBar
            android:indeterminate = "true"
            android:indeterminateTintMode = "src_atop"
            android:indeterminateTint = "@android:color/white"

            android:id = "@+id/pb_loading_indicator"
            style = "?android:attr/progressBarStyleSmall"
            android:layout_width = "wrap_content"
            android:layout_height = "wrap_content"
            android:layout_gravity = "center_vertical|left"
            android:layout_marginRight = "30dp"
            android:visibility = "gone"
        />
    </LinearLayout>
</LinearLayout>

EDIT: enter image description here

Floern
  • 33,559
  • 24
  • 104
  • 119
Fatima
  • 869
  • 10
  • 35

0 Answers0