Skip to content

Commit

Permalink
use notifyItemInserted
Browse files Browse the repository at this point in the history
  • Loading branch information
rlam20 committed Jun 28, 2024
1 parent 3820ff7 commit 3e62209
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ class MyTeamsDetailFragment : BaseNewsFragment() {
}
v.findViewById<View>(R.id.add_message).setOnClickListener { showAddMessage() }
}

@SuppressLint("NotifyDataSetChanged")
private fun showAddMessage() {
val alertInputBinding = AlertInputBinding.inflate(layoutInflater)
alertInputBinding.tlInput.hint = getString(R.string.enter_message)
Expand All @@ -120,7 +118,7 @@ class MyTeamsDetailFragment : BaseNewsFragment() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
createNews(map, mRealm, user, imageList)
}
rvDiscussion.adapter?.notifyDataSetChanged()
rvDiscussion.adapter?.notifyItemInserted(0)
}.setNegativeButton(R.string.cancel, null).show()
}

Expand Down

0 comments on commit 3e62209

Please sign in to comment.