mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
delete if-checks for view bindings
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
8250e3810a
commit
48cda08854
@ -986,7 +986,6 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
duration = 1000;
|
duration = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (binding.callControls != null) {
|
|
||||||
binding.callControls.setEnabled(false);
|
binding.callControls.setEnabled(false);
|
||||||
binding.callControls.animate()
|
binding.callControls.animate()
|
||||||
.translationY(0)
|
.translationY(0)
|
||||||
@ -997,7 +996,6 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
super.onAnimationEnd(animation);
|
super.onAnimationEnd(animation);
|
||||||
if (binding.callControls != null) {
|
|
||||||
if (!show) {
|
if (!show) {
|
||||||
binding.callControls.setVisibility(View.GONE);
|
binding.callControls.setVisibility(View.GONE);
|
||||||
if (spotlightView != null && spotlightView.getVisibility() != View.GONE) {
|
if (spotlightView != null && spotlightView.getVisibility() != View.GONE) {
|
||||||
@ -1016,11 +1014,8 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
|
|
||||||
binding.callControls.setEnabled(true);
|
binding.callControls.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if (binding.callInfosLinearLayout != null) {
|
|
||||||
binding.callInfosLinearLayout.setEnabled(false);
|
binding.callInfosLinearLayout.setEnabled(false);
|
||||||
binding.callInfosLinearLayout.animate()
|
binding.callInfosLinearLayout.animate()
|
||||||
.translationY(0)
|
.translationY(0)
|
||||||
@ -1031,7 +1026,6 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
super.onAnimationEnd(animation);
|
super.onAnimationEnd(animation);
|
||||||
if (binding.callInfosLinearLayout != null) {
|
|
||||||
if (!show) {
|
if (!show) {
|
||||||
binding.callInfosLinearLayout.setVisibility(View.GONE);
|
binding.callInfosLinearLayout.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
@ -1047,11 +1041,8 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
|
|
||||||
binding.callInfosLinearLayout.setEnabled(true);
|
binding.callInfosLinearLayout.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if (binding.switchSelfVideoButton != null) {
|
|
||||||
binding.switchSelfVideoButton.setEnabled(false);
|
binding.switchSelfVideoButton.setEnabled(false);
|
||||||
binding.switchSelfVideoButton.animate()
|
binding.switchSelfVideoButton.animate()
|
||||||
.translationY(0)
|
.translationY(0)
|
||||||
@ -1062,16 +1053,13 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
super.onAnimationEnd(animation);
|
super.onAnimationEnd(animation);
|
||||||
if (binding.switchSelfVideoButton != null) {
|
|
||||||
if (!show) {
|
if (!show) {
|
||||||
binding.switchSelfVideoButton.setVisibility(View.GONE);
|
binding.switchSelfVideoButton.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.switchSelfVideoButton.setEnabled(true);
|
binding.switchSelfVideoButton.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2225,7 +2213,6 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
handler.postDelayed(() -> setCallState(CallStatus.CALLING_TIMEOUT), 45000);
|
handler.postDelayed(() -> setCallState(CallStatus.CALLING_TIMEOUT), 45000);
|
||||||
handler.post(() -> {
|
handler.post(() -> {
|
||||||
binding.callModeTextView.setText(getDescriptionForCallType());
|
binding.callModeTextView.setText(getDescriptionForCallType());
|
||||||
if (binding.callStates.callStateRelativeLayout != null) {
|
|
||||||
if (isIncomingCallFromNotification) {
|
if (isIncomingCallFromNotification) {
|
||||||
binding.callStates.callStateTextView.setText(R.string.nc_call_incoming);
|
binding.callStates.callStateTextView.setText(R.string.nc_call_incoming);
|
||||||
} else {
|
} else {
|
||||||
@ -2234,25 +2221,18 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
if (binding.callStates.callStateRelativeLayout.getVisibility() != View.VISIBLE) {
|
if (binding.callStates.callStateRelativeLayout.getVisibility() != View.VISIBLE) {
|
||||||
binding.callStates.callStateRelativeLayout.setVisibility(View.VISIBLE);
|
binding.callStates.callStateRelativeLayout.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (binding.callStates.callStateProgressBar != null) {
|
|
||||||
if (binding.callStates.callStateProgressBar.getVisibility() != View.VISIBLE) {
|
if (binding.callStates.callStateProgressBar.getVisibility() != View.VISIBLE) {
|
||||||
binding.callStates.callStateProgressBar.setVisibility(View.VISIBLE);
|
binding.callStates.callStateProgressBar.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (binding.gridview != null) {
|
|
||||||
if (binding.gridview.getVisibility() != View.INVISIBLE) {
|
if (binding.gridview.getVisibility() != View.INVISIBLE) {
|
||||||
binding.gridview.setVisibility(View.INVISIBLE);
|
binding.gridview.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (binding.callStates.errorImageView != null) {
|
|
||||||
if (binding.callStates.errorImageView.getVisibility() != View.GONE) {
|
if (binding.callStates.errorImageView.getVisibility() != View.GONE) {
|
||||||
binding.callStates.errorImageView.setVisibility(View.GONE);
|
binding.callStates.errorImageView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case IN_CONVERSATION:
|
case IN_CONVERSATION:
|
||||||
@ -2268,62 +2248,46 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
animateCallControls(false, 5000);
|
animateCallControls(false, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (binding.callStates.callStateRelativeLayout != null) {
|
|
||||||
if (binding.callStates.callStateRelativeLayout.getVisibility() != View.INVISIBLE) {
|
if (binding.callStates.callStateRelativeLayout.getVisibility() != View.INVISIBLE) {
|
||||||
binding.callStates.callStateRelativeLayout.setVisibility(View.INVISIBLE);
|
binding.callStates.callStateRelativeLayout.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (binding.callStates.callStateProgressBar != null) {
|
|
||||||
if (binding.callStates.callStateProgressBar.getVisibility() != View.GONE) {
|
if (binding.callStates.callStateProgressBar.getVisibility() != View.GONE) {
|
||||||
binding.callStates.callStateProgressBar.setVisibility(View.GONE);
|
binding.callStates.callStateProgressBar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (binding.gridview != null) {
|
|
||||||
if (binding.gridview.getVisibility() != View.VISIBLE) {
|
if (binding.gridview.getVisibility() != View.VISIBLE) {
|
||||||
binding.gridview.setVisibility(View.VISIBLE);
|
binding.gridview.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (binding.callStates.errorImageView != null) {
|
|
||||||
if (binding.callStates.errorImageView.getVisibility() != View.GONE) {
|
if (binding.callStates.errorImageView.getVisibility() != View.GONE) {
|
||||||
binding.callStates.errorImageView.setVisibility(View.GONE);
|
binding.callStates.errorImageView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case OFFLINE:
|
case OFFLINE:
|
||||||
handler.post(() -> {
|
handler.post(() -> {
|
||||||
stopCallingSound();
|
stopCallingSound();
|
||||||
|
|
||||||
if (binding.callStates.callStateTextView != null) {
|
|
||||||
binding.callStates.callStateTextView.setText(R.string.nc_offline);
|
binding.callStates.callStateTextView.setText(R.string.nc_offline);
|
||||||
|
|
||||||
if (binding.callStates.callStateRelativeLayout.getVisibility() != View.VISIBLE) {
|
if (binding.callStates.callStateRelativeLayout.getVisibility() != View.VISIBLE) {
|
||||||
binding.callStates.callStateRelativeLayout.setVisibility(View.VISIBLE);
|
binding.callStates.callStateRelativeLayout.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (binding.gridview != null) {
|
|
||||||
if (binding.gridview.getVisibility() != View.INVISIBLE) {
|
if (binding.gridview.getVisibility() != View.INVISIBLE) {
|
||||||
binding.gridview.setVisibility(View.INVISIBLE);
|
binding.gridview.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (binding.callStates.callStateProgressBar != null) {
|
|
||||||
if (binding.callStates.callStateProgressBar.getVisibility() != View.GONE) {
|
if (binding.callStates.callStateProgressBar.getVisibility() != View.GONE) {
|
||||||
binding.callStates.callStateProgressBar.setVisibility(View.GONE);
|
binding.callStates.callStateProgressBar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (binding.callStates.errorImageView != null) {
|
|
||||||
binding.callStates.errorImageView.setImageResource(R.drawable.ic_signal_wifi_off_white_24dp);
|
binding.callStates.errorImageView.setImageResource(R.drawable.ic_signal_wifi_off_white_24dp);
|
||||||
if (binding.callStates.errorImageView.getVisibility() != View.VISIBLE) {
|
if (binding.callStates.errorImageView.getVisibility() != View.VISIBLE) {
|
||||||
binding.callStates.errorImageView.setVisibility(View.VISIBLE);
|
binding.callStates.errorImageView.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case LEAVING:
|
case LEAVING:
|
||||||
|
Loading…
Reference in New Issue
Block a user