<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/ui_background">

    <com.scwang.smartrefresh.layout.SmartRefreshLayout
        android:id="@+id/refresh_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <RelativeLayout
            android:id="@+id/answer_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <ScrollView
                android:id="@+id/scrollView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/ui_surface"
                android:visibility="visible">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingBottom="90dp">

                    <View
                        android:id="@+id/top_padding_view"
                        android:layout_width="match_parent"
                        android:layout_height="8dp"
                        android:background="@color/ui_background"
                        app:layout_constraintTop_toTopOf="parent" />

                    <RelativeLayout
                        android:id="@+id/answer_detail_title_rl"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:paddingBottom="10dp"
                        app:layout_constraintTop_toBottomOf="@id/top_padding_view">

                        <TextView
                            android:id="@+id/title_tv"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="20dp"
                            android:layout_marginTop="12dp"
                            android:layout_marginRight="20dp"
                            android:gravity="center_vertical"
                            android:lineSpacingExtra="6dp"
                            android:textColor="@color/black"
                            android:textSize="16sp"
                            android:textStyle="bold" />

                        <LinearLayout
                            android:id="@+id/question_container"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_below="@id/title_tv"
                            android:orientation="vertical">

                            <include
                                android:id="@+id/piece_question_content"
                                layout="@layout/piece_question_content" />

                        </LinearLayout>

                        <RelativeLayout
                            android:id="@+id/title_container"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_below="@id/question_container"
                            android:layout_marginLeft="20dp"
                            android:layout_marginTop="12dp">

                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center_vertical"
                                android:orientation="horizontal"
                                android:paddingLeft="9dp"
                                android:paddingTop="7dp"
                                android:paddingRight="9dp"
                                android:paddingBottom="7dp">

                                <TextView
                                    android:id="@+id/status_tv"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:drawablePadding="6dp"
                                    android:gravity="center"
                                    android:textColor="@color/text_theme"
                                    android:textSize="14sp"
                                    android:textStyle="bold" />

                            </LinearLayout>

                            <LinearLayout
                                android:id="@+id/answer_count_container"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentRight="true"
                                android:layout_centerVertical="true"
                                android:gravity="center_vertical"
                                android:paddingTop="2dp"
                                android:paddingRight="20dp"
                                android:paddingBottom="2dp">

                                <TextView
                                    android:id="@+id/answer_count_tv"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginRight="7dp"
                                    android:drawableRight="@drawable/answer_detail_more_answer_icon"
                                    android:drawablePadding="8dp"
                                    android:textColor="@color/text_secondary"
                                    android:textSize="13sp"
                                    tools:text="查看全部66个回答" />

                            </LinearLayout>
                        </RelativeLayout>
                    </RelativeLayout>

                    <View
                        android:id="@+id/question_divider_view"
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/cutting_line"
                        android:background="@color/cutting_line"
                        app:layout_constraintTop_toBottomOf="@id/answer_detail_title_rl" />

                    <com.gh.gamecenter.common.view.AvatarBorderView
                        android:id="@+id/user_icon_iv"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="10dp"
                        android:layout_marginTop="5dp"
                        app:avatar_width="40dp"
                        app:badge_width="10dp"
                        app:border_color="@color/transparent"
                        app:layout_constraintLeft_toLeftOf="parent"
                        app:layout_constraintTop_toBottomOf="@id/question_divider_view"
                        tools:layout_height="60dp"
                        tools:layout_width="60dp" />

                    <TextView
                        android:id="@+id/username_tv"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="16dp"
                        android:maxLength="12"
                        android:textColor="@color/text_primary"
                        android:textSize="14sp"
                        app:layout_constraintBottom_toTopOf="@+id/sdv_user_badge"
                        app:layout_constraintLeft_toRightOf="@id/user_icon_iv"
                        app:layout_constraintRight_toLeftOf="@+id/follow_tv"
                        app:layout_constraintTop_toTopOf="@+id/user_icon_iv"
                        tools:text="我的昵称很长很长有十二字" />

                    <com.facebook.drawee.view.SimpleDraweeView
                        android:id="@+id/sdv_user_badge"
                        android:layout_width="16dp"
                        android:layout_height="16dp"
                        android:layout_marginBottom="10dp"
                        android:visibility="gone"
                        app:layout_constraintBottom_toBottomOf="@id/user_icon_iv"
                        app:layout_constraintLeft_toRightOf="@id/user_icon_iv"
                        tools:visibility="visible" />

                    <TextView
                        android:id="@+id/tv_badge_name"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="4dp"
                        android:layout_marginRight="16dp"
                        android:gravity="center_vertical"
                        android:includeFontPadding="false"
                        android:textColor="@color/text_tertiary"
                        android:textSize="10sp"
                        app:layout_constraintBottom_toBottomOf="@id/sdv_user_badge"
                        app:layout_constraintLeft_toRightOf="@id/sdv_user_badge"
                        app:layout_constraintRight_toLeftOf="@+id/follow_tv"
                        app:layout_constraintTop_toTopOf="@id/sdv_user_badge"
                        tools:text="答题先锋"
                        tools:visibility="visible" />

                    <TextView
                        android:id="@+id/follow_hint_tv"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="5dp"
                        android:text="喜欢就关注吧→"
                        android:textColor="@color/text_theme"
                        android:textSize="12sp"
                        android:visibility="gone"
                        app:layout_constraintBottom_toBottomOf="@+id/follow_tv"
                        app:layout_constraintRight_toLeftOf="@+id/follow_tv"
                        app:layout_constraintTop_toTopOf="@+id/follow_tv"
                        tools:visibility="gone" />

                    <TextView
                        android:id="@+id/follow_tv"
                        android:layout_width="wrap_content"
                        android:layout_height="28dp"
                        android:layout_marginRight="20dp"
                        android:drawablePadding="4dp"
                        android:gravity="center"
                        android:paddingLeft="12dp"
                        android:paddingRight="12dp"
                        android:textColor="@color/text_theme"
                        android:textSize="12sp"
                        android:textStyle="bold"
                        android:visibility="gone"
                        app:layout_constraintBottom_toTopOf="@+id/rich_editor"
                        app:layout_constraintRight_toRightOf="parent"
                        app:layout_constraintTop_toBottomOf="@id/question_divider_view"
                        tools:text="关注"
                        tools:visibility="visible" />

                    <com.gh.common.view.RichEditor
                        android:id="@+id/rich_editor"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:focusable="false"
                        android:focusableInTouchMode="false"
                        app:layout_constraintLeft_toLeftOf="parent"
                        app:layout_constraintRight_toRightOf="parent"
                        app:layout_constraintTop_toBottomOf="@id/user_icon_iv" />

                    <TextView
                        android:id="@+id/time_tv"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="53dp"
                        android:layout_marginRight="20dp"
                        android:gravity="right"
                        android:textColor="@color/title"
                        android:textSize="12sp"
                        app:layout_constraintRight_toRightOf="parent"
                        app:layout_constraintTop_toBottomOf="@id/rich_editor"
                        tools:text="发布于1分钟前" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="20dp"
                        android:gravity="right"
                        android:paddingTop="6dp"
                        android:text="@string/copyright_footnote"
                        android:textColor="@color/title"
                        android:textSize="12sp"
                        app:layout_constraintRight_toRightOf="parent"
                        app:layout_constraintTop_toBottomOf="@id/time_tv" />

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

            <include
                android:id="@+id/bottom_controller"
                layout="@layout/piece_article_input_container" />

            <View
                android:id="@+id/bottom_shadow_view"
                android:layout_width="match_parent"
                android:layout_height="7dp"
                android:layout_above="@+id/bottom_controller"
                android:background="@drawable/shadow" />

            <View
                android:id="@+id/bottom_divider_view"
                android:layout_width="match_parent"
                android:layout_height="@dimen/cutting_line"
                android:layout_above="@+id/bottom_controller"
                android:background="@color/cutting_line" />

            <include
                android:id="@+id/reuse_no_connection"
                layout="@layout/reuse_no_connection" />

            <include
                android:id="@+id/reuse_none_data"
                layout="@layout/reuse_none_data" />

            <include
                android:id="@+id/reuse_data_exception"
                layout="@layout/reuse_data_exception" />

        </RelativeLayout>
    </com.scwang.smartrefresh.layout.SmartRefreshLayout>

    <View
        android:id="@+id/skeleton_mask"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</FrameLayout>