pretendard_bold -> bold pretendard_regular -> regular pretendard_medium -> medium pretendard_light -> light
169 lines
7.4 KiB
XML
169 lines
7.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?><!--
|
|
AI 메시지 아이템 레이아웃 (3.3)
|
|
- 왼쪽 정렬된 메시지 버블
|
|
- 프로필 이미지, 이름(조건부), 메시지, 시간(오른쪽, 조건부)
|
|
- 배경: @drawable/bg_chat_ai_message
|
|
- 그룹화 지원: iv_profile, tv_name, tv_time의 가시성을 어댑터에서 제어
|
|
-->
|
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content">
|
|
|
|
<!-- 프로필 이미지 (그룹 첫 메시지에서만 보임) -->
|
|
<ImageView
|
|
android:id="@+id/iv_profile"
|
|
android:layout_width="32dp"
|
|
android:layout_height="32dp"
|
|
android:layout_marginEnd="8dp"
|
|
android:contentDescription="@string/a11y_ai_profile_image"
|
|
android:scaleType="centerCrop"
|
|
android:src="@drawable/ic_placeholder_profile"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="@id/message_group" />
|
|
|
|
<!-- 메시지 그룹: 이름 + 메시지 버블 -->
|
|
<LinearLayout
|
|
android:id="@+id/message_group"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="8dp"
|
|
android:orientation="vertical"
|
|
app:layout_constraintHorizontal_bias="0"
|
|
app:layout_constraintStart_toEndOf="@id/iv_profile"
|
|
app:layout_constraintEnd_toStartOf="@id/tv_time"
|
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
|
<!-- 보낸이 이름 (그룹의 첫 메시지에서만 보임) -->
|
|
<TextView
|
|
android:id="@+id/tv_name"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="2dp"
|
|
android:ellipsize="end"
|
|
android:fontFamily="@font/regular"
|
|
android:includeFontPadding="false"
|
|
android:maxLines="1"
|
|
android:textColor="@android:color/white"
|
|
android:textSize="12sp" />
|
|
|
|
<!-- 메시지 버블 컨테이너 -->
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:id="@+id/message_container"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:background="@drawable/bg_chat_ai_message"
|
|
android:paddingHorizontal="10dp"
|
|
android:paddingVertical="8dp">
|
|
|
|
<TextView
|
|
android:id="@+id/tv_message"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:breakStrategy="balanced"
|
|
android:ellipsize="end"
|
|
android:fontFamily="@font/regular"
|
|
android:hyphenationFrequency="normal"
|
|
android:includeFontPadding="false"
|
|
android:lineSpacingExtra="2dp"
|
|
android:maxLines="1000"
|
|
android:textColor="@android:color/white"
|
|
android:textSize="15sp"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
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/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/bold"
|
|
android:text="@string/chat_unlock_image_hint"
|
|
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"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="4dp"
|
|
android:fontFamily="@font/regular"
|
|
android:includeFontPadding="false"
|
|
android:textColor="@color/color_777777"
|
|
android:textSize="12sp"
|
|
app:layout_constraintBottom_toBottomOf="@id/message_group"
|
|
app:layout_constraintStart_toEndOf="@id/message_group"
|
|
app:layout_constraintEnd_toEndOf="@id/guideline_90" />
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|