FlagChatAdapter
1.0.1
FlagChatAdapter易於實現迷人的回收器視圖適配器。只需使用FlagChatadapter擴展適配器,請使用一些方法並瞧!您的手機上有最漂亮的聊天。零樣板代碼,只需將您的變量朝正確的方向

可以使用Maven,Gradle或手動安裝FlagChatAdapter 。
步驟1。將Jitpack存儲庫添加到您的構建文件
< repositories >
< repository >
< id >jitpack.io</ id >
< url >https://jitpack.io</ url >
</ repository >
</ repositories >步驟2。添加依賴關係
< dependency >
< groupId >com.github.salmaanahmed</ groupId >
< artifactId >FlagChatAdapter</ artifactId >
< version >1.0.1</ version >
</ dependency >步驟1。將Jitpack存儲庫添加到您的構建文件
allprojects {
repositories {
.. .
maven { url ' https://jitpack.io ' }
}
}步驟2。添加依賴關係
dependencies {
implementation ' com.github.salmaanahmed:FlagChatAdapter:1.0.1 '
}如果您不希望使用上述依賴關係經理中的任何一個,則可以通過將Java文件夾中包含的文件添加到項目中,將FlagChatAdapter整合到項目中。
使用flagchatadapter擴展適配器,然後將上下文傳遞給適配器
class ChatAdapter ( context : Context , private var list : ArrayList < Any >) : FlagChatAdapter(context)實施所需的方法和變量。寫一個行函數,不是那麼簡單;)您可能會看到示例以獲取詳細說明
// return chat message on the position passed as parameter
abstract fun chatMessage ( position : Int ): String
// return time of message as string format on the position passed as parameter
abstract fun messageTime ( position : Int ): String
// return message sender on the position passed as parameter, if its you, return true
abstract fun isMe ( position : Int ): Boolean
// you must have a variable of animation in the object i.e. if you want to animate or not
abstract fun animation ( position : Int ): Boolean
// the animation variable must be set to false when animation is performed once, otherwise flags will animate on every scroll
abstract fun setAnimationStatus ( position : Int , animationStatus : Boolean )
// Name of the sender
abstract val otherName : String
// You shall simply return list.size
abstract val listSize : Int你也有遠程鍵盤
// You can implement whatever you want onLongClick event
abstract fun onMessageLongClicked ( position : Int )使用提供的自定義美化您的聊天。您還可以更改標誌的顏色。實現非常簡單,看起來很棒。您可以在示例應用程序中找到更多詳細信息。
FlagChatAdapter可根據MIT許可獲得。有關更多信息,請參見許可證文件。
歡迎拉動請求!最佳貢獻將包括替換或配置,用於在典型的應用程序生命週期期間已知的類/方法封鎖主線程的方法。
我很想知道您是否在應用程序中使用Flagchatadapter,請發送電子郵件給Salmaan Ahmed