<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:binding="http://schemas.android.com/apk/res-auto">

    <data>

        <variable
            name="backBarVM"
            type="com.phlx.anchorcollect.ui.base.BackBarVM" />
    </data>

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/dp_46"
        android:background="@color/toolBar_bg"
        binding:contentInsetStart="0dp">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <ImageView
                android:id="@+id/iv_more"
                android:layout_width="@dimen/dp_20"
                android:layout_height="@dimen/dp_20"
                android:background="?selectableItemBackground"
                android:src="@mipmap/ic_back"
                android:visibility="@{backBarVM.backIconVisibleObservable}"
                binding:layout_constraintBottom_toBottomOf="parent"
                binding:layout_constraintLeft_toLeftOf="parent"
                binding:layout_constraintTop_toTopOf="parent"
                binding:onClickCommand="@{backBarVM.backOnClick}" />

            <TextView
                android:id="@+id/tv_title"
                style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@{backBarVM.backTitle}"
                android:textColor="@color/white"
                binding:layout_constraintBottom_toBottomOf="parent"
                binding:layout_constraintEnd_toEndOf="parent"
                binding:layout_constraintStart_toStartOf="parent"
                binding:layout_constraintTop_toTopOf="parent" />


            <ImageView
                android:id="@+id/iv_setting_icon"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:background="?selectableItemBackground"
                android:gravity="center"
                android:padding="12dp"
                android:src="@mipmap/ic_set"
                android:visibility="@{backBarVM.settingVisibleObservable}"
                binding:layout_constraintBottom_toBottomOf="parent"
                binding:layout_constraintRight_toRightOf="parent"
                binding:layout_constraintTop_toTopOf="parent"
                binding:onClickCommand="@{backBarVM.settingOnClick}" />

            <ImageView
                android:id="@+id/iv_search_icon"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_alignParentEnd="true"
                android:layout_centerVertical="true"
                android:background="?selectableItemBackground"
                android:gravity="center"
                android:padding="12dp"
                android:src="@mipmap/ic_search"
                android:visibility="@{backBarVM.searchVisibleObservable}"
                binding:layout_constraintBottom_toBottomOf="parent"
                binding:layout_constraintRight_toLeftOf="@+id/iv_setting_icon"
                binding:layout_constraintTop_toTopOf="parent"
                binding:onClickCommand="@{backBarVM.searchOnClick}" />

        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.appcompat.widget.Toolbar>
</layout>

