<?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.yidian.shenghuoquan.bsetting.ui.setting.FeedbackViewModel" />
    </data>

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

        <com.yidian.bcommon.widget.CommonTopBarView
            android:id="@+id/bv_top_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:CommonTopBarView_title_text="@string/user_feedback"
            app:layout_constraintTop_toTopOf="parent" />

        <EditText
            android:id="@+id/et_input"
            android:layout_width="match_parent"
            android:layout_height="@dimen/dp200"
            android:layout_marginStart="@dimen/dp20"
            android:layout_marginTop="@dimen/dp20"
            android:layout_marginEnd="@dimen/dp20"
            android:background="@drawable/shape_bg_input_boarder"
            android:gravity="top"
            android:hint="@string/describe_your_feedback"
            android:padding="@dimen/dp10"
            android:text="@={vm.feedbackContent}"
            android:textColor="@color/color_333333"
            android:textCursorDrawable="@drawable/shape_bg_input_cursor"
            android:textSize="@dimen/sp14"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/bv_top_bar" />

        <TextView
            android:id="@+id/tv_word_count"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/dp10"
            android:text='@{String.valueOf(vm.feedbackWordCount) + "/100"}'
            android:textColor="@color/color_999999"
            android:textSize="@dimen/sp12"
            app:layout_constraintBottom_toBottomOf="@id/et_input"
            app:layout_constraintEnd_toEndOf="@id/et_input" />

        <TextView
            android:id="@+id/tv_commit_feedback"
            android:layout_width="@dimen/dp315"
            android:layout_height="@dimen/dp44"
            android:layout_marginTop="@dimen/dp20"
            android:background="@drawable/shape_bg_common_btn"
            android:gravity="center"
            android:onClick="@{() -> vm.requestCommitFeedback()}"
            android:text="@string/commit_feedback"
            android:textColor="@color/white"
            android:textSize="@dimen/sp18"
            android:textStyle="bold"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/et_input" />

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