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) super.getItemOffsets(outRect, view, parent, state)
outRect.left = 13.3f.dpToPx().toInt() outRect.left = 24f.dpToPx().toInt()
outRect.right = 13.3f.dpToPx().toInt() outRect.right = 24f.dpToPx().toInt()
when (parent.getChildAdapterPosition(view)) { when (parent.getChildAdapterPosition(view)) {
0 -> { 0 -> {
outRect.top = 13.3f.dpToPx().toInt() outRect.top = 24f.dpToPx().toInt()
outRect.bottom = 6.7f.dpToPx().toInt() outRect.bottom = 12f.dpToPx().toInt()
} }
adapter.itemCount - 1 -> { adapter.itemCount - 1 -> {
outRect.top = 6.7f.dpToPx().toInt() outRect.top = 12f.dpToPx().toInt()
outRect.bottom = 13.3f.dpToPx().toInt() outRect.bottom = 24f.dpToPx().toInt()
} }
else -> { else -> {
outRect.top = 6.7f.dpToPx().toInt() outRect.top = 24f.dpToPx().toInt()
outRect.bottom = 6.7f.dpToPx().toInt() outRect.bottom = 24f.dpToPx().toInt()
} }
} }
} }

View File

@@ -7,7 +7,6 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.Toast
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
@@ -136,23 +135,27 @@ class CharacterCommentReplyFragment : BaseFragment<FragmentCharacterCommentReply
state: RecyclerView.State state: RecyclerView.State
) { ) {
super.getItemOffsets(outRect, view, parent, state) super.getItemOffsets(outRect, view, parent, state)
outRect.left = 13.3f.dpToPx().toInt() outRect.left = 24f.dpToPx().toInt()
outRect.right = 13.3f.dpToPx().toInt() outRect.right = 24f.dpToPx().toInt()
when (parent.getChildAdapterPosition(view)) { when (parent.getChildAdapterPosition(view)) {
0 -> { 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 -> { 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 -> { 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() { recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy) 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" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" 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 <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/rl_toolbar" android:id="@+id/rl_toolbar"
@@ -48,31 +48,22 @@
android:paddingHorizontal="13.3dp" android:paddingHorizontal="13.3dp"
android:paddingTop="12dp" android:paddingTop="12dp"
android:paddingBottom="12dp" android:paddingBottom="12dp"
android:src="@drawable/ic_circle_x_white" android:src="@drawable/ic_close_white"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </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 <LinearLayout
android:id="@+id/ll_comment_input" android:id="@+id/ll_comment_input"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/divider" android:layout_below="@+id/rl_toolbar"
android:background="@drawable/bg_top_round_corner_8_222222" android:layout_marginHorizontal="24dp"
android:elevation="13.3dp" android:layout_marginTop="20dp"
android:elevation="6dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal">
android:padding="13.3dp">
<ImageView <ImageView
android:id="@+id/iv_comment_profile" android:id="@+id/iv_comment_profile"
@@ -81,55 +72,58 @@
android:contentDescription="@null" android:contentDescription="@null"
tools:src="@drawable/ic_placeholder_profile" /> tools:src="@drawable/ic_placeholder_profile" />
<RelativeLayout <LinearLayout
android:id="@+id/rl_input_comment" android:id="@+id/ll_comment_input_box"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" 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 <EditText
android:id="@+id/et_comment" android:id="@+id/et_comment"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_round_corner_10_232323_3bb9f1" android:layout_marginHorizontal="8dp"
android:hint="댓글을 입력해 보세요" android:layout_weight="1"
android:background="@android:color/transparent"
android:fontFamily="@font/pretendard_regular"
android:hint="댓글을 입력해보세요"
android:imeOptions="actionSend"
android:importantForAutofill="no" android:importantForAutofill="no"
android:inputType="text|textMultiLine" android:inputType="textCapSentences|textMultiLine"
android:paddingVertical="13.3dp" android:maxLines="3"
android:paddingStart="13.3dp" android:padding="0dp"
android:paddingEnd="50.7dp" android:textColor="@color/white"
android:textColor="@color/color_eeeeee" android:textColorHint="@color/color_7c7c80"
android:textColorHint="@color/color_777777" android:textSize="14sp"
android:textCursorDrawable="@drawable/edit_text_cursor" tools:ignore="NestedWeights" />
android:textSize="13.3sp"
tools:ignore="LabelFor" />
<ImageView <ImageView
android:id="@+id/iv_comment_send" android:id="@+id/iv_comment_send"
android:layout_width="33.3dp" android:layout_width="24dp"
android:layout_height="33.3dp" android:layout_height="24dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="6dp"
android:contentDescription="@null" android:contentDescription="@null"
android:src="@drawable/btn_message_send" /> android:src="@drawable/ic_message_send" />
</RelativeLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<View <View
android:id="@+id/divider2" android:id="@+id/divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_below="@+id/ll_comment_input" android:layout_below="@+id/ll_comment_input"
android:layout_marginHorizontal="13.3dp" android:layout_marginTop="20dp"
android:background="#78909C" /> android:background="#78909C" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_comment" android:id="@+id/rv_comment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_below="@+id/divider2" android:layout_below="@+id/divider"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:clipToPadding="false" android:clipToPadding="false" />
android:padding="13.3dp" />
</RelativeLayout> </RelativeLayout>

View File

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

View File

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

View File

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