Update visibility and icon of camera flip control in call.

Fixes #8221
This commit is contained in:
Alan Evans 2019-05-20 12:19:15 -03:00
parent c0c051bb66
commit 16c8cc88d7

View File

@ -91,8 +91,7 @@ public class WebRtcCallControls extends LinearLayout {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
listener.onToggle();
cameraFlipButton.setBackgroundResource(isChecked ? R.drawable.webrtc_camera_front_button
: R.drawable.webrtc_camera_rear_button);
updateCameraFlipIcon(isChecked);
cameraFlipButton.setEnabled(false);
}
});
@ -153,10 +152,17 @@ public class WebRtcCallControls extends LinearLayout {
public void setCameraFlipButtonEnabled(boolean enabled) {
cameraFlipButton.setChecked(enabled, false);
updateCameraFlipIcon(cameraFlipButton.isChecked());
}
private void updateCameraFlipIcon(boolean isChecked) {
cameraFlipButton.setBackgroundResource(isChecked ? R.drawable.webrtc_camera_front_button
: R.drawable.webrtc_camera_rear_button);
}
public void setCameraFlipAvailable(boolean available) {
cameraFlipAvailable = available;
cameraFlipButton.setVisibility(cameraFlipAvailable && isVideoEnabled() ? View.VISIBLE : View.GONE);
}
public void setCameraFlipClickable(boolean clickable) {