├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── ids.xml │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── layout │ │ │ ├── item_message.xml │ │ │ ├── fragment_room.xml │ │ │ ├── activity_entry.xml │ │ │ ├── item_room.xml │ │ │ ├── item_message_pending.xml │ │ │ ├── activity_room.xml │ │ │ ├── include_loading.xml │ │ │ ├── activity_entry_loaded.xml │ │ │ ├── include_error.xml │ │ │ ├── fragment_room_loaded.xml │ │ │ └── activity_main.xml │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ └── drawable │ │ │ └── ic_launcher_background.xml │ │ ├── kotlin │ │ └── com │ │ │ └── pusher │ │ │ └── chatkitdemo │ │ │ ├── room │ │ │ ├── rooms.kt │ │ │ ├── RoomActivity.kt │ │ │ └── RoomFragment.kt │ │ │ ├── LangUtil.kt │ │ │ ├── views.kt │ │ │ ├── arch │ │ │ └── viewModels.kt │ │ │ ├── parallel │ │ │ ├── Channels.kt │ │ │ └── LifecycleReceiverChannel.kt │ │ │ ├── preferences.kt │ │ │ ├── MainActivity.kt │ │ │ ├── navigation │ │ │ └── navigation.kt │ │ │ ├── recyclerview │ │ │ └── DataAdapter.kt │ │ │ ├── ChatKitDemoApp.kt │ │ │ └── EntryActivity.kt │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── .gitignore ├── README.md ├── gradle.properties ├── .travis.yml └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = "android-slack-clone" 2 | include ':app' 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pusher/android-slack-clone/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pusher/android-slack-clone/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pusher/android-slack-clone/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pusher/android-slack-clone/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pusher/android-slack-clone/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pusher/android-slack-clone/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pusher/android-slack-clone/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pusher/android-slack-clone/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pusher/android-slack-clone/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pusher/android-slack-clone/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/pusher/chatkitdemo/room/rooms.kt: -------------------------------------------------------------------------------- 1 | package com.pusher.chatkitdemo.room 2 | 3 | import com.pusher.chatkit.rooms.Room 4 | 5 | val Room.coolName 6 | get() = "#$name" -------------------------------------------------------------------------------- /app/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDEA 2 | *.iml 3 | .idea/* 4 | !.idea/codeStyleSettings.xml 5 | !.idea/copyright 6 | 7 | # Gradle 8 | .gradle 9 | build 10 | /reports 11 | 12 | # Gradle Android 13 | /local.properties 14 | /captures 15 | gradle 16 | gradlew 17 | gradlew.bat 18 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/pusher/chatkitdemo/LangUtil.kt: -------------------------------------------------------------------------------- 1 | package com.pusher.chatkitdemo 2 | 3 | /** 4 | * Simplified way to get the name of a type 5 | */ 6 | inline fun nameOf(): String = nameOf(T::class.java) 7 | 8 | fun nameOf(type: Class): String = type.simpleName 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/pusher/chatkitdemo/views.kt: -------------------------------------------------------------------------------- 1 | package com.pusher.chatkitdemo 2 | 3 | import android.view.View 4 | import android.view.View.GONE 5 | import android.view.View.VISIBLE 6 | 7 | fun Array.showOnly(view: View) = forEach { 8 | when (it) { 9 | view -> it.visibility = VISIBLE 10 | else -> it.visibility = GONE 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ChatKit Demo 3 | continue 4 | Logging you in 5 | Oops! Something went wrong 6 | retry 7 | Loading… 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/pusher/chatkitdemo/arch/viewModels.kt: -------------------------------------------------------------------------------- 1 | package com.pusher.chatkitdemo.arch 2 | 3 | import android.arch.lifecycle.ViewModel 4 | import android.arch.lifecycle.ViewModelProviders 5 | import android.support.v4.app.Fragment 6 | import android.support.v4.app.FragmentActivity 7 | 8 | inline fun FragmentActivity.viewModel() = 9 | ViewModelProviders.of(this).get(A::class.java) 10 | 11 | inline fun Fragment.viewModel() = 12 | ViewModelProviders.of(this).get(A::class.java) 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Android Slack Clone (using [Chatkit](http://github.com/pusher/chatkit-android)) 2 | 3 | [![Twitter](https://img.shields.io/badge/twitter-@Pusher-blue.svg?style=flat)](http://twitter.com/Pusher) 4 | [![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/pusher/android-slack-clone/master/LICENSE) 5 | [![codecov](https://codecov.io/gh/pusher/android-slack-clone/branch/master/graph/badge.svg)](https://codecov.io/gh/pusher/android-slack-clone) 6 | [![Travis branch](https://img.shields.io/travis/pusher/android-slack-clone/master.svg)](https://travis-ci.org/pusher/android-slack-clone) 7 | 8 | 9 | # WIP (watch this space) 10 | -------------------------------------------------------------------------------- /app/src/main/kotlin/com/pusher/chatkitdemo/parallel/Channels.kt: -------------------------------------------------------------------------------- 1 | package com.pusher.chatkitdemo.parallel 2 | 3 | import kotlinx.coroutines.ExperimentalCoroutinesApi 4 | import kotlinx.coroutines.channels.BroadcastChannel 5 | import kotlinx.coroutines.channels.Channel 6 | import kotlinx.coroutines.launch 7 | import kotlinx.coroutines.GlobalScope 8 | 9 | 10 | @ExperimentalCoroutinesApi 11 | fun lazyBroadcast(block: suspend BroadcastChannel.() -> Unit = {}) = 12 | lazy { broadcast(block) } 13 | 14 | @ExperimentalCoroutinesApi 15 | fun broadcast(block: suspend BroadcastChannel.() -> Unit = {}) = 16 | BroadcastChannel(Channel.CONFLATED).also { 17 | GlobalScope.launch { block(it) } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_message.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_room.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 15 | 16 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |