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

    <data>

        <variable
            name="vm"
            type="com.ypsx.yppos.viewmodel.state.SettingsViewModel" />

        <variable
            name="click"
            type="com.ypsx.yppos.ui.popup.SettingsPopupWindow.ProxyClick" />
    </data>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"

        >

        <ImageView
            android:id="@+id/iv_triangle_up"
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:layout_alignParentRight="true"
            android:layout_marginEnd="10dp"
            android:src="@drawable/triangle_up" />

        <androidx.appcompat.widget.LinearLayoutCompat
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/iv_triangle_up"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/bg_popup_settings_top"
                android:orientation="vertical"
                android:paddingStart="15dp"
                android:paddingTop="20dp"
                android:paddingEnd="15dp"
                android:paddingBottom="10dp">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@{vm.storeName}"
                    android:textColor="@color/white"
                    android:textSize="18sp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    android:text="@{vm.userName}"
                    android:textColor="@color/white"
                    android:textSize="15sp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    android:text="@{vm.posCode}"
                    android:textColor="@color/white"
                    android:textSize="15sp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    android:text="@{vm.version}"
                    android:textColor="@color/white"
                    android:textSize="15sp" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/white"
                android:gravity="center_vertical"
                android:onClick="@{()->click.print()}"
                android:orientation="horizontal"
                android:padding="15dp">

                <androidx.appcompat.widget.AppCompatImageView
                    android:layout_width="20dp"
                    android:layout_height="20dp"
                    android:scaleType="centerInside"
                    app:srcCompat="@drawable/ic_print_receipt" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="10dp"
                    android:text="@string/print_receipt"
                    android:textColor="@color/black_333"
                    android:textSize="18sp" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/white"
                android:gravity="center_vertical"
                android:onClick="@{()->click.syncProducts()}"
                android:orientation="horizontal"
                android:padding="15dp">

                <androidx.appcompat.widget.AppCompatImageView
                    android:layout_width="20dp"
                    android:layout_height="20dp"
                    android:scaleType="centerInside"
                    app:srcCompat="@drawable/ic_synchronize_products" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="10dp"
                    android:text="@string/synchronize_products"
                    android:textColor="@color/black_333"
                    android:textSize="18sp" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/bg_popup_settings_bottom"
                android:gravity="center_vertical"
                android:onClick="@{()->click.logout()}"
                android:orientation="horizontal"
                android:padding="15dp">

                <androidx.appcompat.widget.AppCompatImageView
                    android:layout_width="20dp"
                    android:layout_height="20dp"
                    android:scaleType="centerInside"
                    app:srcCompat="@drawable/ic_user_logout" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="10dp"
                    android:text="@string/user_logout"
                    android:textColor="@color/black_333"
                    android:textSize="18sp" />

            </LinearLayout>

        </androidx.appcompat.widget.LinearLayoutCompat>


    </RelativeLayout>
</layout>