Skip to content

Commit 9178794

Browse files
Merge pull request #771 from QuickBlox/conference-kotlin
1.1.0-conference-kotlin
2 parents 478323c + 1de6683 commit 9178794

22 files changed

+696
-316
lines changed

sample-conference-kotlin/app/build.gradle

+6-7
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ android {
3232
applicationId "com.quickblox.sample.conference.kotlin"
3333
minSdkVersion 21
3434
targetSdkVersion 30
35-
versionCode 100000
36-
versionName "1.0.0"
35+
versionCode 110000
36+
versionName "1.1.0"
3737
multiDexEnabled true
3838
}
3939

@@ -110,19 +110,18 @@ dependencies {
110110
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$rootProject.lifecycleVersionKtx"
111111
implementation "android.arch.lifecycle:extensions:$rootProject.lifecycleVersion"
112112
implementation "androidx.lifecycle:lifecycle-common-java8:$rootProject.lifecycleVersionKtx"
113+
implementation "androidx.activity:activity-ktx:$rootProject.activityKtxVersion"
114+
implementation "androidx.fragment:fragment-ktx:$rootProject.fragmentKtxVersion"
113115

114116
implementation "com.github.bumptech.glide:glide:$rootProject.glideVersion"
115117

116118
implementation "com.vmadalin:easypermissions-ktx:$rootProject.easyPermissionsVersion"
117-
implementation "androidx.activity:activity-ktx:$rootProject.activityKtxVersion"
118-
implementation "androidx.fragment:fragment-ktx:$rootProject.fragmentKtxVersion"
119119

120120
implementation "com.google.dagger:hilt-android:$hiltVersion"
121-
122121
implementation "com.google.android.gms:play-services-gcm:$rootProject.servicesGcmVersion"
123122
implementation "com.google.firebase:firebase-core:$rootProject.firebaseCoreVersion"
124123

125124
kapt "com.google.dagger:hilt-compiler:$hiltVersion"
126-
kapt "androidx.hilt:hilt-lifecycle-viewmodel:$rootProject.hiltAndroidXVersion"
127-
kapt "androidx.hilt:hilt-compiler:$rootProject.hiltAndroidXVersion"
125+
kapt "androidx.hilt:hilt-lifecycle-viewmodel:$rootProject.hiltViewmodel"
126+
kapt "androidx.hilt:hilt-compiler:$rootProject.hiltCompiler"
128127
}

sample-conference-kotlin/app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
<service
101101
android:name=".data.service.CallService"
102-
android:foregroundServiceType="mediaProjection"
102+
android:foregroundServiceType="camera|microphone|mediaProjection"
103103
android:launchMode="singleTask" />
104104

105105
<service android:name=".data.push.FcmPushListenerServiceImpl">

sample-conference-kotlin/app/src/main/java/com/quickblox/sample/conference/kotlin/App.kt

+3-5
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ private const val APPLICATION_ID = ""
2020
private const val AUTH_KEY = ""
2121
private const val AUTH_SECRET = ""
2222
private const val ACCOUNT_KEY = ""
23-
private const val JANUS_SERVER_URL = ""
24-
25-
// TODO Firebase keys in - google-services.json
23+
private const val SERVER_URL = ""
2624

2725
/*
2826
* Created by Injoit in 2021-09-30.
@@ -52,10 +50,10 @@ class App : Application() {
5250
}
5351

5452
private fun initConferenceConfig() {
55-
if (TextUtils.isEmpty(JANUS_SERVER_URL)) {
53+
if (TextUtils.isEmpty(SERVER_URL)) {
5654
throw AssertionError(getString(R.string.error_server_url_null))
5755
} else {
58-
ConferenceConfig.setUrl(JANUS_SERVER_URL)
56+
ConferenceConfig.setUrl(SERVER_URL)
5957
}
6058
}
6159

sample-conference-kotlin/app/src/main/java/com/quickblox/sample/conference/kotlin/data/call/CallRepositoryImpl.kt

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ import com.quickblox.videochat.webrtc.QBRTCTypes
1818
class CallRepositoryImpl(private val context: Context) : CallRepository {
1919
override fun createSession(userId: Int, callback: DataCallBack<ConferenceSession, Exception>) {
2020
val conferenceType = QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_VIDEO
21-
ConferenceClient.getInstance(context).createSession(userId, conferenceType, object : ConferenceEntityCallback<ConferenceSession> {
22-
override fun onSuccess(session: ConferenceSession) {
23-
Handler(Looper.getMainLooper()).post {
24-
callback.onSuccess(session, null)
21+
ConferenceClient.getInstance(context).createSession(userId, conferenceType, object : ConferenceEntityCallback<ConferenceSession> {
22+
override fun onSuccess(session: ConferenceSession) {
23+
Handler(Looper.getMainLooper()).post {
24+
callback.onSuccess(session, null)
25+
}
2526
}
26-
}
2727

28-
override fun onError(exception: WsException) {
29-
Handler(Looper.getMainLooper()).post {
30-
callback.onError(exception)
28+
override fun onError(exception: WsException) {
29+
Handler(Looper.getMainLooper()).post {
30+
callback.onError(exception)
31+
}
3132
}
32-
}
33-
})
33+
})
3434
}
3535
}

sample-conference-kotlin/app/src/main/java/com/quickblox/sample/conference/kotlin/domain/call/CallListener.kt

-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ interface CallListener {
1515
fun onError(exception: Exception)
1616
fun releaseSession(exception: Exception?)
1717
fun setOnlineParticipants(count: Int)
18-
fun onClosedSession()
1918
}

sample-conference-kotlin/app/src/main/java/com/quickblox/sample/conference/kotlin/domain/call/CallManager.kt

+13-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import com.quickblox.conference.ConferenceSession
66
import com.quickblox.conference.QBConferenceRole
77
import com.quickblox.sample.conference.kotlin.domain.DomainCallback
88
import com.quickblox.sample.conference.kotlin.domain.call.entities.CallEntity
9-
import com.quickblox.users.model.QBUser
9+
import com.quickblox.sample.conference.kotlin.domain.call.entities.SessionState
1010

1111
/*
1212
* Created by Injoit in 2021-09-30.
@@ -15,22 +15,27 @@ import com.quickblox.users.model.QBUser
1515
interface CallManager {
1616
fun getSession(): ConferenceSession?
1717
fun getCurrentDialog(): QBChatDialog?
18-
fun getCallEntities(): LinkedHashSet<CallEntity>
19-
fun createSession(currentUser: QBUser, dialog: QBChatDialog, roomId: String, role: QBConferenceRole, callType: Int, callback: DomainCallback<ConferenceSession, Exception>)
18+
fun getCallEntities(): Set<CallEntity>
19+
fun createSession(currentUserId: Int, dialog: QBChatDialog?, roomId: String?, role: QBConferenceRole?,
20+
callType: Int?, callback: DomainCallback<ConferenceSession, Exception>)
2021
fun subscribeCallListener(callListener: CallListener)
2122
fun unsubscribeCallListener(callListener: CallListener)
2223
fun getRole(): QBConferenceRole?
2324
fun getCallType(): Int?
24-
fun swapCamera(callback: DomainCallback<Boolean?, Exception>)
25+
fun swapCamera()
2526
fun startSharing(permissionIntent: Intent)
2627
fun stopSharing(callback: DomainCallback<Unit?, Exception>)
2728
fun isSharing(): Boolean
28-
fun isAudioEnabled(): Boolean?
29-
fun isVideoEnabled(): Boolean?
29+
fun isAudioEnabled(): Boolean
30+
fun isVideoEnabled(): Boolean
3031
fun isFrontCamera(): Boolean
3132
fun setVideoEnabled(enable: Boolean)
3233
fun setAudioEnabled(enable: Boolean)
3334
fun leaveSession()
34-
fun getEnableVideoState(): Boolean?
35-
fun setEnableVideoState(enableState: Boolean?)
35+
fun saveVideoState()
36+
fun subscribeReconnectionListener(reconnectionListener: ReconnectionListener?)
37+
fun unsubscribeReconnectionListener(reconnectionListener: ReconnectionListener?)
38+
fun setDefaultReconnectionState()
39+
fun getSessionState(): SessionState
40+
fun setBackgroundState(backgroundState: Boolean)
3641
}

0 commit comments

Comments
 (0)