I am trying to center my ToolBar title:
<android.support.design.widget.AppBarLayout
android:id="@+id/top_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:theme="@style/ThemeToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="LOGO"
android:textColor="@color/colorAccent"
android:textSize="32sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
ToolBar aligns it's title left by default. To align the title center I have added a TextView inside the tool bar. But it doesn't center exactly. I have try to give negative margin from left but it didn't work.