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

Commit

Permalink
๐Ÿ’ฌ ๋Œ€ํ™”ํ•˜๊ธฐ | Greeting Msg Refresh Block && Balloon Size Update (#85)
Browse files Browse the repository at this point in the history
* [fix] Greeting Chat Refresh Block && Chat Size Update

* [fix] Greeting Chat Refresh Block && Chat Size Update
  • Loading branch information
moondev03 authored Aug 13, 2024
1 parent 5e6733b commit 1609475
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.nabi.domain.model.chat.ChatItem
import com.nabi.nabi.databinding.ItemChatDateBinding
import com.nabi.nabi.databinding.ItemChatMyBinding
import com.nabi.nabi.databinding.ItemChatOtherBinding
import com.nabi.nabi.utils.LoggerUtils
import com.nabi.nabi.views.OnRvItemClickListener

class ChatRvAdapter(
Expand Down Expand Up @@ -82,6 +83,10 @@ class ChatRvAdapter(
} else {
holder.binding.ibRefresh.visibility = View.GONE
}

if(itemCount == 2){
holder.binding.ibRefresh.visibility = View.GONE
}
}

class DateViewHolder private constructor(private val binding: ItemChatDateBinding) : RecyclerView.ViewHolder(binding.root) {
Expand Down Expand Up @@ -130,7 +135,7 @@ class ChatRvAdapter(
fun bind(item: ChatItem, retryClickListener: OnRvItemClickListener<Int>) {
binding.messageText.text = item.content
binding.tvTime.text = item.time
binding.ibRefresh.visibility = if (item.showRefreshIcon) View.VISIBLE else View.GONE
binding.ibRefresh.visibility = if(item.showRefreshIcon) View.VISIBLE else View.GONE
setMaxWidth(binding.messageText, itemView.context)

binding.ibRefresh.setOnClickListener {
Expand All @@ -143,7 +148,7 @@ class ChatRvAdapter(
val windowManager = context.getSystemService(Context.WINDOW_SERVICE) as android.view.WindowManager
windowManager.defaultDisplay.getMetrics(displayMetrics)
val screenWidth = displayMetrics.widthPixels
val maxWidth = (screenWidth * 0.6).toInt()
val maxWidth = (screenWidth * 0.5).toInt()
textView.maxWidth = maxWidth
}

Expand Down

0 comments on commit 1609475

Please sign in to comment.