{"id":22482103,"url":"https://github.com/the-momentum/Chatlover-Android","last_synced_at":"2025-08-02T16:31:20.174Z","repository":{"id":57742458,"uuid":"116973494","full_name":"TheMomentumAI/Chatlover-Android","owner":"TheMomentumAI","description":"The Android library for our integrated Firebase chat solution","archived":false,"fork":false,"pushed_at":"2018-01-24T16:08:40.000Z","size":344,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T06:31:12.217Z","etag":null,"topics":["android","chat","crossplatform","firebase","ios","kotlin","multiplatform"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheMomentumAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-10T15:13:00.000Z","updated_at":"2018-01-26T03:10:50.000Z","dependencies_parsed_at":"2022-09-09T10:10:56.770Z","dependency_job_id":null,"html_url":"https://github.com/TheMomentumAI/Chatlover-Android","commit_stats":null,"previous_names":["themomentumai/chatlover-android"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMomentumAI%2FChatlover-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMomentumAI%2FChatlover-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMomentumAI%2FChatlover-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheMomentumAI%2FChatlover-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheMomentumAI","download_url":"https://codeload.github.com/TheMomentumAI/Chatlover-Android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228491916,"owners_count":17928720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","chat","crossplatform","firebase","ios","kotlin","multiplatform"],"created_at":"2024-12-06T16:19:20.798Z","updated_at":"2025-08-02T16:31:14.512Z","avatar_url":"https://github.com/TheMomentumAI.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Features\n- Quick to set up realtime chat functionality\n- Works with existing firebase projects as well as new ones\n- Easy to use, two-screen architecture\n- Sends text messages and location updates (images, videos and voice in near future)\n- Fully customisable\n- Optional push notifications  implementation\n- Android \u003c-\u003e iOS Compatibility\n- Fully written in Kotlin\n- A fully functional sample included in this repository.\n\n# Installation\n\n1. Set up the [Chatlover-Firebase](https://github.com/ApploverSoftware/Chatlover-Firebase) project in order to provide the backend functions for Chatlover's internal logic to work properly.\n1. Connect your application to the [Firebase project you created in the 1st step](https://console.firebase.google.com)\n1. Add `compile 'pl.applover:chatlover:0.13.1'` to your app's module `build.gradle` file under _dependencies_ tag\n4. Sync gradle project\n1. In your app's logic implement following features:\n\t1. Use `ChatUser.loginWithUid()` to log in with an existing user or create a new one and save them to database. The logged-in user will be persisted till the app is closed. Use completion to perform an action after success. You need to pass a user-unique uid and a name as parameters.\n\t1. Add a `ChannelListFragment` to an activity and container of your choice. Link it with the activity by calling `withListener()` method. The preferred method of creating in an Activity is `ChannelListFragment.newInstance().withListener(this)`.\n\t1. Create and display a `ChatFragment` (preferably in `onChatRequested` of `ChannelListListener`)\n\t1. To create a Channel call the makeChannel HTTP trigger from your project’s firebase functions or [write some other trigger to do it automatically when something happens in your application](https://firebase.google.com/docs/functions/database-events).\n\t1. Configure the Config objects (listed below) in your Application class or MainActivity (before the Chatlover fragments are created) for stable results.\n\n6. To enable push notifications add the following to Manifest file under application tag:\n``` xml\n\u003cservice\n    android:name=\"pl.applover.chatlover.services.ChatloverMessagingService\"\u003e\n    \u003cintent-filter\u003e\n        \u003caction android:name=\"com.google.firebase.MESSAGING_EVENT\"/\u003e\n    \u003c/intent-filter\u003e\n\u003c/service\u003e\n\u003cservice\n    android:name=\"pl.applover.chatlover.services.ChatloverInstanceIdService\"\u003e\n    \u003cintent-filter\u003e\n        \u003caction android:name=\"com.google.firebase.INSTANCE_ID_EVENT\"/\u003e\n    \u003c/intent-filter\u003e\n\u003c/service\u003e\n```\n7. If you need to combine Chatlover's push notifications with an existing implementation of Firebase Notification, you can check for _\"chatlover\"_ node in remoteMessage's data in your own `FirebaseMessagingService` and use `FirebaseChatMessagingService.handleChatMessage()` method for certain messages only. Every notification sent by ChatLover's send_notification function has a \"chatlover\" node and it is the only supported way of recognizing the notification's origin.\n\n# Customization\n\nChatlover sports the lightest way of configuring the looks and behaviors of its views. The Config objects are singletons to which you pass your required configuration. If a given field is set to null, the default value is used. This makes them non-dynamic by design but makes it really straightforward to properly configure in Kotlin. \n\nClone this repository and check MainActivity.config() in the Sample module for an example of how to use the configs. Note that for the styling to work properly, the configuration should take place before creating any Chatlover fragments. \n\nThe objects' fields are listed below (Defaults given in square brackets where applicable).:\n\n### ChannelListConfig\n\n\n- **picturePlaceholder**: _Drawable_\n\nChannel picture placeholder drawable\n\n\n- **pictureDecider**: _(channel: Channel, userRef: StorageReference, channelRef: StorageReference) -\u003e StorageReference_\n\nFunction that returns a storage reference of the picture chosen for given channel\n\n\n- **pictureSize**: _Int_\n\nSize of the channel picture in dp\n\n\n- **nameSize**: _Float_\n\nChannel name text size in sp\n\n\n- **nameColour**: _Int_\n\nChannel name text colour\n\n\n- **nameDecider**: _(channel: Channel) -\u003e String_\n\nFunction that returns name of a channel\n\n\n- **lastMsgSize**: _Float_\n\nLast message text size in sp\n\n\n- **lastMsgColour**: _Int_\n\nLast message text colour\n\n\n- **timeSize**: _Float_\n\nTime text size\n\n\n- **timeColour**: _Int_\n\nTime text colour\n\n\n- **itemBackground**: _Int_\n\nChannel List item background colour\n\n\n- **dividerColour**: _Int_\n\nDivider line colour\n\n\n- **onFragmentViewCreated**: _(View?) -\u003e Unit_\n\nFunction called after View creation of the Fragment\n\n\n- **swipeActions**: _List\u003cSwipeAction\u003cChannel\u003e\u003e_\n\nList of (max. 4) swipeActions, consisting of colours, icons, texts, and functions to be called on click. If empty list is passed, the item is not swipeable\n\n\n- **swipeActionWidth**: _Float_\n\nWidth of a single swipeAction button in dp.\n\n### ChatViewConfig\n\n\n- **bubbleShape**: _Drawable_\n\nBackground Drawable of the message bubble\n\n\n- **bubbleColourOwn**: _Int_\n\nColour of user’s own message bubbles\n\n\n- **bubbleColourOther**: _Int_\n\nColour of other users’ message bubbles\n\n\n- **textSize**: _Float_\n\nSize of text message or location message title in sp\n\n\n- **textSizeSecondary**: _Float_\n\nSize of location message address in sp\n\n\n- **textColour**: _Int_\n\nColour of text message or location message title\n\n\n- **textColourSecondary**: _Int_\n\nColour of location message address\n\n\n- **labelColour**: _Int_\n\nColour of time label\n\n\n- **labelSize**: _Float_\n\nSize of time label\n\n\n- **labelTimeFormat**: _String_\n\nSimpleDateFormat of time label\n\n\n- **labelIsShown**: _Boolean_\n\nDetermines if time label is shown or not\n\n\n- **headerColour**: _Int_\n\nDate header and lines colour\n\n\n- **headerSize**: _Float_\n\nDate header text size\n\n\n- **headerIsShown**: _Boolean_\n\nDetermines if date header is shown\n\n\n- **headerTimeFormat**: _String_\n\nSimpleDateFormat of date header\n\n\n- **avatarIsShown**: _Boolean_\n\nDetermines if others’ avatars are shown or not\n\n\n- **avatarSize**: _Int_\n\nAvatars’ size in dp\n\n\n- **avatarPlaceholder**: _Drawable_\n\nAvatar’s placeholder drawable\n\n\n- **avatarOnClick**: _(ChatUser) -\u003e Unit_\n\nFunction called when avatar is clicked\n\n\n- **inputBackground**: _Drawable_\n\nBackground drawable of the input field\n\n\n- **inputHint**: _String_\n\nInput field’s hint text\n\n\n- **inputTextSize**: _Float_\n\nInput field’s text size\n\n\n- **inputTextColour**: _Int_\n\nInput field’s text colour\n\n\n- **inputMaxLines**: _Int_\n\nInput field’s max lines number\n\n\n- **iconSend**: _Drawable_\n\nIcon drawable for send action\n\n\n- **iconLocation**: _Drawable_\n\nIcon drawable for send location action\n\n\n- **onTxtClick**: _(message: Message, context: Context) -\u003e Unit_\n\nFunction called on text message click\n\n\n- **onTxtLongClick**: _(message: Message, context: Context) -\u003e Unit_\n\nFunction called on text message long click\n\n\n- **onLocClick**: _(message: Message, context: Context) -\u003e Unit_\n\nFunction called on location message click\n\n\n- **onLocLongClick**: _(message: Message, context: Context) -\u003e Unit_\n\nFunction called on location message long click\n\n\n- **onFragmentViewCreated**: _(View?, Channel) -\u003e Unit_\n\nFunction called when Fragment View is created\n\n\n- **onBackPressed**: _() -\u003e Unit_\n\nFunction called when back arrow is pressed\n\n\n- **locationFoundText**: _String_\n\n### NotificationsConfig\n\n\n- **notificationTarget**: _Class\u003cout Activity\u003e_ \n\nActivity to be opened on notification click\n\n\n- **areNotificationsEnabled**: _Boolean_\n\nDetermines if the notifications are shown or not\n\n\n- **notificationCreator**: _(title: String?, body: String?, message: Message, channel: Channel, sender: ChatUser) -\u003e Notification_\n\nFunction that constructs the system notification\n\n\n- **onTokenRefresh**: _() -\u003e Unit_\n\nFunction to call after Firebase token is refreshed (If you overwrite it, ChatUser’s fcmToken field will not be updated automatically)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-momentum%2FChatlover-Android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-momentum%2FChatlover-Android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-momentum%2FChatlover-Android/lists"}