mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01:00
parent
754cdf7fd5
commit
2664528660
@ -225,7 +225,8 @@ public class CallController extends BaseController {
|
|||||||
|
|
||||||
private boolean isVoiceOnlyCall;
|
private boolean isVoiceOnlyCall;
|
||||||
private boolean isFromNotification;
|
private boolean isFromNotification;
|
||||||
private Handler handler = new Handler();
|
private Handler callControlHandler = new Handler();
|
||||||
|
private Handler cameraSwitchHandler = new Handler();
|
||||||
|
|
||||||
private boolean isPTTActive = false;
|
private boolean isPTTActive = false;
|
||||||
private PulseAnimation pulseAnimation;
|
private PulseAnimation pulseAnimation;
|
||||||
@ -587,9 +588,11 @@ public class CallController extends BaseController {
|
|||||||
@OnLongClick(R.id.call_control_microphone)
|
@OnLongClick(R.id.call_control_microphone)
|
||||||
public boolean onMicrophoneLongClick() {
|
public boolean onMicrophoneLongClick() {
|
||||||
if (!audioOn) {
|
if (!audioOn) {
|
||||||
handler.removeCallbacksAndMessages(null);
|
callControlHandler.removeCallbacksAndMessages(null);
|
||||||
|
cameraSwitchHandler.removeCallbacksAndMessages(null);
|
||||||
isPTTActive = true;
|
isPTTActive = true;
|
||||||
callControls.setVisibility(View.VISIBLE);
|
callControls.setVisibility(View.VISIBLE);
|
||||||
|
cameraSwitchButton.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
onMicrophoneClick();
|
onMicrophoneClick();
|
||||||
@ -791,20 +794,18 @@ public class CallController extends BaseController {
|
|||||||
long duration;
|
long duration;
|
||||||
|
|
||||||
if (show) {
|
if (show) {
|
||||||
handler.removeCallbacksAndMessages(null);
|
callControlHandler.removeCallbacksAndMessages(null);
|
||||||
|
cameraSwitchHandler.removeCallbacksAndMessages(null);
|
||||||
alpha = 1.0f;
|
alpha = 1.0f;
|
||||||
duration = 1000;
|
duration = 1000;
|
||||||
if (callControls.getVisibility() != View.VISIBLE) {
|
if (callControls.getVisibility() != View.VISIBLE) {
|
||||||
callControls.setAlpha(0.0f);
|
callControls.setAlpha(0.0f);
|
||||||
callControls.setVisibility(View.VISIBLE);
|
callControls.setVisibility(View.VISIBLE);
|
||||||
} else {
|
|
||||||
handler.postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
animateCallControls(false, 0);
|
|
||||||
|
|
||||||
}
|
cameraSwitchButton.setAlpha(0.0f);
|
||||||
}, 5000);
|
cameraSwitchButton.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
callControlHandler.postDelayed(() -> animateCallControls(false, 0), 5000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -830,7 +831,7 @@ public class CallController extends BaseController {
|
|||||||
spotlightView.setVisibility(View.GONE);
|
spotlightView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
handler.postDelayed(new Runnable() {
|
callControlHandler.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!isPTTActive) {
|
if (!isPTTActive) {
|
||||||
@ -845,6 +846,29 @@ public class CallController extends BaseController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cameraSwitchButton != null) {
|
||||||
|
cameraSwitchButton.setEnabled(false);
|
||||||
|
cameraSwitchButton.animate()
|
||||||
|
.translationY(0)
|
||||||
|
.alpha(alpha)
|
||||||
|
.setDuration(duration)
|
||||||
|
.setStartDelay(startDelay)
|
||||||
|
.setListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
super.onAnimationEnd(animation);
|
||||||
|
if (cameraSwitchButton != null) {
|
||||||
|
if (!show) {
|
||||||
|
cameraSwitchButton.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
cameraSwitchButton.setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,14 +74,33 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<org.webrtc.SurfaceViewRenderer
|
<FrameLayout
|
||||||
android:id="@+id/pip_video_view"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="120dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="120dp"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_margin="16dp"
|
android:layout_alignParentEnd="true">
|
||||||
android:visibility="invisible"/>
|
|
||||||
|
<org.webrtc.SurfaceViewRenderer
|
||||||
|
android:id="@+id/pip_video_view"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_margin="16dp"
|
||||||
|
android:visibility="invisible"/>
|
||||||
|
|
||||||
|
<com.nextcloud.talk.utils.MagicFlipView
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/call_control_switch_camera"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
|
|
||||||
|
app:checked="false"
|
||||||
|
app:enableInitialAnimation="false"
|
||||||
|
app:frontBackgroundColor="@color/colorPrimary"
|
||||||
|
app:frontImage="@drawable/ic_switch_video_white_24px"/>
|
||||||
|
</FrameLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -109,44 +128,31 @@
|
|||||||
|
|
||||||
<com.nextcloud.talk.utils.MagicFlipView
|
<com.nextcloud.talk.utils.MagicFlipView
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/call_control_camera"
|
android:id="@+id/callControlHangupView"
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
|
app:checked="false"
|
||||||
|
app:enableInitialAnimation="false"
|
||||||
|
app:frontBackgroundColor="@color/nc_darkRed"
|
||||||
|
app:frontImage="@drawable/ic_call_end_white_24px"/>
|
||||||
|
|
||||||
|
<com.nextcloud.talk.utils.MagicFlipView
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/call_control_camera"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
android:alpha="0.7"
|
android:alpha="0.7"
|
||||||
app:checked="false"
|
app:checked="false"
|
||||||
app:enableInitialAnimation="false"
|
app:enableInitialAnimation="false"
|
||||||
app:frontBackgroundColor="@color/colorPrimary"
|
app:frontBackgroundColor="@color/colorPrimary"
|
||||||
app:frontImage="@drawable/ic_videocam_off_white_24px"/>
|
app:frontImage="@drawable/ic_videocam_off_white_24px"/>
|
||||||
|
|
||||||
<com.nextcloud.talk.utils.MagicFlipView
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/call_control_switch_camera"
|
|
||||||
android:layout_width="60dp"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_marginEnd="20dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:checked="false"
|
|
||||||
app:enableInitialAnimation="false"
|
|
||||||
app:frontBackgroundColor="@color/colorPrimary"
|
|
||||||
app:frontImage="@drawable/ic_switch_video_white_24px"/>
|
|
||||||
|
|
||||||
<com.nextcloud.talk.utils.MagicFlipView
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/callControlHangupView"
|
|
||||||
android:layout_width="60dp"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
app:checked="false"
|
|
||||||
app:enableInitialAnimation="false"
|
|
||||||
app:frontBackgroundColor="@color/nc_darkRed"
|
|
||||||
app:frontImage="@drawable/ic_call_end_white_24px"/>
|
|
||||||
|
|
||||||
<com.nextcloud.talk.utils.MagicFlipView
|
<com.nextcloud.talk.utils.MagicFlipView
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/callControlEnableSpeaker"
|
android:id="@+id/callControlEnableSpeaker"
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_marginStart="20dp"
|
|
||||||
app:checked="false"
|
app:checked="false"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:enableInitialAnimation="false"
|
app:enableInitialAnimation="false"
|
||||||
|
@ -88,6 +88,16 @@
|
|||||||
app:frontBackgroundColor="@color/colorPrimary"
|
app:frontBackgroundColor="@color/colorPrimary"
|
||||||
app:frontImage="@drawable/ic_mic_white_24px"/>
|
app:frontImage="@drawable/ic_mic_white_24px"/>
|
||||||
|
|
||||||
|
<com.nextcloud.talk.utils.MagicFlipView
|
||||||
|
android:id="@+id/callControlHangupView"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_margin="24dp"
|
||||||
|
app:checked="false"
|
||||||
|
app:enableInitialAnimation="false"
|
||||||
|
app:frontBackgroundColor="@color/nc_darkRed"
|
||||||
|
app:frontImage="@drawable/ic_call_end_white_24px"/>
|
||||||
|
|
||||||
<com.nextcloud.talk.utils.MagicFlipView
|
<com.nextcloud.talk.utils.MagicFlipView
|
||||||
android:id="@+id/callAnswerCameraView"
|
android:id="@+id/callAnswerCameraView"
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
@ -98,16 +108,6 @@
|
|||||||
app:enableInitialAnimation="false"
|
app:enableInitialAnimation="false"
|
||||||
app:frontBackgroundColor="@color/colorPrimary"
|
app:frontBackgroundColor="@color/colorPrimary"
|
||||||
app:frontImage="@drawable/ic_videocam_white_24px"/>
|
app:frontImage="@drawable/ic_videocam_white_24px"/>
|
||||||
|
|
||||||
<com.nextcloud.talk.utils.MagicFlipView
|
|
||||||
android:id="@+id/callControlHangupView"
|
|
||||||
android:layout_width="60dp"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_margin="24dp"
|
|
||||||
app:checked="false"
|
|
||||||
app:enableInitialAnimation="false"
|
|
||||||
app:frontBackgroundColor="@color/nc_darkRed"
|
|
||||||
app:frontImage="@drawable/ic_call_end_white_24px"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user