Skip to content

Commit

Permalink
Merge pull request #797 from QuickBlox/videochat-kotlin
Browse files Browse the repository at this point in the history
4.1.0-videochat-kotlin
  • Loading branch information
vdovbnya-qb authored Sep 7, 2022
2 parents 7d09ead + b8363cb commit 24e82c3
Show file tree
Hide file tree
Showing 56 changed files with 990 additions and 1,657 deletions.
28 changes: 14 additions & 14 deletions sample-videochat-kotlin/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinGradlePluginVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
}
}

Expand All @@ -29,26 +29,26 @@ android {

compileSdkVersion 31
buildToolsVersion "31.0.0"
flavorDimensions dimensionDefault
flavorDimensions "default"

defaultConfig {
applicationId "com.quickblox.sample.videochat.kotlin"
minSdkVersion 21
targetSdkVersion 31
versionCode 405000
versionName '4.0.5'
versionCode 410000
versionName '4.1.0'
multiDexEnabled true
}

productFlavors {
dev {
dimension dimensionDefault
dimension "default"
buildConfigField('boolean', "IS_QA", "false")
buildConfigField("int", "VERSION_QA_CODE", versionQACode.toString())
}

qa {
dimension dimensionDefault
dimension "default"
buildConfigField("boolean", "IS_QA", "true")
buildConfigField("int", "VERSION_QA_CODE", versionQACode.toString())
}
Expand Down Expand Up @@ -92,14 +92,14 @@ android {
}

dependencies {
implementation "com.quickblox:quickblox-android-sdk-videochat-webrtc:$qbSdkVersion"
implementation "com.quickblox:quickblox-android-sdk-messages:$qbSdkVersion"
implementation "com.google.firebase:firebase-core:$firebaseCoreVersion"
implementation "com.google.android.material:material:$materialVersion"
implementation "com.github.johnkil.android-robototextview:robototextview:$robotoTextViewVersion"
implementation "androidx.fragment:fragment-ktx:$fragmentAndroidXVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleViewmodelAndroidXVersion"
implementation "androidx.core:core-ktx:$coreKtxVersion"
implementation 'com.quickblox:quickblox-android-sdk-videochat-webrtc:3.10.1'
implementation 'com.quickblox:quickblox-android-sdk-messages:3.10.1'
implementation 'com.google.firebase:firebase-core:21.1.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.github.johnkil.android-robototextview:robototextview:4.0.0'
implementation 'androidx.fragment:fragment-ktx:1.5.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'androidx.core:core-ktx:1.8.0'
}

apply from: "../artifacts.gradle"
Expand Down
5 changes: 4 additions & 1 deletion sample-videochat-kotlin/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@
-keep class org.webrtc.** { *; }

#google gms
-keep class com.google.android.gms.** { *; }
-keep class com.google.android.gms.** { *; }

#json
-keep class org.json.** { *; }
5 changes: 0 additions & 5 deletions sample-videochat-kotlin/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
android:name=".activities.LoginActivity"
android:screenOrientation="portrait" />

<activity
android:name=".activities.SettingsActivity"
android:configChanges="keyboardHidden|screenSize|orientation"
android:screenOrientation="portrait" />

<activity
android:name=".activities.OpponentsActivity"
android:screenOrientation="portrait" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import android.app.Application
import com.quickblox.auth.session.QBSettings
import com.quickblox.sample.videochat.kotlin.db.DbHelper

//User default credentials
// user default credentials
const val DEFAULT_USER_PASSWORD = "quickblox"

//App credentials
// app credentials
private const val APPLICATION_ID = ""
private const val AUTH_KEY = ""
private const val AUTH_SECRET = ""
Expand Down Expand Up @@ -42,7 +42,7 @@ class App : Application() {
QBSettings.getInstance().init(applicationContext, APPLICATION_ID, AUTH_KEY, AUTH_SECRET)
QBSettings.getInstance().accountKey = ACCOUNT_KEY

// Uncomment and put your Api and Chat servers endpoints if you want to point the sample
// uncomment and put your Api and Chat servers endpoints if you want to point the sample
// against your own server.
//
// QBSettings.getInstance().setEndpoints("https://your_api_endpoint.com", "your_chat_endpoint", ServiceZone.PRODUCTION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AppInfoActivity : AppCompatActivity() {
appQAVersionTextView.setText(spannable, TextView.BufferType.SPANNABLE)
appQAVersionTextView.visibility = View.VISIBLE

findViewById<View>(R.id.text_qa_version_title).visibility = View.VISIBLE
findViewById<TextView>(R.id.text_qa_version_title).visibility = View.VISIBLE
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,19 @@ import androidx.core.content.ContextCompat
import com.quickblox.sample.videochat.kotlin.R
import com.quickblox.sample.videochat.kotlin.utils.showErrorSnackbar


abstract class BaseActivity : AppCompatActivity() {
private var progressDialog: ProgressDialog? = null


internal fun showProgressDialog(@StringRes messageId: Int) {
if (progressDialog == null) {
progressDialog = ProgressDialog(this)
progressDialog!!.isIndeterminate = true
progressDialog!!.setCancelable(false)
progressDialog!!.setCanceledOnTouchOutside(false)

// Disable the back button
progressDialog!!.setOnKeyListener(KeyEventListener())
progressDialog?.isIndeterminate = true
progressDialog?.setCancelable(false)
progressDialog?.setCanceledOnTouchOutside(false)
progressDialog?.setOnKeyListener(KeyEventListener())
}
progressDialog!!.setMessage(getString(messageId))
progressDialog!!.show()
progressDialog?.setMessage(getString(messageId))
progressDialog?.show()
}

override fun onPause() {
Expand All @@ -36,16 +32,14 @@ abstract class BaseActivity : AppCompatActivity() {
}

internal fun hideProgressDialog() {
if (progressDialog != null && progressDialog?.isShowing == true) {
progressDialog!!.dismiss()
if (progressDialog?.isShowing == true) {
progressDialog?.dismiss()
}
}

protected fun showErrorSnackbar(@StringRes resId: Int, e: Exception, clickListener: View.OnClickListener) {
protected fun showErrorSnackbar(@StringRes resId: Int, e: Exception?, clickListener: View.OnClickListener) {
val rootView = window.decorView.findViewById<View>(android.R.id.content)
if (rootView != null) {
showErrorSnackbar(rootView, resId, e, R.string.dlg_retry, clickListener)
}
showErrorSnackbar(rootView, resId, e, R.string.dlg_retry, clickListener)
}

protected fun checkPermissions(permissions: Array<String>): Boolean {
Expand Down
Loading

0 comments on commit 24e82c3

Please sign in to comment.