FlexChatBox SDK made with Jetpack compose.
This project was created using Jetpack Compose to render @Composable function components.
- To get started developing for Android, please checkout the official documentation
- Also checkout the Jetpack Compose Tutorial to start building awsome apps using declarative UIs.
Flexchatbox
is an Android SDK developed with the intention to reduce the effort for the developers to build the chat functionality in their applications. The developers can simply integrate this SDK into any new or existing applications and use a host of features that are provided such as sending text messages and also sharing media content such as Images from device Gallery, capturing photos and videos, sharing current location, mobile contacts and voice recording clips and any other files types using the File Manager.
- This repo contains the source for the SDK and demo app to help integrate the SDK easily
- Demo app module can be used as-is if your requirement exactly fits
Electric Eel or higher
minSdk 24 targetSdk 33 compileSdk 33 Gradle version 7.5
compose_ui_version = '1.2.0'
In your root build.gradle
, add mavenCentral()
to the allprojects
section. In your module build.gradle
, add
dependencies { implementation 'in.tilicho:flexchatbox-android:0.0.2-alpha' }
The ChatBox function accepts following enum types.
enum class FlexType { GALLERY, VOICE, LOCATION, CONTACTS, FILES, CAMERA }
Initialising the SDK
FlexChatBox( context = context, textFieldPlaceHolder = "Type your text here", flexType = Pair(FlexType.Camera) { when(callback) { is Callback.Camera -> { // Access the uri from callback in the following way val uri = callback.uri } } }, onClickSend = { // Access the text entered in the textField. } )
Please use the following checks in the when condition for the different Flex types
is Callback.Files -> { //Access the list of uris from this callback } is Callback.Gallery -> { //Access the list of uris from this callback } is Callback.Voice -> { //Access the audio recorded file from this callback } is Callback.contacts -> { //Access the list of contacts from this callback } is Callback.Location -> { //Access the location object from this callback }
- Currently while using this SDK the developer will be able to integrate only one type of media item at a time.
- The developer can place the SDK UI item anywhere on the screen.
The feature set includes:
-
The host app will get text messages and integrated type of media message from the SDK. We have integrated different types of media messages which are required to chat conversation.
-
TextField
-
Camera
-
Gallery
-
Voice recording
-
Current location
-
Contacts
-
Files
-
- Multi Media Support : Currently we only support one media type to be shared from the SDK to the host app. This needs to be defined at the time of SDK initialisation itself. With this feature, developers can just select source type as Multi and the users will be prompted in the app which type of media they would like to share.
- Custom UI : With this feature we allow the developers to customise the ChatBox UI to a great extent. Currently we support only colour customisation.
MIT License
Copyright (c) 2023 Tilicho Labs
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.