I am trying to stretch the EditText (on ActionBar) to "almost" entire screen's width.It should first leave space for a button to the right then the rest is EditText's pace. I can put about 300dp which could make it seem nice on my phone but it's not a preferable solution.
My code: action_menu
<item
android:id="@+id/action_settings"
android:actionLayout="@layout/action_item_edit_text"
android:showAsAction="always"
android:title="Search"/>
<item
android:id="@+id/add"
android:icon="@drawable/add"
android:showAsAction="always"
android:title="Add"/>
<!-- Settings, should always be in the overflow -->
action_item_edit_text
<EditText xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/editInput"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:hint="Write something"
android:padding="6dp"
android:singleLine="true"
android:textColor="@android:color/black"
android:textColorHint="#BBBBBB"
android:textSize="14sp" />