Skip to content

Commit

Permalink
Merge pull request #6 from apex-wang/main
Browse files Browse the repository at this point in the history
fix bug compatible web emoji
  • Loading branch information
apex-wang authored Apr 23, 2024
2 parents 133b957 + 7c97c4c commit fe1b0d5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ object EaseEmojiHelper {
private const val o_ee_49 = "[(Z)]"
private const val o_ee_50 = "[-)]"
private const val o_ee_51 = "[:-]"
private const val o_ee_52 = ""
private const val o_ee_53 = "\uD83E\uDD74"
private const val o_ee_54 = "\uD83D\uDE41"
private const val o_ee_55 = "\uD83D\uDE2D"
private const val o_ee_56 = "\uD83D\uDE10"
private const val o_ee_57 = "\uD83D\uDE07"
private const val o_ee_58 = "\uD83D\uDE2C"

private val mapping: Map<String, String> = mapOf(
o_ee_1 to "☺️",
Expand Down Expand Up @@ -172,6 +179,14 @@ object EaseEmojiHelper {
o_ee_49 to "🎉",
o_ee_50 to "🤢",
o_ee_51 to "🙄",
o_ee_52 to "☺️",
o_ee_53 to "\uD83E\uDD74",
o_ee_54 to "\uD83D\uDE41",
o_ee_55 to "\uD83D\uDE2D",
o_ee_56 to "\uD83D\uDE10",
o_ee_57 to "\uD83D\uDE07",
o_ee_58 to "\uD83D\uDE2C",

)

private val emojiMap by lazy { mutableMapOf<String, Any>() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class EaseContactListLayout@JvmOverloads constructor(
private val attrs: AttributeSet? = null,
private val defStyleAttr: Int = 0
): LinearLayout(context, attrs, defStyleAttr), IContactListLayout ,IEaseContactResultView {

private var isFirstLoad = false
/**
* Refresh layout.
*/
Expand Down Expand Up @@ -254,7 +254,11 @@ class EaseContactListLayout@JvmOverloads constructor(
override fun loadContactListSuccess(list: MutableList<EaseUser>) {
refreshLayout.finishRefresh()
listAdapter?.setData(list.toMutableList())
loadContactListener?.loadContactListSuccess(list)
listAdapter?.mData?.let {
if (it.size > 0){
loadContactListener?.loadContactListSuccess(list)
}
}
}

override fun loadContactListFail(code: Int, error: String) {
Expand All @@ -269,6 +273,10 @@ class EaseContactListLayout@JvmOverloads constructor(
override fun fetchUserInfoByUserSuccess(users: List<EaseUser>?) {
if (!users.isNullOrEmpty()) {
listAdapter?.notifyItemRangeChanged(0, listAdapter?.itemCount ?: 0)
if (!isFirstLoad){
contactViewModel?.loadData()
isFirstLoad = true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch

open class EaseContactListViewModel(
private val chatContactManager: ChatContactManager = ChatClient.getInstance().contactManager(),
private val stopTimeoutMillis: Long = 5000
val chatContactManager: ChatContactManager = ChatClient.getInstance().contactManager(),
val stopTimeoutMillis: Long = 5000
): EaseBaseViewModel<IEaseContactResultView>(),IContactListRequest {

val repository:EaseContactListRepository = EaseContactListRepository(chatContactManager)
Expand Down

0 comments on commit fe1b0d5

Please sign in to comment.