feat(chat): AI 유료/이미지 메시지 및 구매 플로우 추가
- ServerChatMessage/ChatMessage에 messageType/imageUrl/price/hasAccess 필드 반영 - TalkApi/Repository: 유료 메시지 구매 API 연동 및 성공 시 로컬 DB 반영 - ChatRoomActivity: 구매 팝업 SodaDialog 적용(취소/잠금해제) 및 구매 성공 시 메시지 교체 - ChatMessageAdapter: 이미지 렌더링(라운드 10dp), 유료 오버레이(가격+"눌러서 잠금해제") 처리, 구매/캐러셀 오픈 콜백 추가 - 구매된 이미지 클릭 시 전체화면 캐러셀 지원 - item_chat_ai_message.xml: 메시지 UI 최대 90% 폭, 시간 텍스트 배치 개선, 이미지 4:5 비율 적용 - 그룹 메시지 간 간격 절반 적용(ItemDecoration) - Room DB v2 마이그레이션: messageType/imageUrl/price/hasAccess 컬럼 추가로 재입장 시 표시 문제 해결 왜: - 유료/이미지 메시지 기능 제공 및 일관된 구매 경험 필요 - 재입장 시 이미지/유료 정보 누락 문제(DB 정합) 해결 - 시간 잘림/배치 문제와 그룹 간격 시인성 개선
This commit is contained in:
@@ -29,9 +29,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_time"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_profile"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_time"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<!-- 보낸이 이름 (그룹의 첫 메시지에서만 보임) -->
|
||||
@@ -74,8 +74,83 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- 이미지 메시지 컨테이너 (텍스트 버블 대신 표시) -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/image_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="4:5" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_lock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_image"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_image"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_image"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_image">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_buy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/bg_buy_button"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingVertical="3dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_can" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/pretendard_bold"
|
||||
android:textColor="#263238"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_unlock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/pretendard_bold"
|
||||
android:text="눌러서 잠금해제"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_90"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.9" />
|
||||
|
||||
<!-- 전송 시간: 버블의 오른쪽에 표시 (그룹의 마지막 메시지에서만 보임) -->
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
@@ -87,7 +162,7 @@
|
||||
android:textColor="@color/color_777777"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/message_group"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/message_group" />
|
||||
app:layout_constraintStart_toEndOf="@id/message_group"
|
||||
app:layout_constraintEnd_toEndOf="@id/guideline_90" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
Reference in New Issue
Block a user