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