Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jitvarpatil committed Jan 3, 2025
0 parents commit b7b7c0d
Show file tree
Hide file tree
Showing 1,317 changed files with 190,792 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Android-specific files
*.iml
.gradle/
local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build/
/out/
*.apk
*.ap_
*.dex
*.class
*.log
*.cxx/
*.hprof

# IntelliJ IDEA
.idea/
*.iws
*.ipr
*.iml

# Android Studio
.idea/caches
.idea/libraries
.idea/modules.xml
.idea/workspace.xml
.idea/navEditor.xml
.idea/assetWizardSettings.xml

# Keystore files
*.jks

# Gradle
.gradle/
/build/

# Local configuration file
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log files
*.log

# Android-specific files
*.apk
*.ap_
*.dex
*.class

# Generated files
gen/
bin/
.idea/
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<p align="center">
<img alt="CometChat" src="https://assets.cometchat.io/website/images/logos/banner.png">
</p>

# CometChat Android UI Kit

The CometChat Android UI Kit provides a pre-built user interface kit that developers can use to quickly integrate a reliable & fully-featured chat
experience into an existing or a new app.


<div style="
display: flex;
align-items: center;
justify-content: center;">
<img src="screenshots/overview_cometchat_screens.png">
</div>

## Prerequisites

- Android Studio
- Android Device or emulator with Android version 6.0 or above.
- Java 8 or above.

## Getting Started

To set up CometChat Android UI Kit and utilize CometChat for your chat functionality, you'll need to follow these steps:

1. Register at the [CometChat Dashboard](https://app.cometchat.com/) to create an account.

2. After registering, log into your CometChat account and create a new app. Once created, CometChat will generate an Auth Key and App ID for you. Keep
these credentials secure as you'll need them later.

3. Check the [Key Concepts](https://www.cometchat.com/docs/android-uikit/key-concepts) to understand the basic components of CometChat.

4. Refer to the [Integration Steps](https://www.cometchat.com/docs/android-uikit/integration) in our documentation to integrate the UI Kit into your
Android app.

## Help and Support

For issues running the project or integrating with our UI Kits, consult our [documentation](https://www.cometchat.com/docs/android-uikit/integration)
or create a [support ticket](https://help.cometchat.com/hc/en-us) or seek real-time support via the [CometChat Dashboard](https://app.cometchat.com/).
37 changes: 37 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
id 'com.google.gms.google-services' version '4.4.2' apply false
id 'com.google.firebase.crashlytics' version "3.0.2" apply false
id 'com.diffplug.spotless' version '6.12.1'
alias(libs.plugins.kotlin.android) apply false
}

tasks.register('generateFileList') {
doLast {
// List all Java files in the 'src' directory
def javaFiles = fileTree('chatuikit/src/main/java/com/cometchat/chatuikit').include('**/*.java').files
def xmlFiles = fileTree('chatuikit/src/main/res').include('**/*.xml').files

// Print out the files for debugging purposes
println "Java files found: " + javaFiles.size()
javaFiles.each { println it }

println "XML files found: " + xmlFiles.size()
xmlFiles.each { println it }

// Combine Java and XML files into one list
def allFiles = javaFiles + xmlFiles
//def allFiles = javaFiles
//def allFiles = xmlFiles

// Write the list of file paths to a text file
def fileListPath = file('scripts/fileList.txt')
fileListPath.text = allFiles.collect { it.absolutePath }.join("\n")
}
}

tasks.register('formatCode', Exec) {
//dependsOn generateFileList
//commandLine 'osascript', 'scripts/formatCode.applescript'
}
1 change: 1 addition & 0 deletions chatuikit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
181 changes: 181 additions & 0 deletions chatuikit/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
plugins {
alias(libs.plugins.android.library)
id 'maven-publish'
}

android {
namespace 'com.cometchat.chatuikit'
compileSdk 34

defaultConfig {
minSdk 24
versionCode 26
versionName "5.0.0-beta1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"

multiDexEnabled true
vectorDrawables.useSupportLibrary = true
renderscriptSupportModeEnabled true

ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}

buildConfigField 'String', 'VERSION_NAME', "\"${defaultConfig.versionName}\""
buildConfigField 'int', 'VERSION_CODE', "${defaultConfig.versionCode}"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', '.apt_generated']
aidl.srcDirs = ['src/main/aidl', '.apt_generated']
res.srcDirs = [
'src/main/res',
'src/main/res-components',
'src/main/res-components/calls',
'src/main/res-components/chats',
'src/main/res-components/cometchatui',
'src/main/res-components/groups',
'src/main/res-components/messagebubbles',
'src/main/res-components/messages',
'src/main/res-components/others',
'src/main/res-components/shared',
'src/main/res-components/userprofile',
'src/main/res-components/users'
]
}
}

android.libraryVariants.configureEach { variant ->
if (variant.buildType.name == 'distributable') {
if (variant.mappingFile != null) {
tasks.register(name: "copyDistributableAarProguardMapping", type: Copy) {
group "distribution"
from variant.mappingFile.path
rename '.*', "proguard_mapping.txt"
into rootDir
}
bundleDistributableAar.finalizedBy copyDistributableAarProguardMapping
}
}
variant.outputs.all {
outputFileName = "chat-uikit-android.aar"
}
}

dataBinding {
enabled = true
}

viewBinding {
enabled = true
}

lintOptions {
abortOnError false
disable 'MissingTranslation', 'ObsoleteSdkInt', 'NotifyDataSetChanged', 'ExtraTranslation', 'VectorPath', 'CustomViewStyleable', 'unused', 'AutoCloseable'
}

buildFeatures {
buildConfig true
}
}

publishing {
repositories {

// maven {
// url = "$projectDir/distribution"
// }

maven {
name = "cloudsmith"
url = "https://api-g.cloudsmith.io/maven/cometchat/call-team"
credentials {
username = "jitvar-patil"
password = "d412ed679432a059fa33c31e324e223c7b1ed200"
}
}
}
publications {
maven(MavenPublication) {
groupId 'com.cometchat'
artifactId 'chat-uikit-android'
version "${project.android.defaultConfig.versionName}"
artifact "$buildDir/outputs/aar/chat-uikit-android.aar"

pom.withXml {
def node = asNode()

((NodeList) node.get('packaging')).get(0).value = 'aar'

def dependenciesNode = node.appendNode('dependencies')

def cl = { Dependency dep ->
if (dep.group == null || dep.version == null || dep.name == null || dep.name == "unspecified") return // ignore invalid dependencies

def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dep.group)
dependencyNode.appendNode('artifactId', dep.name)
dependencyNode.appendNode('version', dep.version)

if (!dep.transitive) {
// If this dependency is transitive, we should force exclude all its dependencies them from the POM
def exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion')
exclusionNode.appendNode('groupId', '*')
exclusionNode.appendNode('artifactId', '*')
} else if (!dep.properties.excludeRules.empty) {
// Otherwise add specified exclude rules
def exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion')
dep.properties.excludeRules.each { ExcludeRule rule ->
exclusionNode.appendNode('groupId', rule.group ?: '*')
exclusionNode.appendNode('artifactId', rule.module ?: '*')
}
}
}

// List all dependencies and write to POM
configurations.api.getAllDependencies().each cl
configurations.implementation.getAllDependencies().each cl
}
}
}
}

dependencies {
implementation libs.appcompat
implementation libs.material

//Test Dependencies
testImplementation libs.junit
androidTestImplementation libs.ext.junit
androidTestImplementation libs.espresso.core

//Glide Dependency
implementation libs.glide
annotationProcessor libs.compiler

//Other Dependencies
implementation libs.flexbox
implementation libs.gson
implementation libs.recyclerview
implementation libs.lottie

//CometChat Dependency
implementation libs.chat.sdk.android
compileOnly libs.calls.sdk.android
}
Empty file added chatuikit/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions chatuikit/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Loading

0 comments on commit b7b7c0d

Please sign in to comment.