0

This is my code block to fix

private inner class ViewEmojiHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
        var emoji: TextView = itemView.findViewById(R.id.textView_emoji)
        fun bind(position: Int){
            val recyclerViewItem = list[position]
            emoji.text = recyclerViewItem.textData
//            category.text = recyclerViewItem.category
            val emojiList: Array<String> = list.map { it.textData }.toTypedArray()

            itemView.setOnClickListener{
                val clipboardManager = getSystemService(itemView.context, ClipboardManager::class.java)
                val clipData = ClipData.newPlainText("", list[position].textData)
                clipboardManager?.setPrimaryClip(clipData)
                // Hiển thị một thông báo snackbar cho người dùng
                val view = itemView.findViewById<View>(R.id.textView_emoji)
                val snackbar = Snackbar.make(view, "Đã sao chép " + list[position].textData, Snackbar.LENGTH_SHORT)
                snackbar.show()
            }
}

My result in app, when click each emoji (element) then copy to clipborad -> show the default notificaiton and the snackbar

I want to custom the notification that the default notification can have longer width to cover the long content, or hide the default notification, only have the snackbar I used. expected result I tried to used class NotificationManager but still have bugs. Please help me. Thanks so much

Ken White
  • 123,280
  • 14
  • 225
  • 444

0 Answers0