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

    <com.gh.gamecenter.common.view.AvatarBorderView
        android:id="@+id/user_icon"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        app:avatar_width="32dp"
        app:badge_width="11dp"
        app:border_color="@color/ui_background"
        app:border_width="1dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/user_name_container"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="8dp"
        android:orientation="horizontal"
        app:layout_constraintVertical_chainStyle="packed"
        app:layout_constraintBottom_toTopOf="@+id/timeContainer"
        app:layout_constraintStart_toEndOf="@+id/user_icon"
        app:layout_constraintEnd_toStartOf="@+id/more"
        app:layout_constraintTop_toTopOf="@+id/user_icon">

        <TextView
            android:id="@+id/user_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:ellipsize="end"
            android:maxLines="1"
            android:singleLine="true"
            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_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toStartOf="@+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_marginStart="4dp"
            android:layout_marginEnd="2dp"
            android:visibility="gone"
            app:layout_constrainedWidth="true"
            app:layout_constraintBottom_toBottomOf="@id/user_name"
            app:layout_constraintStart_toEndOf="@id/user_name"
            app:layout_constraintEnd_toStartOf="@+id/tv_badge_name"
            app:layout_constraintTop_toTopOf="@id/user_name" />

        <TextView
            android:id="@+id/tv_badge_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:includeFontPadding="false"
            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_constraintStart_toEndOf="@id/sdv_user_badge"
            app:layout_constraintEnd_toStartOf="@+id/badge"
            app:layout_constraintTop_toTopOf="@id/sdv_user_badge"
            tools:text="答题先锋" />

        <TextView
            android:id="@+id/badge"
            android:layout_width="wrap_content"
            android:layout_height="12dp"
            android:layout_centerVertical="true"
            android:layout_marginStart="8dp"
            android:background="@color/tag_orange"
            android:gravity="center"
            android:includeFontPadding="false"
            android:paddingLeft="4dp"
            android:paddingRight="4dp"
            android:text="精彩评论"
            android:textColor="@color/white"
            android:textSize="8sp"
            app:layout_constrainedWidth="true"
            app:layout_constraintBottom_toBottomOf="@id/tv_badge_name"
            app:layout_constraintLeft_toRightOf="@id/tv_badge_name"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="@id/tv_badge_name" />
    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/timeContainer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="4dp"
        app:layout_constraintBottom_toBottomOf="@+id/user_icon"
        app:layout_constraintStart_toEndOf="@+id/user_icon"
        app:layout_constraintTop_toBottomOf="@+id/user_name_container">

        <TextView
            android:id="@+id/authTv"
            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="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="认证名称"
            tools:visibility="visible" />

        <TextView
            android:id="@+id/time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:gravity="center"
            android:textColor="@color/text_tertiary"
            android:textSize="@dimen/tag_text_size"
            app:layout_constraintBottom_toBottomOf="@+id/authTv"
            app:layout_constraintStart_toEndOf="@+id/authTv"
            app:layout_constraintTop_toTopOf="@+id/authTv"
            app:layout_goneMarginStart="0dp"
            tools:text="2020-07-22" />

        <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" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <ImageView
        android:id="@+id/more"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="11dp"
        android:layout_marginEnd="6dp"
        app:srcCompat="@drawable/game_comment_more"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintRight_toRightOf="parent" />

    <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_marginStart="16dp"
        android:layout_marginTop="4dp"
        android:isIndicator="true"
        android:minWidth="14dp"
        android:minHeight="14dp"
        android:numStars="5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/user_icon"
        app:mrb_progressTint="@color/primary_theme" />

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

    <TextView
        android:id="@+id/device"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:drawablePadding="2dp"
        android:ellipsize="end"
        android:gravity="center"
        android:maxLines="1"
        android:paddingEnd="8dp"
        android:textColor="@color/text_tertiary"
        android:textSize="@dimen/tag_text_size"
        app:drawableStartCompat="@drawable/ic_phone"
        app:layout_constrainedWidth="true"
        app:layout_constraintBottom_toBottomOf="@+id/vote"
        app:layout_constraintEnd_toStartOf="@+id/version"
        app:layout_constraintHorizontal_bias="0"
        app:layout_constraintHorizontal_chainStyle="packed"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@+id/vote"
        tools:text="小米2S" />

    <TextView
        android:id="@+id/version"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="16dp"
        android:drawablePadding="2dp"
        android:ellipsize="end"
        android:gravity="center_vertical"
        android:lines="1"
        android:textColor="@color/text_tertiary"
        android:textSize="@dimen/tag_text_size"
        app:drawableStartCompat="@drawable/ic_version"
        app:layout_constrainedWidth="true"
        app:layout_constraintBottom_toBottomOf="@+id/vote"
        app:layout_constraintEnd_toStartOf="@+id/comment"
        app:layout_constraintStart_toEndOf="@id/device"
        app:layout_constraintTop_toTopOf="@+id/vote"
        app:layout_goneMarginStart="16dp"
        tools:text="版本号版本号版本号版本号版本号版本号版本号版本号" />

    <TextView
        android:id="@+id/comment"
        android:layout_width="wrap_content"
        android:layout_height="48dp"
        android:drawableLeft="@drawable/community_comment_count"
        android:drawablePadding="4dp"
        android:gravity="center_vertical"
        android:paddingLeft="8dp"
        android:paddingRight="8dp"
        android:textColor="@color/vote_selector"
        android:textSize="13sp"
        app:layout_constraintBottom_toBottomOf="@+id/vote"
        app:layout_constraintEnd_toStartOf="@+id/vote"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@+id/vote"
        tools:text="1" />

    <CheckedTextView
        android:id="@+id/vote"
        android:layout_width="wrap_content"
        android:layout_height="48dp"
        android:layout_marginEnd="16dp"
        android:drawableLeft="@drawable/comment_vote_selector"
        android:drawablePadding="4dp"
        android:gravity="center_vertical"
        android:paddingLeft="8dp"
        android:paddingRight="8dp"
        android:textColor="@color/vote_selector"
        android:textSize="13sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/content"
        tools:text="1" />

    <androidx.constraintlayout.widget.Group
        android:id="@+id/groupCl"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:constraint_referenced_ids="comment,vote" />

    <TextView
        android:id="@+id/audit"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="16dp"
        android:textColor="@color/secondary_red"
        android:textSize="12sp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/content" />

    <View
        android:id="@+id/line"
        android:layout_width="match_parent"
        android:layout_height="1px"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:background="@color/ui_divider"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/vote" />

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/reply_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="16dp"
        app:layout_constraintTop_toBottomOf="@id/line">

        <com.gh.gamecenter.common.view.EllipsizeTextView
            android:id="@+id/reply_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ellipsize="end"
            android:includeFontPadding="false"
            android:lineSpacingExtra="4dp"
            android:maxLines="2"
            android:textColor="@color/text_secondary"
            android:textSize="13sp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/content_badge"
            android:layout_width="30dp"
            android:layout_height="14dp"
            android:background="@drawable/button_normal_style"
            android:gravity="center"
            android:text="客服"
            android:textColor="@color/white"
            android:textSize="9sp"
            android:visibility="visible"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/reply_more"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:includeFontPadding="false"
            android:drawableEnd="@drawable/ic_comment_more_arrow"
            android:drawablePadding="4dp"
            android:text="查看更多回复"
            android:textColor="@color/text_theme"
            android:textSize="13sp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@id/reply_content" />

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

