<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:fresco="http://schemas.android.com/tools"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/comment_item"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/ui_surface"
    android:paddingLeft="16dp"
    android:paddingBottom="14dp">


    <RelativeLayout
        android:id="@+id/user_icon_container"
        android:layout_width="35dp"
        android:layout_height="35dp"
        android:layout_marginTop="16dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.facebook.drawee.view.SimpleDraweeView
            android:id="@+id/user_icon"
            style="@style/frescoCircleStyle"
            android:layout_width="32dp"
            android:layout_height="32dp"
            app:roundAsCircle="true"
            app:roundingBorderColor="@color/ui_divider"
            app:roundingBorderWidth="1dp" />

        <com.facebook.drawee.view.SimpleDraweeView
            android:id="@+id/user_badge"
            android:layout_width="11dp"
            android:layout_height="11dp"
            android:layout_alignParentRight="true"
            android:layout_alignParentBottom="true" />

    </RelativeLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/user_name_container"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="12dp"
        android:gravity="left"
        android:orientation="horizontal"
        app:layout_constraintBottom_toTopOf="@+id/rating_start"
        app:layout_constraintLeft_toRightOf="@+id/user_icon_container"
        app:layout_constraintRight_toLeftOf="@+id/more"
        app:layout_constraintTop_toTopOf="@+id/user_icon_container">

        <TextView
            android:id="@+id/user_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:ellipsize="end"
            android:maxLength="12"
            android:maxLines="1"
            android:textColor="@color/text_primary"
            android:textSize="13sp"
            android:textStyle="bold"
            app:layout_constrainedWidth="true"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintHorizontal_bias="0"
            app:layout_constraintHorizontal_chainStyle="packed"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toLeftOf="@+id/sdv_user_badge"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="用户名" />

        <com.facebook.drawee.view.SimpleDraweeView
            android:id="@+id/sdv_user_badge"
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="2dp"
            android:visibility="gone"
            app:layout_constrainedWidth="true"
            app:layout_constraintBottom_toBottomOf="@id/user_name"
            app:layout_constraintLeft_toRightOf="@id/user_name"
            app:layout_constraintRight_toLeftOf="@+id/tv_badge_name"
            app:layout_constraintTop_toTopOf="@id/user_name"
            tools:visibility="visible" />

        <TextView
            android:id="@+id/tv_badge_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/sdv_user_badge"
            android:gravity="center"
            android:textColor="@color/text_tertiary"
            android:textSize="10sp"
            android:visibility="gone"
            app:layout_constrainedWidth="true"
            app:layout_constraintBottom_toBottomOf="@id/sdv_user_badge"
            app:layout_constraintLeft_toRightOf="@id/sdv_user_badge"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="@id/sdv_user_badge"
            tools:text="答题先锋" />
    </androidx.constraintlayout.widget.ConstraintLayout>

    <com.gh.gamecenter.common.view.materialratingbar.MaterialRatingBar
        android:id="@+id/rating_start"
        style="@style/Widget.MaterialRatingBar.RatingBar"
        android:layout_width="wrap_content"
        android:layout_height="10dp"
        android:layout_marginLeft="8dp"
        android:layout_marginTop="6dp"
        android:layout_marginBottom="2dp"
        android:isIndicator="true"
        android:minWidth="14dp"
        android:minHeight="14dp"
        android:numStars="5"
        app:layout_constraintBottom_toBottomOf="@+id/user_icon_container"
        app:layout_constraintLeft_toRightOf="@+id/user_icon_container"
        app:layout_constraintTop_toBottomOf="@+id/user_name_container"
        app:mrb_progressTint="@color/primary_theme" />


    <TextView
        android:id="@+id/time"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="8dp"
        android:gravity="center"
        android:textColor="@color/text_tertiary"
        android:textSize="@dimen/tag_text_size"
        app:layout_constraintBottom_toBottomOf="@+id/rating_start"
        app:layout_constraintLeft_toRightOf="@id/rating_start"
        app:layout_constraintTop_toTopOf="@+id/rating_start" />

    <TextView
        android:id="@+id/ipRegionTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@color/text_tertiary"
        android:textSize="@dimen/tag_text_size"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@+id/time"
        app:layout_constraintStart_toEndOf="@+id/time"
        app:layout_constraintTop_toTopOf="@+id/time"
        tools:text=" · 广东"
        tools:visibility="visible" />

    <ImageView
        android:id="@+id/more"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="20dp"
        android:paddingTop="12dp"
        android:paddingRight="20dp"
        android:paddingBottom="12dp"
        app:srcCompat="@drawable/game_comment_more"
        app:layout_constraintBottom_toBottomOf="@+id/user_icon_container"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="@+id/user_icon_container" />

    <com.gh.gamecenter.common.view.ExpandTextView
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="13dp"
        android:layout_marginRight="16dp"
        android:includeFontPadding="false"
        android:lineSpacingExtra="4dp"
        android:maxLines="4"
        android:textColor="@color/text_secondary"
        android:textSize="13sp"
        app:endText="...   "
        app:expandText="全部"
        app:layout_constraintTop_toBottomOf="@+id/user_icon_container"
        app:useGradientAlphaEndText="true"
        tools:text="每个评论的正文，最多显示4行，超过则使用省略号…全部，点击[全部]即可展开余下全文" />

</androidx.constraintlayout.widget.ConstraintLayout>
