• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Custom Appbar xml help!!!

S12

Newbie
I'm New to Android and want to customize the appBar in an app I'm making. This is what I want my appbar to look like http://prntscr.com/bis734. How do i add a layout as a menu item in the appBar.

Code:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/action_favorite"
        android:icon="@null"
        android:title="@string/action_tries"
        app:showAsAction="ifRoom"/>
</menu>

Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/Roundedbackground">
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textSize="38sp"
        android:text="5"
        android:id="@+id/textView3"
        android:layout_marginLeft="26dp"
        android:layout_marginStart="26dp"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@+id/imageView"
        android:layout_toEndOf="@+id/imageView" />
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/shoeSmaller"
        android:id="@+id/imageView"
        android:layout_centerVertical="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_marginLeft="36dp"
        android:layout_marginStart="36dp" />
</RelativeLayout>
 
Back
Top Bottom