refactor(character-comment): 캐릭터 댓글/답글 리스트

- 배경색 변경
- 댓글 사이 간격 조정
This commit is contained in:
2025-08-20 18:38:16 +09:00
parent ab1dd04a60
commit 3a1943ba87
7 changed files with 124 additions and 151 deletions

View File

@@ -125,23 +125,23 @@ class CharacterCommentListFragment : BaseFragment<FragmentCharacterCommentListBi
) {
super.getItemOffsets(outRect, view, parent, state)
outRect.left = 13.3f.dpToPx().toInt()
outRect.right = 13.3f.dpToPx().toInt()
outRect.left = 24f.dpToPx().toInt()
outRect.right = 24f.dpToPx().toInt()
when (parent.getChildAdapterPosition(view)) {
0 -> {
outRect.top = 13.3f.dpToPx().toInt()
outRect.bottom = 6.7f.dpToPx().toInt()
outRect.top = 24f.dpToPx().toInt()
outRect.bottom = 12f.dpToPx().toInt()
}
adapter.itemCount - 1 -> {
outRect.top = 6.7f.dpToPx().toInt()
outRect.bottom = 13.3f.dpToPx().toInt()
outRect.top = 12f.dpToPx().toInt()
outRect.bottom = 24f.dpToPx().toInt()
}
else -> {
outRect.top = 6.7f.dpToPx().toInt()
outRect.bottom = 6.7f.dpToPx().toInt()
outRect.top = 24f.dpToPx().toInt()
outRect.bottom = 24f.dpToPx().toInt()
}
}
}

View File

@@ -7,7 +7,6 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
@@ -136,23 +135,27 @@ class CharacterCommentReplyFragment : BaseFragment<FragmentCharacterCommentReply
state: RecyclerView.State
) {
super.getItemOffsets(outRect, view, parent, state)
outRect.left = 13.3f.dpToPx().toInt()
outRect.right = 13.3f.dpToPx().toInt()
outRect.left = 24f.dpToPx().toInt()
outRect.right = 24f.dpToPx().toInt()
when (parent.getChildAdapterPosition(view)) {
0 -> {
outRect.top = 13.3f.dpToPx().toInt(); outRect.bottom = 12f.dpToPx().toInt()
outRect.top = 24f.dpToPx().toInt();
outRect.bottom = 12f.dpToPx().toInt()
}
adapter.itemCount - 1 -> {
outRect.top = 12f.dpToPx().toInt(); outRect.bottom = 13.3f.dpToPx().toInt()
outRect.top = 12f.dpToPx().toInt()
outRect.bottom = 24f.dpToPx().toInt()
}
else -> {
outRect.top = 12f.dpToPx().toInt(); outRect.bottom = 12f.dpToPx().toInt()
outRect.top = 12f.dpToPx().toInt()
outRect.bottom = 12f.dpToPx().toInt()
}
}
}
})
recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#263238" />
<corners
android:topLeftRadius="15dp"
android:topRightRadius="15dp" />
</shape>

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_top_round_corner_16_7_222222">
android:background="@drawable/bg_top_round_corner_15_263238">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/rl_toolbar"
@@ -48,31 +48,22 @@
android:paddingHorizontal="13.3dp"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:src="@drawable/ic_circle_x_white"
android:src="@drawable/ic_close_white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/rl_toolbar"
android:layout_marginHorizontal="13.3dp"
android:layout_marginTop="12dp"
android:background="#78909C" />
<!-- 캐릭터 상세의 댓글 입력 폼과 동일하게 표시 (간단화 버전) -->
<LinearLayout
android:id="@+id/ll_comment_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/divider"
android:background="@drawable/bg_top_round_corner_8_222222"
android:elevation="13.3dp"
android:layout_below="@+id/rl_toolbar"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:elevation="6dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="13.3dp">
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_comment_profile"
@@ -81,55 +72,58 @@
android:contentDescription="@null"
tools:src="@drawable/ic_placeholder_profile" />
<RelativeLayout
android:id="@+id/rl_input_comment"
<LinearLayout
android:id="@+id/ll_comment_input_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp">
android:layout_marginStart="12dp"
android:background="@drawable/bg_round_corner_5_stroke_white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="12dp"
android:paddingVertical="8dp">
<EditText
android:id="@+id/et_comment"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_round_corner_10_232323_3bb9f1"
android:layout_marginHorizontal="8dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:fontFamily="@font/pretendard_regular"
android:hint="댓글을 입력해보세요"
android:imeOptions="actionSend"
android:importantForAutofill="no"
android:inputType="text|textMultiLine"
android:paddingVertical="13.3dp"
android:paddingStart="13.3dp"
android:paddingEnd="50.7dp"
android:textColor="@color/color_eeeeee"
android:textColorHint="@color/color_777777"
android:textCursorDrawable="@drawable/edit_text_cursor"
android:textSize="13.3sp"
tools:ignore="LabelFor" />
android:inputType="textCapSentences|textMultiLine"
android:maxLines="3"
android:padding="0dp"
android:textColor="@color/white"
android:textColorHint="@color/color_7c7c80"
android:textSize="14sp"
tools:ignore="NestedWeights" />
<ImageView
android:id="@+id/iv_comment_send"
android:layout_width="33.3dp"
android:layout_height="33.3dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="6dp"
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@null"
android:src="@drawable/btn_message_send" />
</RelativeLayout>
android:src="@drawable/ic_message_send" />
</LinearLayout>
</LinearLayout>
<View
android:id="@+id/divider2"
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/ll_comment_input"
android:layout_marginHorizontal="13.3dp"
android:layout_marginTop="20dp"
android:background="#78909C" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_comment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@+id/divider2"
android:layout_below="@+id/divider"
android:layout_alignParentBottom="true"
android:clipToPadding="false"
android:padding="13.3dp" />
android:clipToPadding="false" />
</RelativeLayout>

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_top_round_corner_16_7_222222">
android:background="@drawable/bg_top_round_corner_15_263238">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/rl_toolbar"
@@ -37,30 +37,21 @@
android:paddingHorizontal="13.3dp"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:src="@drawable/ic_circle_x_white"
android:src="@drawable/ic_close_white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/rl_toolbar"
android:layout_marginHorizontal="13.3dp"
android:layout_marginTop="12dp"
android:background="#78909C" />
<LinearLayout
android:id="@+id/ll_comment_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/divider"
android:background="@drawable/bg_top_round_corner_8_222222"
android:layout_below="@+id/rl_toolbar"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:elevation="6dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="13.3dp">
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_comment_profile"
@@ -69,56 +60,58 @@
android:contentDescription="@null"
tools:src="@drawable/ic_placeholder_profile" />
<RelativeLayout
android:id="@+id/rl_input_comment"
<LinearLayout
android:id="@+id/ll_comment_input_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp">
android:layout_marginStart="12dp"
android:background="@drawable/bg_round_corner_5_stroke_white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingHorizontal="12dp"
android:paddingVertical="8dp">
<EditText
android:id="@+id/et_comment"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_round_corner_10_232323_3bb9f1"
android:hint="답글을 입력해 보세요"
android:layout_marginHorizontal="8dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:fontFamily="@font/pretendard_regular"
android:hint="댓글을 입력해보세요"
android:imeOptions="actionSend"
android:importantForAutofill="no"
android:inputType="text|textMultiLine"
android:maxLines="5"
android:paddingVertical="13.3dp"
android:paddingStart="13.3dp"
android:paddingEnd="50.7dp"
android:textColor="@color/color_eeeeee"
android:textColorHint="@color/color_777777"
android:textCursorDrawable="@drawable/edit_text_cursor"
android:textSize="13.3sp"
tools:ignore="LabelFor" />
android:inputType="textCapSentences|textMultiLine"
android:maxLines="3"
android:padding="0dp"
android:textColor="@color/white"
android:textColorHint="@color/color_7c7c80"
android:textSize="14sp"
tools:ignore="NestedWeights" />
<ImageView
android:id="@+id/iv_comment_send"
android:layout_width="33.3dp"
android:layout_height="33.3dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="6dp"
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@null"
android:src="@drawable/btn_message_send" />
</RelativeLayout>
android:src="@drawable/ic_message_send" />
</LinearLayout>
</LinearLayout>
<View
android:id="@+id/divider2"
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/ll_comment_input"
android:layout_marginHorizontal="13.3dp"
android:layout_marginTop="20dp"
android:background="#78909C" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_comment_reply"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@+id/divider"
android:layout_alignParentBottom="true"
android:layout_below="@+id/divider2"
android:clipToPadding="false"
android:padding="13.3dp" />
android:clipToPadding="false" />
</RelativeLayout>

View File

@@ -32,6 +32,16 @@
android:textColor="@color/white"
android:textSize="14sp"
tools:text="닉네임" />
<TextView
android:id="@+id/tv_comment_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:fontFamily="@font/pretendard_regular"
android:textColor="@color/color_b0bec5"
android:textSize="12sp"
tools:text="2시간전" />
</LinearLayout>
<ImageView
@@ -43,32 +53,19 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/iv_comment_profile" />
<TextView
android:id="@+id/tv_comment_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:fontFamily="@font/pretendard_regular"
android:textColor="@color/color_b0bec5"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/ll_comment_nickname"
app:layout_constraintTop_toBottomOf="@+id/ll_comment_nickname"
tools:text="2시간전" />
<TextView
android:id="@+id/tv_comment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginTop="12dp"
android:fontFamily="@font/pretendard_regular"
android:lineSpacingExtra="4dp"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/tv_comment_date"
app:layout_constraintTop_toBottomOf="@+id/tv_comment_date"
tools:text="글 내용이 표시됩니다." />
app:layout_constraintStart_toStartOf="@+id/ll_comment_nickname"
app:layout_constraintTop_toBottomOf="@+id/ll_comment_nickname"
tools:text="글 내용이 표시됩니다." />
<TextView
android:id="@+id/tv_write_reply"
@@ -81,13 +78,4 @@
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/tv_comment"
app:layout_constraintTop_toBottomOf="@+id/tv_comment" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="12dp"
android:background="#78909C"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_write_reply" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -33,6 +33,16 @@
android:textColor="@color/white"
android:textSize="14sp"
tools:text="닉네임" />
<TextView
android:id="@+id/tv_comment_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:fontFamily="@font/pretendard_regular"
android:textColor="@color/color_b0bec5"
android:textSize="12sp"
tools:text="2시간전" />
</LinearLayout>
<ImageView
@@ -44,39 +54,17 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/iv_comment_profile" />
<TextView
android:id="@+id/tv_comment_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:fontFamily="@font/pretendard_regular"
android:textColor="@color/color_b0bec5"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/ll_comment_nickname"
app:layout_constraintTop_toBottomOf="@+id/ll_comment_nickname"
tools:text="2시간전" />
<TextView
android:id="@+id/tv_comment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginTop="12dp"
android:fontFamily="@font/pretendard_regular"
android:lineSpacingExtra="4dp"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/tv_comment_date"
app:layout_constraintTop_toBottomOf="@+id/tv_comment_date"
app:layout_constraintStart_toStartOf="@+id/ll_comment_nickname"
app:layout_constraintTop_toBottomOf="@+id/ll_comment_nickname"
tools:text="답글 내용이 표시됩니다." />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="12dp"
android:background="#78909C"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_comment" />
</androidx.constraintlayout.widget.ConstraintLayout>