微调社区评论列表UI
This commit is contained in:
@ -132,9 +132,7 @@ open class NewCommentViewModel(
|
||||
fun postComment(content: String, imageUrls: List<String>?, commentEntity: CommentEntity?) {
|
||||
val api = RetrofitManager.getInstance(getApplication()).api
|
||||
val requestMap = hashMapOf<String, Any>()
|
||||
if (content.isNotEmpty()) {
|
||||
requestMap["content"] = content
|
||||
}
|
||||
requestMap["content"] = content
|
||||
if (!imageUrls.isNullOrEmpty()) {
|
||||
requestMap["images"] = imageUrls
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
|
||||
<import type="com.gh.common.util.CommentUtils" />
|
||||
|
||||
<import type="android.text.TextUtils" />
|
||||
|
||||
<variable
|
||||
name="comment"
|
||||
type="com.gh.gamecenter.entity.CommentEntity" />
|
||||
@ -21,7 +23,7 @@
|
||||
android:id="@+id/userIconIv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="11dp"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:layout_marginTop="7dp"
|
||||
app:avatar_width="36dp"
|
||||
app:badge_width="12dp"
|
||||
@ -158,10 +160,11 @@
|
||||
|
||||
<com.gh.common.view.ExpandTextView
|
||||
android:id="@+id/contentTv"
|
||||
goneIf="@{TextUtils.isEmpty(comment.content)}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:includeFontPadding="false"
|
||||
android:lineSpacingExtra="6dp"
|
||||
android:maxLines="4"
|
||||
@ -189,16 +192,19 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@+id/contentTv"
|
||||
app:layout_constraintStart_toStartOf="@+id/contentTv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/collapseTv" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/userInfoContainer"
|
||||
app:layout_constraintTop_toBottomOf="@+id/collapseTv"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/subCommentContainer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:background="@color/text_f5f5f5"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="12dp"
|
||||
@ -206,8 +212,8 @@
|
||||
android:paddingRight="12dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/contentTv"
|
||||
app:layout_constraintStart_toStartOf="@id/contentTv"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/userInfoContainer"
|
||||
app:layout_constraintTop_toBottomOf="@id/commentPictureRv"
|
||||
tools:visibility="visible">
|
||||
|
||||
@ -256,7 +262,7 @@
|
||||
android:textColor="@color/text_999999"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/divider"
|
||||
app:layout_constraintStart_toStartOf="@id/contentTv"
|
||||
app:layout_constraintStart_toStartOf="@id/userInfoContainer"
|
||||
app:layout_constraintTop_toBottomOf="@id/subCommentContainer"
|
||||
tools:text="1F" />
|
||||
|
||||
@ -280,13 +286,14 @@
|
||||
android:id="@+id/likeCountTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:drawableLeft="@drawable/comment_vote_unselect"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/text_999999"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/floorHintTv"
|
||||
app:layout_constraintEnd_toEndOf="@id/contentTv"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/floorHintTv"
|
||||
tools:text="999" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user