feat(chat-character): 캐릭터 신규 이미지 표시 UI 추가

This commit is contained in:
2025-11-13 23:02:24 +09:00
parent 0cfa5f8a32
commit 9b3d672e78
7 changed files with 83 additions and 9 deletions

View File

@@ -11,5 +11,6 @@ data class Character(
@SerializedName("characterId") val characterId: Long, @SerializedName("characterId") val characterId: Long,
@SerializedName("name") val name: String, @SerializedName("name") val name: String,
@SerializedName("description") val description: String, @SerializedName("description") val description: String,
@SerializedName("imageUrl") val imageUrl: String @SerializedName("imageUrl") val imageUrl: String,
@SerializedName("isNew") val isNew: Boolean
) : Parcelable ) : Parcelable

View File

@@ -49,6 +49,12 @@ class CharacterAdapter(
binding.tvRanking.visibility = View.GONE binding.tvRanking.visibility = View.GONE
} }
binding.tvNew.visibility = if (character.isNew) {
View.VISIBLE
} else {
View.GONE
}
binding.ivCharacter.load(character.imageUrl) { binding.ivCharacter.load(character.imageUrl) {
crossfade(true) crossfade(true)
placeholder(R.drawable.ic_logo_service_center) placeholder(R.drawable.ic_logo_service_center)

View File

@@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.chat.character.newcharacters
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import coil.load import coil.load
@@ -26,6 +27,11 @@ class NewCharactersAllAdapter(
placeholder(R.drawable.ic_logo_service_center) placeholder(R.drawable.ic_logo_service_center)
transformations(RoundedCornersTransformation(16f.dpToPx())) transformations(RoundedCornersTransformation(16f.dpToPx()))
} }
binding.tvNew.visibility = if (item.isNew) {
View.VISIBLE
} else {
View.GONE
}
binding.root.setOnClickListener { onClick(item.characterId) } binding.root.setOnClickListener { onClick(item.characterId) }
} }
} }

View File

@@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.chat.original.detail
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import coil.load import coil.load
@@ -27,6 +28,11 @@ class OriginalWorkDetailAdapter(
placeholder(R.drawable.ic_logo_service_center) placeholder(R.drawable.ic_logo_service_center)
transformations(RoundedCornersTransformation(16f.dpToPx())) transformations(RoundedCornersTransformation(16f.dpToPx()))
} }
binding.tvNew.visibility = if (item.isNew) {
View.VISIBLE
} else {
View.GONE
}
binding.root.setOnClickListener { onClickCharacter(item.characterId) } binding.root.setOnClickListener { onClickCharacter(item.characterId) }
} }
} }

View File

@@ -28,6 +28,23 @@
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="72sp" android:textSize="72sp"
tools:text="1" /> tools:text="1" />
<TextView
android:id="@+id/tv_new"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="end"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/bg_circle_3bb9f1"
android:fontFamily="@font/pretendard_medium"
android:gravity="center"
android:includeFontPadding="false"
android:maxLines="1"
android:text="N"
android:textColor="@color/white"
android:textSize="18sp"
android:visibility="gone" />
</FrameLayout> </FrameLayout>
<LinearLayout <LinearLayout

View File

@@ -11,14 +11,33 @@
android:id="@+id/iv_character" android:id="@+id/iv_character"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:scaleType="centerCrop"
android:contentDescription="@null" android:contentDescription="@null"
app:layout_constraintTop_toTopOf="parent" android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintDimensionRatio="1:1" app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_logo_service_center" /> tools:src="@drawable/ic_logo_service_center" />
<TextView
android:id="@+id/tv_new"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="end"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/bg_circle_3bb9f1"
android:fontFamily="@font/pretendard_medium"
android:gravity="center"
android:includeFontPadding="false"
android:maxLines="1"
android:text="N"
android:textColor="@color/white"
android:textSize="18sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@+id/iv_character"
app:layout_constraintTop_toTopOf="@+id/iv_character" />
<TextView <TextView
android:id="@+id/tv_character_name" android:id="@+id/tv_character_name"
android:layout_width="0dp" android:layout_width="0dp"
@@ -29,9 +48,9 @@
android:maxLines="1" android:maxLines="1"
android:textColor="@color/color_b0bec5" android:textColor="@color/color_b0bec5"
android:textSize="18sp" android:textSize="18sp"
app:layout_constraintTop_toBottomOf="@id/iv_character"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_character"
tools:text="캐릭터 이름" /> tools:text="캐릭터 이름" />
<TextView <TextView
@@ -44,9 +63,9 @@
android:maxLines="1" android:maxLines="1"
android:textColor="#78909C" android:textColor="#78909C"
android:textSize="14sp" android:textSize="14sp"
app:layout_constraintTop_toBottomOf="@id/tv_character_name"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_character_name"
tools:text="설명 텍스트" /> tools:text="설명 텍스트" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -17,6 +17,25 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_logo_service_center" /> tools:src="@drawable/ic_logo_service_center" />
<TextView
android:id="@+id/tv_new"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="end"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/bg_circle_3bb9f1"
android:fontFamily="@font/pretendard_medium"
android:gravity="center"
android:includeFontPadding="false"
android:maxLines="1"
android:text="N"
android:textColor="@color/white"
android:textSize="18sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@+id/iv_character"
app:layout_constraintTop_toTopOf="@+id/iv_character" />
<TextView <TextView
android:id="@+id/tv_character_name" android:id="@+id/tv_character_name"
android:layout_width="0dp" android:layout_width="0dp"