Skip to content

Commit

Permalink
release v3.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristiyan Petrov committed Apr 12, 2024
1 parent 01005ce commit 4fafb8d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
apply from: 'versions.gradle'
apply from: '../scripts/apply_dependencies.gradle'

def bandyerLibVersion = "3.9.1"
def bandyerLibVersion = "3.9.2"

android {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
import android.view.MenuInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;

import androidx.appcompat.widget.SearchView;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.bandyer.android_sdk.client.BandyerSDK;
import com.bandyer.demo_android_sdk.databinding.ActivityLoginBinding;
import com.bandyer.demo_android_sdk.ui.activities.CollapsingToolbarActivity;
import com.bandyer.demo_android_sdk.ui.adapter_items.UserItem;
Expand Down Expand Up @@ -92,6 +94,11 @@ protected void onCreate(Bundle savedInstanceState) {
fastAdapter.setOnPreClickListener(new Function4<View, IAdapter<UserItem>, UserItem, Integer, Boolean>() {
@Override
public Boolean invoke(View view, IAdapter<UserItem> userItemIAdapter, UserItem userItem, Integer integer) {
if (BandyerSDK.getInstance().getCallModule() != null && BandyerSDK.getInstance().getCallModule().isInCall()) {
Toast.makeText(LoginActivity.this, R.string.you_cannot_login_while_already_in_call, Toast.LENGTH_LONG).show();
return false;
}

userAlias = userItem.userAlias;
if (!LoginManager.isUserLogged(LoginActivity.this))
LoginManager.login(LoginActivity.this, userAlias);
Expand Down
22 changes: 10 additions & 12 deletions app/src/main/java/com/bandyer/demo_android_sdk/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
// get the user that is currently logged in the sample app
String userAlias = LoginManager.getLoggedUser(this);

if (BandyerSDK.getInstance().getCallModule() != null && BandyerSDK.getInstance().getCallModule().isInCall()) {
wasAlreadyInCall = true;
finish();
return;
}

// customize toolbar
setCollapsingToolbarTitle(String.format(getResources().getString(R.string.pick_users), userAlias), userAlias);

Expand Down Expand Up @@ -322,6 +316,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
startBandyerSDK();
}

private Boolean checkIsInCall() {
wasAlreadyInCall = BandyerSDK.getInstance().getCallModule() != null
&& BandyerSDK.getInstance().getCallModule().isInCall();
return wasAlreadyInCall;
}

@Override
protected void onPause() {
super.onPause();
Expand Down Expand Up @@ -425,7 +425,8 @@ private void removeObservers() {
callModule.removeCallObserver(callObserver);
callModule.removeCallUIObserver(callObserver);
Call ongoingCall = callModule.getOngoingCall();
if (ongoingCall != null) callModule.getOngoingCall().removeCallRecordingObserver(callObserver);
if (ongoingCall != null)
callModule.getOngoingCall().removeCallRecordingObserver(callObserver);
}

ChatModule chatModule = BandyerSDK.getInstance().getChatModule();
Expand Down Expand Up @@ -490,11 +491,8 @@ private void handleMissedCall(Intent intent) {
public void onDestroy() {
super.onDestroy();
removeObservers();
if (wasAlreadyInCall) {
LoginManager.logout(MainActivity.this);
return;
}
if (isHandlingAccessLink || !LoginManager.isUserLogged(this)) return;
boolean isInCall = checkIsInCall();
if (isInCall || isHandlingAccessLink || !LoginManager.isUserLogged(this)) return;
BandyerSDK.getInstance().disconnect();
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@
<string name="missed_call" translatable="false">Missed call</string>
<string name="callback" translatable="false">Call back</string>
<string name="chatback" translatable="false">Chat</string>
<string name="you_cannot_login_while_already_in_call" translatable="false">You cannot login while already in call.</string>

</resources>
4 changes: 2 additions & 2 deletions app/version.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#Tue, 09 Apr 2024 13:07:24 +0000
#Fri, 12 Apr 2024 14:37:45 +0000
#
# Copyright (C) 2020 Bandyer S.r.l. All Rights Reserved.
# See LICENSE.txt for licensing information
#

#Thu, 08 Oct 2020 18:57:34 +0200
VERSION_CODE=177
VERSION_CODE=178

0 comments on commit 4fafb8d

Please sign in to comment.