<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<TextView
android:id="@+id/toolbar_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="?android:attr/actionBarSize"
android:fontFamily="@font/inter_semi_bold"
android:textColor="@color/layout_main_text_color"
android:textSize="@dimen/_20ssp"
tools:text="Toolbar" />
<TextView
android:id="@+id/total_job_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/toolbar_text_view"
android:background="@drawable/rectangle_blue_gradient_with_thirty_radius"
android:paddingLeft="@dimen/_7sdp"
android:paddingTop="@dimen/_1sdp"
android:paddingRight="@dimen/_7sdp"
android:paddingBottom="@dimen/_1sdp"
android:text="1425"
android:textColor="@color/white"
android:textSize="@dimen/_7ssp" />
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
In this project, I use Navigation Component. I want to show the number in blue border beside the "Job Board". I took a look at this solution.
Toolbar title not in center when Back Button is enable
.That solution abled to solve the problem of centering the toolbar text to center but not the Number.
I want this type of output