MaterialSearchView
MaterialSearchView copied to clipboard
Remove left space within toolbar
Why do i getting this left space within my toolbar? I want to cover the whole width of the parent toolbar space.
This is my code:
<android.support.v7.widget.Toolbar android:id="@+id/toolbar_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/toolbar_background"
app:titleTextColor="@color/toolbar_text_color"
android:elevation="0dp"
android:theme="@style/ToolbarTheme"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<com.miguelcatalan.materialsearchview.MaterialSearchView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.v7.widget.Toolbar>
Well, looks like i've resolve it adding and letting my xml like this:
<android.support.v7.widget.Toolbar android:id="@+id/toolbar_activity"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/toolbar_background"
app:titleTextColor="@color/toolbar_text_color"
android:elevation="0dp"
android:theme="@style/ToolbarTheme"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:contentInsetLeft="0dp"
android:contentInsetStart="0dp"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
android:contentInsetRight="0dp"
android:contentInsetEnd="0dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp"
>
<com.miguelcatalan.materialsearchview.MaterialSearchView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.v7.widget.Toolbar>
Well, looks like i've resolve it adding and letting my xml like this:
<android.support.v7.widget.Toolbar android:id="@+id/toolbar_activity" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/toolbar_background" app:titleTextColor="@color/toolbar_text_color" android:elevation="0dp" android:theme="@style/ToolbarTheme" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:contentInsetLeft="0dp" android:contentInsetStart="0dp" app:contentInsetLeft="0dp" app:contentInsetStart="0dp" android:contentInsetRight="0dp" android:contentInsetEnd="0dp" app:contentInsetRight="0dp" app:contentInsetEnd="0dp" > <com.miguelcatalan.materialsearchview.MaterialSearchView android:id="@+id/search_view" android:layout_width="match_parent" android:layout_height="wrap_content" /> </android.support.v7.widget.Toolbar>
Maybe to become optional, but from my understanding, this comes from Material Design standards. You could raise a pull request with the optional feature.