feat(chat-room): 메시지 입력/전송/실패 처리(6.1~6.3) 구현

- 왜: 채팅방에서 메시지 입력/전송 및 오류 대응 UX 완성을 위해 6.x 과업을 구현했습니다.
- 무엇:
  - 6.1 입력창 UI
    - EditText placeholder 리소스(@string/chat_input_placeholder) 적용, 최대 200자 제한
    - imeOptions(actionSend|flagNoEnterAction)로 IME 전송 액션 지원
    - 전송 버튼 활성/비활성 상태 관리(TextWatcher), 접근성 라벨(@string/action_send)
    - 입력창 포커스/클릭 시 키보드 표시, 전송 후 키보드 숨김
  - 6.2 전송 플로우
    - onSendClicked()/sendMessage() 도입: 즉시 SENDING 상태로 사용자 메시지 추가
    - 타이핑 인디케이터 표시/숨김 제어(ChatMessageAdapter.show/hideTypingIndicator)
    - 성공 시뮬레이션 후 SENT로 상태 업데이트 및 AI 응답 메시지 추가
    - TODO: 실제 TalkApi POST 연동 지점 주석 추가
  - 6.3 전송 실패 처리
    - FAILED 상태 시 사용자 메시지에 재전송 버튼 노출(item_chat_user_message.xml: iv_retry)
    - 어댑터 콜백을 통한 onRetrySend(localId) 처리 → 재시도 시 SENDING → SENT(성공 시)로 전환
    - strings: action_retry 추가, 접근성 라벨 적용
This commit is contained in:
2025-08-13 23:10:32 +09:00
parent 0cf0d2e790
commit ceae25ea06
5 changed files with 234 additions and 8 deletions

View File

@@ -189,13 +189,14 @@
android:layout_marginEnd="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:hint="메세지를 입력하세요."
android:hint="@string/chat_input_placeholder"
android:maxLength="200"
android:maxLines="4"
android:background="@drawable/bg_chat_input"
android:textColor="#FFFFFFFF"
android:textColorHint="#80FFFFFF"
android:inputType="textMultiLine"
android:imeOptions="actionSend|flagNoEnterAction"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_send"
app:layout_constraintTop_toTopOf="parent"

View File

@@ -3,6 +3,7 @@
사용자 메시지 아이템 레이아웃
- 오른쪽 정렬된 메시지 버블
- 버블의 왼쪽에 시간 표시
- 실패 시 재전송 버튼 노출
- 배경: @drawable/bg_chat_user_message
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
@@ -58,6 +59,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<!-- 재전송 버튼: FAILED 상태일 때만 보임 -->
<ImageView
android:id="@+id/iv_retry"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="6dp"
android:layout_marginTop="-8dp"
android:src="@android:drawable/ic_popup_sync"
android:background="@android:color/transparent"
android:contentDescription="@string/action_retry"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -17,4 +17,6 @@
<string name="chat_notice_clone">AI Clone은 크리에이터의 정보를 기반으로 대화하지만, 모든 정보를 완벽하게 반영하거나 실제 대화와 일치하지 않을 수 있습니다.</string>
<string name="chat_notice_character">보이스온 AI캐릭터톡은 대화의 자유도가 높아 대화에 참여하는 당신은 누구든 될 수 있습니다.\n세계관 속 캐릭터로 대화를 하거나 새로운 인물로 캐릭터와 당신만의 스토리를 만들어보세요.\n※ AI캐릭터톡은 오픈베타 서비스 중이며, 캐릭터의 대화가 어색하거나 불완전할 수 있습니다.</string>
<string name="chat_input_placeholder">메세지를 입력하세요.</string>
<string name="action_send">전송</string>
<string name="action_retry">다시 전송</string>
</resources>