Skip to content

Commit

Permalink
Merge pull request #61 from GetStream/stream-chat/6.1.1
Browse files Browse the repository at this point in the history
Stream Chat SDK 6.1.1
  • Loading branch information
skydoves authored Mar 26, 2024
2 parents 42960e0 + 37d4e17 commit 0fc243e
Show file tree
Hide file tree
Showing 28 changed files with 407 additions and 259 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true
[*]
# Most of the standard properties are supported
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
max_line_length = 100
insert_final_newline = true
trim_trailing_whitespace = true
4 changes: 2 additions & 2 deletions .github/workflows/app-distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11
java-version: 17
- name: Prepare environment
run: |
git fetch --unshallow
Expand All @@ -36,4 +36,4 @@ jobs:
appId: ${{secrets.FIREBASE_UI_VIRTUAL_EVENT_SAMPLE_APP_ID}}
token: ${{secrets.FIREBASE_TOKEN}}
groups: stream-testers
file: virtual-event-sample/build/outputs/apk/release/virtual-event-sample-release.apk
file: virtual-event-sample/build/outputs/apk/release/virtual-event-sample-release.apk
10 changes: 6 additions & 4 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@ on: [pull_request]
jobs:
lint:
name: Spotless check
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
distribution: adopt
java-version: 17
- name: spotless
run: ./gradlew spotlessCheck

debug_build:
name: Debug build
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
distribution: adopt
java-version: 17
- name: Build
run: ./gradlew assembleDebug
77 changes: 41 additions & 36 deletions compose-custom-attachments/build.gradle
Original file line number Diff line number Diff line change
@@ -1,49 +1,54 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.android.application'
id 'kotlin-android'
}

android {
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "io.getstream.chat.android.compose.customattachments"
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
}
defaultConfig {
applicationId "io.getstream.chat.android.compose.customattachments"
namespace "io.getstream.chat.android.compose.customattachments"
minSdk 21
targetSdk 34
versionCode 1
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion libs.versions.composeCompiler.get()
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion libs.versions.composeCompiler.get()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

dependencies {
// Stream SDK
implementation "io.getstream:stream-chat-android-compose:6.0.0-beta2"
implementation "io.getstream:stream-chat-android-state:6.0.0-beta2"
implementation "io.getstream:stream-chat-android-offline:6.0.0-beta2"
// Stream SDK
implementation "io.getstream:stream-chat-android-compose:6.1.1"
implementation "io.getstream:stream-chat-android-state:6.1.1"
implementation "io.getstream:stream-chat-android-offline:6.1.1"

implementation libs.androidxCoreKtx
implementation libs.androidxAppCompat
implementation libs.materialComponents
implementation libs.androidxCoreKtx
implementation libs.androidxAppCompat
implementation libs.materialComponents

// Compose
implementation libs.composeCompiler
implementation libs.composeUi
implementation libs.composeUiTooling
implementation libs.composeFoundation
implementation libs.composeMaterial
implementation libs.composeActivity
implementation libs.composeViewModel
// Compose
implementation libs.composeCompiler
implementation libs.composeUi
implementation libs.composeUiTooling
implementation libs.composeFoundation
implementation libs.composeMaterial
implementation libs.composeActivity
implementation libs.composeViewModel
}
3 changes: 1 addition & 2 deletions compose-custom-attachments/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.getstream.chat.android.compose.customattachments">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name=".CustomAttachmentsApp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import com.google.android.material.datepicker.MaterialDatePicker
import io.getstream.chat.android.client.ChatClient
import io.getstream.chat.android.compose.customattachments.R
import io.getstream.chat.android.compose.ui.messages.MessagesScreen
import io.getstream.chat.android.compose.ui.messages.composer.MessageComposer
Expand Down Expand Up @@ -79,6 +80,7 @@ fun CustomMessagesScreen(

val messageListViewModel = viewModel(MessageListViewModel::class.java, factory = factory)
val composerViewModel = viewModel(MessageComposerViewModel::class.java, factory = factory)
val connectionState by ChatClient.instance().clientState.connectionState.collectAsState()

val messageMode = messageListViewModel.messageMode
val currentUser by messageListViewModel.user.collectAsState()
Expand All @@ -94,7 +96,8 @@ fun CustomMessagesScreen(
channel = messageListViewModel.channel,
currentUser = currentUser,
messageMode = messageMode,
onBackPressed = onBackPressed
onBackPressed = onBackPressed,
connectionState = connectionState
)
},
bottomBar = {
Expand Down
16 changes: 11 additions & 5 deletions custom-attachments-message-composer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,32 @@ plugins {
}

android {
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "io.getstream.chat.android.customattachmentsv2"
namespace "io.getstream.chat.android.customattachments"
minSdk 21
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"
}

buildFeatures {
viewBinding true
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

dependencies {
// Stream SDK dependency
implementation "io.getstream:stream-chat-android-ui-components:6.0.0-beta2"
implementation "io.getstream:stream-chat-android-state:6.0.0-beta2"
implementation "io.getstream:stream-chat-android-offline:6.0.0-beta2"
implementation "io.getstream:stream-chat-android-ui-components:6.1.1"
implementation "io.getstream:stream-chat-android-state:6.1.1"
implementation "io.getstream:stream-chat-android-offline:6.1.1"

implementation libs.androidxCoreKtx
implementation libs.androidxActivityKtx
Expand Down
60 changes: 32 additions & 28 deletions custom-attachments-message-composer/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,37 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.getstream.chat.android.customattachments">

<application
android:name=".App"
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.CustomAttachments">

<activity
android:name=".activity.ChannelsActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

<activity
android:name=".activity.MessagesActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize" />

</application>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name=".App"
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.CustomAttachments">

<activity
android:name=".activity.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

<activity
android:name=".activity.ChannelsActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize" />

<activity
android:name=".activity.MessagesActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize" />

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* The MIT License (MIT)
*
* Copyright 2022 Stream.IO, Inc. All Rights Reserved.
*
* 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.
*/

package io.getstream.chat.android.customattachments.activity

import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.lifecycle.lifecycleScope
import io.getstream.chat.android.client.ChatClient
import io.getstream.chat.android.models.InitializationState
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch

class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

lifecycleScope.launch {
ChatClient.instance().clientState.initializationState.collectLatest {
if (it == InitializationState.COMPLETE) {
startActivity(Intent(this@MainActivity, ChannelsActivity::class.java))
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class MessagesActivity : AppCompatActivity() {
private lateinit var binding: ActivityMessagesBinding

private val factory: MessageListViewModelFactory by lazy {
MessageListViewModelFactory(requireNotNull(intent.getStringExtra(EXTRA_CID)))
MessageListViewModelFactory(this, requireNotNull(intent.getStringExtra(EXTRA_CID)))
}
private val messageListHeaderViewModel: MessageListHeaderViewModel by viewModels { factory }
private val messageListViewModel: MessageListViewModel by viewModels { factory }
Expand Down
16 changes: 11 additions & 5 deletions custom-attachments-message-input/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,32 @@ plugins {
}

android {
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "io.getstream.chat.android.customattachments"
namespace "io.getstream.chat.android.customattachments"
minSdk 21
targetSdk 33
targetSdk 34
versionCode 1
versionName "1.0"
}

buildFeatures {
viewBinding true
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

dependencies {
// Stream SDK dependency
implementation "io.getstream:stream-chat-android-ui-components:6.0.0-beta2"
implementation "io.getstream:stream-chat-android-state:6.0.0-beta2"
implementation "io.getstream:stream-chat-android-offline:6.0.0-beta2"
implementation "io.getstream:stream-chat-android-ui-components:6.1.1"
implementation "io.getstream:stream-chat-android-state:6.1.1"
implementation "io.getstream:stream-chat-android-offline:6.1.1"

implementation libs.androidxCoreKtx
implementation libs.androidxActivityKtx
Expand Down
Loading

0 comments on commit 0fc243e

Please sign in to comment.