Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ object Libs {

const val appcompat = "androidx.appcompat:appcompat:1.4.2"

const val fragment = "androidx.fragment:fragment-ktx:1.5.5"

const val navigation = "androidx.navigation:navigation-compose:2.4.0"

const val splashscreen = "androidx.core:core-splashscreen:1.0.0"
Expand Down Expand Up @@ -195,6 +197,10 @@ object Libs {
private const val version = "2.9.0"
const val retrofit = "com.squareup.retrofit2:retrofit:$version"
}

object Github {
const val faker = "io.github.serpro69:kotlin-faker:1.12.0"
}
}

object Urls {
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ android.enableR8.fullMode=true
org.gradle.unsafe.configuration-cache=false
# PubNub keys
PUBNUB_PUBLISH_KEY="myPublishKey"
PUBNUB_SUBSCRIBE_KEY="mySubscribeKey"
PUBNUB_SUBSCRIBE_KEY="mySubscribeKey"
# YouTube key
# https://developers.google.com/youtube/android/player/register
YOUTUBE_KEY="muYoutubeKey"
1 change: 1 addition & 0 deletions live-event/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
3 changes: 3 additions & 0 deletions live-event/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions live-event/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions live-event/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions live-event/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions live-event/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Live Event Chat


`live-events` is an app that simulates live events. You can switch between multiple channels, send messages, view channel occupancy and the participant list. The app comes with the light and dark themes.

## Prerequisites

This application uses [PubNub Kotlin SDK](https://github.com/pubnub/kotlin) (>= 7.3.2) for chat
components and [Jetpack Compose](https://developer.android.com/jetpack/compose) as the UI Toolkit.

To use the app, you need:

* [Android Studio](https://developer.android.com/studio) (>= Dolphin 2021.3.1)
* PubNub account on [Admin Portal](https://dashboard.pubnub.com/)

## Features

The `live-event` app showcases these components and features:

* [MessageInput](https://www.pubnub.com/docs/chat/components/android/ui-components#messageinput)
* [MessageList](https://www.pubnub.com/docs/chat/components/android/ui-components#messagelist)
85 changes: 85 additions & 0 deletions live-event/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import com.pubnub.components.buildsrc.Libs

plugins {
id("com.android.application")
id("kotlin-android")
}

android {
namespace = "com.pubnub.components.example.live_event"
compileSdk = Libs.Build.Android.compileSdk

defaultConfig {
applicationId = "com.pubnub.components.example.live_event"
minSdk = Libs.Build.Android.minSdk
targetSdk = Libs.Build.Android.targetSdk
versionCode = Libs.Build.Android.versionCode
versionName = Libs.Build.Android.versionName

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}

buildConfigField("String", "PUBLISH_KEY", project.property("PUBNUB_PUBLISH_KEY") as String)
buildConfigField(
"String",
"SUBSCRIBE_KEY",
project.property("PUBNUB_SUBSCRIBE_KEY") as String
)
buildConfigField("String", "YOUTUBE_KEY", project.property("YOUTUBE_KEY") as String)
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = Libs.Build.Kotlin.jvmTarget
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = Libs.AndroidX.Compose.compilerVersion
}
}

dependencies {
implementation(fileTree("libs") { include("*.jar") })
implementation(Libs.PubNub.Components.chat)
api(platform(Libs.PubNub.bom))
implementation(Libs.PubNub.kotlin)
implementation(Libs.PubNub.memberships)

implementation(Libs.AndroidX.core)
implementation(Libs.AndroidX.appcompat)
implementation(Libs.AndroidX.fragment)
implementation(platform(Libs.AndroidX.Compose.bom))
implementation(Libs.AndroidX.Compose.ui)
implementation(Libs.AndroidX.Compose.material)
implementation(Libs.AndroidX.Compose.toolingPreview)
implementation(Libs.AndroidX.Lifecycle.runtime)
implementation(Libs.AndroidX.Activity.activityCompose)
implementation(Libs.Coil.coil)
implementation(Libs.JakeWharton.timber)
implementation(Libs.Accompanist.navigation)
implementation(Libs.Accompanist.placeholder)
implementation(Libs.Github.faker)

testImplementation(Libs.JUnit.junit)
androidTestImplementation(platform(Libs.AndroidX.Compose.bom))
androidTestImplementation(Libs.AndroidX.Test.Ext.junit)
androidTestImplementation(Libs.AndroidX.Test.espressoCore)
androidTestImplementation(Libs.AndroidX.Compose.uiTest)
debugImplementation(Libs.AndroidX.Compose.tooling)
}
Binary file added live-event/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions live-event/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Empty file added live-event/gradlew
Empty file.
89 changes: 89 additions & 0 deletions live-event/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added live-event/libs/YouTubeAndroidPlayerApi.jar
Binary file not shown.
21 changes: 21 additions & 0 deletions live-event/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
33 changes: 33 additions & 0 deletions live-event/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

<queries>
<intent>
<action android:name="com.google.android.youtube.api.service.START" />
</intent>
</queries>

<application
android:name=".LiveEventApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.PubNubChatComponents">
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.PubNubChatComponents"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Loading