Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
💬 대화하기 | 기본 프로필 이미지 추가 (#78)
Browse files Browse the repository at this point in the history
* [feat] 챗봇 기본 프로필 이미지 추가

* [fix] isLoading 초기화 픽스
  • Loading branch information
moondev03 authored Aug 12, 2024
1 parent 4b02cef commit 82823d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ import com.nabi.nabi.utils.LoggerUtils
import com.nabi.nabi.utils.UiState
import com.nabi.nabi.views.OnRvItemClickListener
import dagger.hilt.android.AndroidEntryPoint
import java.text.SimpleDateFormat
import java.time.LocalDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.util.Locale

@AndroidEntryPoint
class ChatFragment: BaseFragment<FragmentChatBinding>(R.layout.fragment_chat), OnRvItemClickListener<Int> {
private val dateFormat = SimpleDateFormat("yyyy년 MM월 dd일(E)", Locale.KOREA)
private val timeFormat = SimpleDateFormat("a hh:mm", Locale.KOREA)

private val viewModel: ChatViewModel by viewModels()
private lateinit var chatAdapter : ChatRvAdapter
private var isLoading = false
Expand Down Expand Up @@ -116,8 +111,12 @@ class ChatFragment: BaseFragment<FragmentChatBinding>(R.layout.fragment_chat), O
viewModel.uiState.observe(viewLifecycleOwner){
when(it){
is UiState.Loading -> {}
is UiState.Failure -> {}
is UiState.Failure -> {
isLoading = false
}
is UiState.Success -> {
isLoading = false

if(it.data.isNotEmpty()){
submitCustom(processChatItems(it.data))
}
Expand Down Expand Up @@ -218,7 +217,4 @@ class ChatFragment: BaseFragment<FragmentChatBinding>(R.layout.fragment_chat), O
binding.rvChat.scrollToPosition(filteredList.size - 1)
}
}



}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Nabi/presentation/src/main/res/layout/item_chat_other.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
android:layout_width="40dp"
android:layout_height="40dp"

android:contentDescription="@null"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"

android:background="@drawable/shape_chat_other_profile"/>
android:background="@drawable/img_default_nabi" />

<TextView
android:id="@+id/tv_chat_other_name"
Expand Down

0 comments on commit 82823d0

Please sign in to comment.