Two titles, one button on the right
Activity_main.xml:
<Android.support.v7.widget.Toolbarstyle= "Style/toolbarstyle"Android:id= "@+id/my_toolbar"xmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Wrap_content"android:gravity= "Center"Android:background= "? Attr/colorprimary"Android:minheight= "? Attr/actionbarsize"App:theme= "@style/themeoverlay.appcompat.dark.actionbar"App:popuptheme= "@style/themeoverlay.appcompat.light"> <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "(+)"android:layout_gravity= "Left"style= "@style/textappearance.appcompat.widget.actionbar.title"android:textsize= "18SP"Android:id= "@+id/toolbar_title2" /> <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "Business Unit discussion Group"android:layout_gravity= "Center"style= "@style/textappearance.appcompat.widget.actionbar.title"Android:id= "@+id/toolbar_title" /> <ImageViewAndroid:id= "@+id/bluetoothstate"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"android:src= "@drawable/fm_detailitem_walk"android:contentdescription= "Content_description_bluetooth_status"android:padding= "8DP"Android:layout_marginright= "10DP"android:layout_gravity= "Right"/> </Android.support.v7.widget.Toolbar>
View Code
Styles.xml
<resources>
<!--Base Application theme. -
<style name= "Apptheme" parent= "Theme.AppCompat.Light.NoActionBar" >
<!--Customize your theme here. -
<item name= "Colorprimary" > @color/colorprimary</item>
<item name= "Colorprimarydark" > @color/colorprimarydark</item>
<item name= "Coloraccent" > @color/coloraccent</item>
<item name= "Toolbarstyle" > @style/widget.appcompat.toolbar</item>
</style>
</resources>
Android Toolbar Effect 4