<?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>

        <import type="android.view.View" />

        <variable
            name="handler"
            type="com.doverfuelingsolutions.issp.view.fragment.FragmentPayResult" />

        <variable
            name="viewModel"
            type="com.doverfuelingsolutions.issp.view.fragment.FragmentPayResult.PayResultViewModel" />
    </data>

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

        <com.doverfuelingsolutions.issp.view.widget.FragmentToolbar
            android:id="@+id/fragmentToolbar"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:backVisible="false"
            app:countdownTime="60"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:title="@string/pay_success" />

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:gravity="center_horizontal"
            android:orientation="vertical"
            android:paddingTop="100dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/fragmentToolbar">

            <ImageView
                android:layout_width="340dp"
                android:layout_height="300dp"
                android:contentDescription="@string/success"
                android:scaleType="center"
                android:src="@mipmap/ic_pay_success" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="80dp"
                android:text="@string/pay_result_success_tip_2"
                android:textColor="@color/colorYellow"
                android:textSize="58sp" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="40dp"
                android:layout_marginBottom="30dp"
                android:text="@{@string/pay_result_success_tip_1(viewModel.physicalNozzleId, viewModel.amount.toString()), default=@string/pay_result_success_tip_1}"
                android:textSize="48sp" />

            <!--<TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/pay_order_is"
                android:textSize="36sp" />-->


            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="80dp"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <Button
                    android:id="@+id/buttonRePrint"
                    style="@style/Widget.MaterialComponents.Button"
                    android:layout_width="wrap_content"
                    android:layout_height="84dp"
                    android:layout_marginEnd="50dp"
                    android:onClick="@{handler.onClick}"
                    android:paddingHorizontal="50dp"
                    android:text="@string/reprint"
                    android:textSize="32sp"
                    android:visibility="@{viewModel.isReprint ? View.VISIBLE : View.GONE}" />

                <Button
                    android:id="@+id/buttonFinish"
                    style="@style/Widget.MaterialComponents.Button"
                    android:layout_width="wrap_content"
                    android:layout_height="84dp"
                    android:onClick="@{handler.onClick}"
                    android:paddingHorizontal="80dp"
                    android:text="@string/finish"
                    android:textSize="32sp" />
            </LinearLayout>
        </LinearLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>