mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-25 22:45:41 +03:00
Prevent some crashes
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
e4af75a62b
commit
45e2bd505d
1 changed files with 53 additions and 27 deletions
|
@ -2082,22 +2082,30 @@ public class CallController extends BaseController {
|
|||
case ESTABLISHED:
|
||||
handler.postDelayed(() -> setCallState(CallStatus.CALLING_TIMEOUT), 45000);
|
||||
handler.post(() -> {
|
||||
if (connectingView != null) {
|
||||
connectingTextView.setText(R.string.nc_calling);
|
||||
if (connectingTextView.getVisibility() != View.VISIBLE) {
|
||||
connectingView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (progressBar != null) {
|
||||
if (progressBar.getVisibility() != View.VISIBLE) {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (conversationView != null) {
|
||||
if (conversationView.getVisibility() != View.INVISIBLE) {
|
||||
conversationView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (errorImageView != null) {
|
||||
if (errorImageView.getVisibility() != View.GONE) {
|
||||
errorImageView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
case IN_CONVERSATION:
|
||||
|
@ -2108,44 +2116,62 @@ public class CallController extends BaseController {
|
|||
animateCallControls(false, 5000);
|
||||
}
|
||||
|
||||
if (connectingView != null) {
|
||||
if (connectingView.getVisibility() != View.INVISIBLE) {
|
||||
connectingView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (progressBar != null) {
|
||||
if (progressBar.getVisibility() != View.GONE) {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
if (conversationView != null) {
|
||||
if (conversationView.getVisibility() != View.VISIBLE) {
|
||||
conversationView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (errorImageView != null) {
|
||||
if (errorImageView.getVisibility() != View.GONE) {
|
||||
errorImageView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
case OFFLINE:
|
||||
handler.post(() -> {
|
||||
stopCallingSound();
|
||||
|
||||
if (connectingTextView != null) {
|
||||
connectingTextView.setText(R.string.nc_offline);
|
||||
|
||||
if (connectingView.getVisibility() != View.VISIBLE) {
|
||||
connectingView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (conversationView != null) {
|
||||
if (conversationView.getVisibility() != View.INVISIBLE) {
|
||||
conversationView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (progressBar != null) {
|
||||
if (progressBar.getVisibility() != View.GONE) {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
if (errorImageView != null) {
|
||||
errorImageView.setImageResource(R.drawable.ic_signal_wifi_off_white_24dp);
|
||||
if (errorImageView.getVisibility() != View.VISIBLE) {
|
||||
errorImageView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
case LEAVING:
|
||||
|
|
Loading…
Reference in a new issue