Popularity
1.6
Stable
Activity
0.0
Stable
40
1
7

Description

FlagChatAdapter is easy to implement enchanting recycler view adapter. Just extend your adapter with FlagChatAdapter, impliment some methods and voila! You have got the most beautiful looking chat on your phone. Zero boilerplate code, just put your variables in the right direction

Programming language: Kotlin
Latest version: v1.0.1

FlagChatAdapter alternatives and similar packages

Based on the "Animations" category.
Alternatively, view FlagChatAdapter alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of FlagChatAdapter or a related project?

Add another 'Animations' Package

README

FlagChatAdapter

Description

FlagChatAdapter is easy to implement enchanting recycler view adapter. Just extend your adapter with FlagChatAdapter, impliment some methods and voila! You have got the most beautiful looking chat on your phone. Zero boilerplate code, just put your variables in the right direction

Installation

FlagChatAdapter can be installed using Maven, Gradle, or manually.

Maven

Step 1. Add the JitPack repository to your build file

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Step 2. Add the dependency

<dependency>
    <groupId>com.github.salmaanahmed</groupId>
    <artifactId>FlagChatAdapter</artifactId>
    <version>1.0.1</version>
</dependency>

Gradle

Step 1. Add the JitPack repository to your build file

allprojects {
    repositories {
      ...
      maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.salmaanahmed:FlagChatAdapter:1.0.1'
}

Manual Installation

If you prefer not to use either of the above mentioned dependency managers, you can integrate FlagChatAdapter into your project manually by adding the files contained in the java folder to your project.

Getting Started

Extend Your Adapter With FlagChatAdapter

Extend your adapter with FlagChatAdapter and pass context to the adapter

class ChatAdapter(context: Context, private var list: ArrayList<Any>) : FlagChatAdapter(context)

Implement methods

Implement required methods and variables. Write one line functions, isnt it so simple ;) You may see the sample for detail description

    //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 have also got longClickEvents

    //You can implement whatever you want onLongClick event
    abstract fun onMessageLongClicked(position: Int)

Beautify your chat with provided customization. You can also change color of flags. Very simple to implement and looks awesome. You can find more details in sample app.

Contributions and Licence

FlagChatAdapter is available under the MIT license. See the LICENSE file for more info.

Pull requests are welcome! The best contributions will consist of substitutions or configurations for classes/methods known to block the main thread during a typical app lifecycle.

I would love to know if you are using FlagChatAdapter in your app, send an email to Salmaan Ahmed


*Note that all licence references and agreements mentioned in the FlagChatAdapter README section above are relevant to that project's source code only.