Skip to content

Commit fe1d8b0

Browse files
committed
Migrate to Stream Chat SDK 6.1.1
1 parent 8e4390a commit fe1d8b0

13 files changed

Lines changed: 288 additions & 170 deletions

File tree

custom-attachments-message-composer/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ android {
1818
buildFeatures {
1919
viewBinding true
2020
}
21+
22+
compileOptions {
23+
sourceCompatibility = JavaVersion.VERSION_17
24+
targetCompatibility = JavaVersion.VERSION_17
25+
}
2126
}
2227

2328
dependencies {

custom-attachments-message-composer/src/main/AndroidManifest.xml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,35 @@
2424
-->
2525
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2626

27-
<application
28-
android:name=".App"
29-
android:allowBackup="true"
30-
android:icon="@mipmap/ic_launcher"
31-
android:label="@string/app_name"
32-
android:roundIcon="@mipmap/ic_launcher_round"
33-
android:supportsRtl="true"
34-
android:theme="@style/Theme.CustomAttachments">
35-
36-
<activity
37-
android:name=".activity.ChannelsActivity"
38-
android:exported="true">
39-
<intent-filter>
40-
<action android:name="android.intent.action.MAIN" />
41-
42-
<category android:name="android.intent.category.LAUNCHER" />
43-
</intent-filter>
44-
</activity>
45-
46-
<activity
47-
android:name=".activity.MessagesActivity"
48-
android:exported="true"
49-
android:windowSoftInputMode="adjustResize" />
50-
51-
</application>
27+
<application
28+
android:name=".App"
29+
android:allowBackup="true"
30+
android:icon="@mipmap/ic_launcher"
31+
android:label="@string/app_name"
32+
android:roundIcon="@mipmap/ic_launcher_round"
33+
android:supportsRtl="true"
34+
android:theme="@style/Theme.CustomAttachments">
35+
36+
<activity
37+
android:name=".activity.MainActivity"
38+
android:exported="true">
39+
<intent-filter>
40+
<action android:name="android.intent.action.MAIN" />
41+
42+
<category android:name="android.intent.category.LAUNCHER" />
43+
</intent-filter>
44+
</activity>
45+
46+
<activity
47+
android:name=".activity.ChannelsActivity"
48+
android:exported="true"
49+
android:windowSoftInputMode="adjustResize" />
50+
51+
<activity
52+
android:name=".activity.MessagesActivity"
53+
android:exported="true"
54+
android:windowSoftInputMode="adjustResize" />
55+
56+
</application>
5257

5358
</manifest>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright 2022 Stream.IO, Inc. All Rights Reserved.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
package io.getstream.chat.android.customattachments.activity
26+
27+
import android.content.Intent
28+
import android.os.Bundle
29+
import androidx.activity.ComponentActivity
30+
import androidx.lifecycle.lifecycleScope
31+
import io.getstream.chat.android.client.ChatClient
32+
import io.getstream.chat.android.models.InitializationState
33+
import kotlinx.coroutines.flow.collectLatest
34+
import kotlinx.coroutines.launch
35+
36+
class MainActivity : ComponentActivity() {
37+
38+
override fun onCreate(savedInstanceState: Bundle?) {
39+
super.onCreate(savedInstanceState)
40+
41+
lifecycleScope.launch {
42+
ChatClient.instance().clientState.initializationState.collectLatest {
43+
if (it == InitializationState.COMPLETE) {
44+
startActivity(Intent(this@MainActivity, ChannelsActivity::class.java))
45+
}
46+
}
47+
}
48+
}
49+
}

custom-attachments-message-composer/src/main/java/io/getstream/chat/android/customattachments/activity/MessagesActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class MessagesActivity : AppCompatActivity() {
5959
private lateinit var binding: ActivityMessagesBinding
6060

6161
private val factory: MessageListViewModelFactory by lazy {
62-
MessageListViewModelFactory(requireNotNull(intent.getStringExtra(EXTRA_CID)))
62+
MessageListViewModelFactory(this, requireNotNull(intent.getStringExtra(EXTRA_CID)))
6363
}
6464
private val messageListHeaderViewModel: MessageListHeaderViewModel by viewModels { factory }
6565
private val messageListViewModel: MessageListViewModel by viewModels { factory }

custom-attachments-message-input/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ android {
1818
buildFeatures {
1919
viewBinding true
2020
}
21+
22+
compileOptions {
23+
sourceCompatibility = JavaVersion.VERSION_17
24+
targetCompatibility = JavaVersion.VERSION_17
25+
}
2126
}
2227

2328
dependencies {

custom-attachments-message-input/src/main/AndroidManifest.xml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,35 @@
2424
-->
2525
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2626

27-
<application
28-
android:name=".App"
29-
android:allowBackup="true"
30-
android:icon="@mipmap/ic_launcher"
31-
android:label="@string/app_name"
32-
android:roundIcon="@mipmap/ic_launcher_round"
33-
android:supportsRtl="true"
34-
android:theme="@style/Theme.CustomAttachments">
35-
36-
<activity
37-
android:name=".activity.ChannelsActivity"
38-
android:exported="true">
39-
<intent-filter>
40-
<action android:name="android.intent.action.MAIN" />
41-
42-
<category android:name="android.intent.category.LAUNCHER" />
43-
</intent-filter>
44-
</activity>
45-
46-
<activity
47-
android:name=".activity.MessagesActivity"
48-
android:exported="true"
49-
android:windowSoftInputMode="adjustResize" />
50-
51-
</application>
27+
<application
28+
android:name=".App"
29+
android:allowBackup="true"
30+
android:icon="@mipmap/ic_launcher"
31+
android:label="@string/app_name"
32+
android:roundIcon="@mipmap/ic_launcher_round"
33+
android:supportsRtl="true"
34+
android:theme="@style/Theme.CustomAttachments">
35+
36+
<activity
37+
android:name=".activity.MainActivity"
38+
android:exported="true">
39+
<intent-filter>
40+
<action android:name="android.intent.action.MAIN" />
41+
42+
<category android:name="android.intent.category.LAUNCHER" />
43+
</intent-filter>
44+
</activity>
45+
46+
<activity
47+
android:name=".activity.ChannelsActivity"
48+
android:exported="true"
49+
android:windowSoftInputMode="adjustResize" />
50+
51+
<activity
52+
android:name=".activity.MessagesActivity"
53+
android:exported="true"
54+
android:windowSoftInputMode="adjustResize" />
55+
56+
</application>
5257

5358
</manifest>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright 2022 Stream.IO, Inc. All Rights Reserved.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
package io.getstream.chat.android.customattachments.activity
26+
27+
import android.content.Intent
28+
import android.os.Bundle
29+
import androidx.activity.ComponentActivity
30+
import androidx.lifecycle.lifecycleScope
31+
import io.getstream.chat.android.client.ChatClient
32+
import io.getstream.chat.android.models.InitializationState
33+
import kotlinx.coroutines.flow.collectLatest
34+
import kotlinx.coroutines.launch
35+
36+
class MainActivity : ComponentActivity() {
37+
38+
override fun onCreate(savedInstanceState: Bundle?) {
39+
super.onCreate(savedInstanceState)
40+
41+
lifecycleScope.launch {
42+
ChatClient.instance().clientState.initializationState.collectLatest {
43+
if (it == InitializationState.COMPLETE) {
44+
startActivity(Intent(this@MainActivity, ChannelsActivity::class.java))
45+
}
46+
}
47+
}
48+
}
49+
}

video-chat-sample/build.gradle

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,56 @@ apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
33

44
android {
5-
compileSdk 34
6-
7-
defaultConfig {
8-
applicationId "io.getstream.videochat"
9-
namespace "io.getstream.videochat"
10-
minSdk 23
11-
targetSdk 34
12-
versionCode 1
13-
versionName "1.0"
5+
compileSdk 34
6+
7+
defaultConfig {
8+
applicationId "io.getstream.videochat"
9+
namespace "io.getstream.videochat"
10+
minSdk 23
11+
targetSdk 34
12+
versionCode 1
13+
versionName "1.0"
14+
}
15+
16+
buildTypes {
17+
release {
18+
minifyEnabled false
19+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
1420
}
21+
}
1522

16-
buildTypes {
17-
release {
18-
minifyEnabled false
19-
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
20-
}
21-
}
23+
buildFeatures {
24+
viewBinding true
25+
}
2226

23-
buildFeatures {
24-
viewBinding true
25-
}
27+
compileOptions {
28+
sourceCompatibility = JavaVersion.VERSION_17
29+
targetCompatibility = JavaVersion.VERSION_17
30+
}
2631

27-
compileOptions {
28-
sourceCompatibility JavaVersion.VERSION_1_8
29-
targetCompatibility JavaVersion.VERSION_1_8
30-
}
31-
32-
kotlinOptions {
33-
jvmTarget = "1.8"
34-
}
32+
kotlinOptions {
33+
jvmTarget = "17"
34+
}
3535

36-
sourceSets {
37-
all {
38-
it.java.srcDir "src/$it.name/kotlin"
39-
}
36+
sourceSets {
37+
all {
38+
it.java.srcDir "src/$it.name/kotlin"
4039
}
40+
}
4141
}
4242

4343
dependencies {
44-
// Stream SDK dependency
45-
implementation "io.getstream:stream-chat-android-client:6.1.1"
46-
47-
implementation libs.materialComponents
48-
implementation libs.kotlinStdLib
49-
implementation libs.androidxAppCompat
50-
implementation libs.androidxCoreKtx
51-
implementation libs.androidxActivityKtx
52-
implementation libs.androidxLifecycleExtensions
53-
implementation libs.coil
54-
implementation libs.androidxRecyclerview
55-
implementation libs.androidxConstraintLayout
56-
implementation libs.youtubePlayer
44+
// Stream SDK dependency
45+
implementation "io.getstream:stream-chat-android-client:6.1.1"
46+
47+
implementation libs.materialComponents
48+
implementation libs.kotlinStdLib
49+
implementation libs.androidxAppCompat
50+
implementation libs.androidxCoreKtx
51+
implementation libs.androidxActivityKtx
52+
implementation libs.androidxLifecycleExtensions
53+
implementation libs.coil
54+
implementation libs.androidxRecyclerview
55+
implementation libs.androidxConstraintLayout
56+
implementation libs.youtubePlayer
5757
}

0 commit comments

Comments
 (0)