diff --git a/res/drawable/webrtc_camera_flip_button.xml b/res/drawable/webrtc_camera_flip_button.xml
new file mode 100644
index 0000000000..9e9447f382
--- /dev/null
+++ b/res/drawable/webrtc_camera_flip_button.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/res/layout/webrtc_answer_decline_button.xml b/res/layout/webrtc_answer_decline_button.xml
index de80ede2b3..470b2906f1 100644
--- a/res/layout/webrtc_answer_decline_button.xml
+++ b/res/layout/webrtc_answer_decline_button.xml
@@ -1,87 +1,99 @@
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:clipToPadding="false"
+ tools:background="#7f000000"
+ tools:orientation="vertical"
+ tools:parentTag="android.widget.LinearLayout">
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
\ No newline at end of file
diff --git a/res/layout/webrtc_answer_decline_button_accessible.xml b/res/layout/webrtc_answer_decline_button_accessible.xml
new file mode 100644
index 0000000000..77a5862a0f
--- /dev/null
+++ b/res/layout/webrtc_answer_decline_button_accessible.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/webrtc_call_activity.xml b/res/layout/webrtc_call_activity.xml
index 6611afd961..e0ea58bd81 100644
--- a/res/layout/webrtc_call_activity.xml
+++ b/res/layout/webrtc_call_activity.xml
@@ -1,12 +1,5 @@
-
-
-
-
-
-
-
+
diff --git a/res/layout/webrtc_call_controls.xml b/res/layout/webrtc_call_controls.xml
index 410f488ce6..763ab58934 100644
--- a/res/layout/webrtc_call_controls.xml
+++ b/res/layout/webrtc_call_controls.xml
@@ -1,47 +1,63 @@
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/inCallControls"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ tools:background="@color/textsecure_primary"
+ tools:showIn="@layout/webrtc_call_screen">
-
+
-
+
-
+
-
+
-
+
diff --git a/res/layout/webrtc_call_screen.xml b/res/layout/webrtc_call_screen.xml
index 816f04e76d..3ed67b46c2 100644
--- a/res/layout/webrtc_call_screen.xml
+++ b/res/layout/webrtc_call_screen.xml
@@ -1,5 +1,4 @@
-
-
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/incall_screen"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ android:id="@+id/remote_render_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:visibility="invisible" />
-
+
-
+
-
+
-
+
-
+
+
+
@@ -97,103 +101,98 @@
including the contact name, phone number, call time counter,
and other status info. This info is shown as a "banner"
overlaid across the top of contact photo. -->
-
-
-
+
+
-
+
-
-
-
+
+
+
+
+
-
+
+ android:id="@+id/inCallControls"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@color/textsecure_primary"
+ android:paddingStart="24dp"
+ android:paddingTop="16dp"
+ android:paddingEnd="24dp"
+ android:paddingBottom="20dp" />
-
+
@@ -207,30 +206,27 @@
+ android:id="@+id/local_render_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:visibility="invisible" />
-
+ android:id="@+id/hangup_fab"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom|center_horizontal"
+ android:layout_marginBottom="40dp"
+ android:contentDescription="@string/WebRtcCallScreen_end_call"
+ android:focusable="true"
+ android:src="@drawable/ic_call_end_white_48dp"
+ app:backgroundTint="@color/red_500" />
+ android:id="@+id/answer_decline_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom|center"
+ android:layout_marginBottom="16dp" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index adbf618deb..3fac2da987 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -884,6 +884,17 @@
Tap to enable your video
+
+ Contact photo
+ Speaker
+ Bluetooth
+ Mute
+ Your camera
+ Switch to rear camera
+
+ Answer call
+ Reject call
+
Audio
Audio
@@ -1149,8 +1160,6 @@
Signal Call
- Mute
- Switch Cameras
PHONE NUMBER
diff --git a/res/values/styles.xml b/res/values/styles.xml
index f03e2577a8..4321352efa 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -111,7 +111,7 @@
- 0.0
- 1.25
-
+
-
+
-
+
@@ -235,4 +235,21 @@
- @color/white
+
+
+
+
+
+
+
+
diff --git a/src/org/thoughtcrime/securesms/components/webrtc/WebRtcAnswerDeclineButton.java b/src/org/thoughtcrime/securesms/components/webrtc/WebRtcAnswerDeclineButton.java
index 0505ba425a..a4d09decf8 100644
--- a/src/org/thoughtcrime/securesms/components/webrtc/WebRtcAnswerDeclineButton.java
+++ b/src/org/thoughtcrime/securesms/components/webrtc/WebRtcAnswerDeclineButton.java
@@ -1,6 +1,5 @@
package org.thoughtcrime.securesms.components.webrtc;
-
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ArgbEvaluator;
@@ -8,25 +7,29 @@ import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityManager;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
import org.thoughtcrime.securesms.R;
+import org.thoughtcrime.securesms.logging.Log;
+import org.thoughtcrime.securesms.util.ServiceUtil;
import org.thoughtcrime.securesms.util.ViewUtil;
-public class WebRtcAnswerDeclineButton extends LinearLayout implements View.OnTouchListener {
+public final class WebRtcAnswerDeclineButton extends LinearLayout {
@SuppressWarnings("unused")
- private static final String TAG = WebRtcAnswerDeclineButton.class.getSimpleName();
+ private static final String TAG = Log.tag(WebRtcAnswerDeclineButton.class);
private static final int TOTAL_TIME = 1000;
private static final int SHAKE_TIME = 200;
@@ -40,22 +43,8 @@ public class WebRtcAnswerDeclineButton extends LinearLayout implements View.OnTo
private static final int ANSWER_THRESHOLD = 112;
private static final int DECLINE_THRESHOLD = 56;
- private TextView swipeUpText;
- private ImageView fab;
- private TextView swipeDownText;
-
- private ImageView arrowOne;
- private ImageView arrowTwo;
- private ImageView arrowThree;
- private ImageView arrowFour;
-
- private float lastY;
-
- private boolean animating = false;
- private boolean complete = false;
-
- private AnimatorSet animatorSet;
- private AnswerDeclineListener listener;
+ private AnswerDeclineListener listener;
+ @Nullable private DragToAnswer dragToAnswerListener;
public WebRtcAnswerDeclineButton(Context context) {
super(context);
@@ -72,41 +61,27 @@ public class WebRtcAnswerDeclineButton extends LinearLayout implements View.OnTo
initialize();
}
- @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
- public WebRtcAnswerDeclineButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
- super(context, attrs, defStyleAttr, defStyleRes);
- initialize();
- }
-
private void initialize() {
setOrientation(LinearLayout.VERTICAL);
setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
- inflate(getContext(), R.layout.webrtc_answer_decline_button, this);
+ AccessibilityManager accessibilityManager = ServiceUtil.getAccessibilityManager(getContext());
+ boolean isExploreByTouchEnabled = accessibilityManager.isTouchExplorationEnabled();
- this.swipeUpText = findViewById(R.id.swipe_up_text);
- this.fab = findViewById(R.id.answer);
- this.swipeDownText = findViewById(R.id.swipe_down_text);
+ if (isExploreByTouchEnabled) {
+ inflate(getContext(), R.layout.webrtc_answer_decline_button_accessible, this);
- this.arrowOne = findViewById(R.id.arrow_one);
- this.arrowTwo = findViewById(R.id.arrow_two);
- this.arrowThree = findViewById(R.id.arrow_three);
- this.arrowFour = findViewById(R.id.arrow_four);
+ findViewById(R.id.answer).setOnClickListener((view) -> listener.onAnswered());
+ findViewById(R.id.reject).setOnClickListener((view) -> listener.onDeclined());
- this.fab.setOnTouchListener(this);
- }
+ } else {
+ inflate(getContext(), R.layout.webrtc_answer_decline_button, this);
- public void startRingingAnimation() {
- if (!animating) {
- animating = true;
- animateElements(0);
- }
- }
+ ImageView answer = findViewById(R.id.answer);
- public void stopRingingAnimation() {
- if (animating) {
- animating = false;
- resetElements();
+ dragToAnswerListener = new DragToAnswer(answer, this);
+
+ answer.setOnTouchListener(dragToAnswerListener);
}
}
@@ -114,132 +89,199 @@ public class WebRtcAnswerDeclineButton extends LinearLayout implements View.OnTo
this.listener = listener;
}
- @Override
- public boolean onTouch(View v, MotionEvent event) {
+ public void startRingingAnimation() {
+ if (dragToAnswerListener != null) {
+ dragToAnswerListener.startRingingAnimation();
+ }
+ }
- switch (event.getAction()) {
- case MotionEvent.ACTION_DOWN:
- resetElements();
- swipeUpText.animate().alpha(0).setDuration(200).start();
- swipeDownText.animate().alpha(0).setDuration(200).start();
- lastY = event.getRawY();
- break;
- case MotionEvent.ACTION_CANCEL:
- case MotionEvent.ACTION_UP:
- swipeUpText.clearAnimation();
- swipeDownText.clearAnimation();
- swipeUpText.setAlpha(1);
- swipeDownText.setAlpha(1);
- fab.setRotation(0);
+ public void stopRingingAnimation() {
+ if (dragToAnswerListener != null) {
+ dragToAnswerListener.stopRingingAnimation();
+ }
+ }
- if (Build.VERSION.SDK_INT >= 21) {
- fab.getDrawable().setTint(getResources().getColor(R.color.green_600));
- fab.getBackground().setTint(Color.WHITE);
- }
+ private class DragToAnswer implements View.OnTouchListener {
- animating = true;
- animateElements(0);
- break;
- case MotionEvent.ACTION_MOVE:
- float difference = event.getRawY() - lastY;
+ private final TextView swipeUpText;
+ private final ImageView answer;
+ private final TextView swipeDownText;
- float differenceThreshold;
- float percentageToThreshold;
- int backgroundColor;
- int foregroundColor;
+ private final ImageView arrowOne;
+ private final ImageView arrowTwo;
+ private final ImageView arrowThree;
+ private final ImageView arrowFour;
- if (difference <= 0) {
- differenceThreshold = ViewUtil.dpToPx(getContext(), ANSWER_THRESHOLD);
- percentageToThreshold = Math.min(1, (difference * -1) / differenceThreshold);
- backgroundColor = (int) new ArgbEvaluator().evaluate(percentageToThreshold, getResources().getColor(R.color.green_100), getResources().getColor(R.color.green_600));
+ private float lastY;
- if (percentageToThreshold > 0.5) {
- foregroundColor = Color.WHITE;
- } else {
- foregroundColor = getResources().getColor(R.color.green_600);
- }
+ private boolean animating = false;
+ private boolean complete = false;
- fab.setTranslationY(difference);
+ private AnimatorSet animatorSet;
- if (percentageToThreshold == 1 && listener != null) {
- fab.setVisibility(View.INVISIBLE);
- lastY = event.getRawY();
- if (!complete) {
- complete = true;
- listener.onAnswered();
- }
- }
- } else {
- differenceThreshold = ViewUtil.dpToPx(getContext(), DECLINE_THRESHOLD);
- percentageToThreshold = Math.min(1, difference / differenceThreshold);
- backgroundColor = (int) new ArgbEvaluator().evaluate(percentageToThreshold, getResources().getColor(R.color.red_100), getResources().getColor(R.color.red_600));
+ private DragToAnswer(@NonNull ImageView answer, WebRtcAnswerDeclineButton view) {
+ this.swipeUpText = view.findViewById(R.id.swipe_up_text);
+ this.answer = answer;
+ this.swipeDownText = view.findViewById(R.id.swipe_down_text);
- if (percentageToThreshold > 0.5) {
- foregroundColor = Color.WHITE;
- } else {
- foregroundColor = getResources().getColor(R.color.green_600);
- }
-
- fab.setRotation(135 * percentageToThreshold);
-
- if (percentageToThreshold == 1 && listener != null) {
- fab.setVisibility(View.INVISIBLE);
- lastY = event.getRawY();
-
- if (!complete) {
- complete = true;
- listener.onDeclined();
- }
- }
- }
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- fab.getBackground().setTint(backgroundColor);
- fab.getDrawable().setTint(foregroundColor);
- }
-
- break;
+ this.arrowOne = view.findViewById(R.id.arrow_one);
+ this.arrowTwo = view.findViewById(R.id.arrow_two);
+ this.arrowThree = view.findViewById(R.id.arrow_three);
+ this.arrowFour = view.findViewById(R.id.arrow_four);
}
- return true;
- }
+ private void startRingingAnimation() {
+ if (!animating) {
+ animating = true;
+ animateElements(0);
+ }
+ }
- private void animateElements(int delay) {
- ObjectAnimator fabUp = getUpAnimation(fab);
- ObjectAnimator fabDown = getDownAnimation(fab);
- ObjectAnimator fabShake = getShakeAnimation(fab);
+ private void stopRingingAnimation() {
+ if (animating) {
+ animating = false;
+ resetElements();
+ }
+ }
- animatorSet = new AnimatorSet();
- animatorSet.play(fabUp).with(getUpAnimation(swipeUpText));
- animatorSet.play(fabShake).after(fabUp);
- animatorSet.play(fabDown).with(getDownAnimation(swipeUpText)).after(fabShake);
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
- animatorSet.play(getFadeOut(swipeDownText)).with(fabUp);
- animatorSet.play(getFadeIn(swipeDownText)).after(fabDown);
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ resetElements();
+ swipeUpText.animate().alpha(0).setDuration(200).start();
+ swipeDownText.animate().alpha(0).setDuration(200).start();
+ lastY = event.getRawY();
+ break;
+ case MotionEvent.ACTION_CANCEL:
+ case MotionEvent.ACTION_UP:
+ swipeUpText.clearAnimation();
+ swipeDownText.clearAnimation();
+ swipeUpText.setAlpha(1);
+ swipeDownText.setAlpha(1);
+ answer.setRotation(0);
- animatorSet.play(getShimmer(arrowFour, arrowThree, arrowTwo, arrowOne));
+ if (Build.VERSION.SDK_INT >= 21) {
+ answer.getDrawable().setTint(getResources().getColor(R.color.green_600));
+ answer.getBackground().setTint(Color.WHITE);
+ }
- animatorSet.addListener(new Animator.AnimatorListener() {
- @Override
- public void onAnimationStart(Animator animation) {
+ animating = true;
+ animateElements(0);
+ break;
+ case MotionEvent.ACTION_MOVE:
+ float difference = event.getRawY() - lastY;
+
+ float differenceThreshold;
+ float percentageToThreshold;
+ int backgroundColor;
+ int foregroundColor;
+
+ if (difference <= 0) {
+ differenceThreshold = ViewUtil.dpToPx(getContext(), ANSWER_THRESHOLD);
+ percentageToThreshold = Math.min(1, (difference * -1) / differenceThreshold);
+ backgroundColor = (int) new ArgbEvaluator().evaluate(percentageToThreshold, getResources().getColor(R.color.green_100), getResources().getColor(R.color.green_600));
+
+ if (percentageToThreshold > 0.5) {
+ foregroundColor = Color.WHITE;
+ } else {
+ foregroundColor = getResources().getColor(R.color.green_600);
+ }
+
+ answer.setTranslationY(difference);
+
+ if (percentageToThreshold == 1 && listener != null) {
+ answer.setVisibility(View.INVISIBLE);
+ lastY = event.getRawY();
+ if (!complete) {
+ complete = true;
+ listener.onAnswered();
+ }
+ }
+ } else {
+ differenceThreshold = ViewUtil.dpToPx(getContext(), DECLINE_THRESHOLD);
+ percentageToThreshold = Math.min(1, difference / differenceThreshold);
+ backgroundColor = (int) new ArgbEvaluator().evaluate(percentageToThreshold, getResources().getColor(R.color.red_100), getResources().getColor(R.color.red_600));
+
+ if (percentageToThreshold > 0.5) {
+ foregroundColor = Color.WHITE;
+ } else {
+ foregroundColor = getResources().getColor(R.color.green_600);
+ }
+
+ answer.setRotation(135 * percentageToThreshold);
+
+ if (percentageToThreshold == 1 && listener != null) {
+ answer.setVisibility(View.INVISIBLE);
+ lastY = event.getRawY();
+
+ if (!complete) {
+ complete = true;
+ listener.onDeclined();
+ }
+ }
+ }
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ answer.getBackground().setTint(backgroundColor);
+ answer.getDrawable().setTint(foregroundColor);
+ }
+
+ break;
}
- @Override
- public void onAnimationEnd(Animator animation) {
- if (animating) animateElements(1000);
- }
+ return true;
+ }
- @Override
- public void onAnimationCancel(Animator animation) {}
- @Override
- public void onAnimationRepeat(Animator animation) {}
- });
+ private void animateElements(int delay) {
+ ObjectAnimator fabUp = getUpAnimation(answer);
+ ObjectAnimator fabDown = getDownAnimation(answer);
+ ObjectAnimator fabShake = getShakeAnimation(answer);
- animatorSet.setStartDelay(delay);
- animatorSet.start();
+ animatorSet = new AnimatorSet();
+ animatorSet.play(fabUp).with(getUpAnimation(swipeUpText));
+ animatorSet.play(fabShake).after(fabUp);
+ animatorSet.play(fabDown).with(getDownAnimation(swipeUpText)).after(fabShake);
+
+ animatorSet.play(getFadeOut(swipeDownText)).with(fabUp);
+ animatorSet.play(getFadeIn(swipeDownText)).after(fabDown);
+
+ animatorSet.play(getShimmer(arrowFour, arrowThree, arrowTwo, arrowOne));
+
+ animatorSet.addListener(new Animator.AnimatorListener() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ }
+
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ if (animating) animateElements(1000);
+ }
+
+ @Override
+ public void onAnimationCancel(Animator animation) {}
+ @Override
+ public void onAnimationRepeat(Animator animation) {}
+ });
+
+ animatorSet.setStartDelay(delay);
+ animatorSet.start();
+ }
+
+ private void resetElements() {
+ animating = false;
+ complete = false;
+
+ if (animatorSet != null) animatorSet.cancel();
+
+ swipeUpText.setTranslationY(0);
+ answer.setTranslationY(0);
+ swipeDownText.setAlpha(1);
+ }
}
- private Animator getShimmer(View... targets) {
+ private static Animator getShimmer(View... targets) {
AnimatorSet animatorSet = new AnimatorSet();
int evenDuration = SHIMMER_TOTAL / targets.length;
int interval = 75;
@@ -252,29 +294,29 @@ public class WebRtcAnswerDeclineButton extends LinearLayout implements View.OnTo
return animatorSet;
}
- private ObjectAnimator getShimmer(View target, int duration) {
+ private static ObjectAnimator getShimmer(View target, int duration) {
ObjectAnimator shimmer = ObjectAnimator.ofFloat(target, "alpha", 0, 1, 0);
shimmer.setDuration(duration);
return shimmer;
}
- private ObjectAnimator getShakeAnimation(View target) {
+ private static ObjectAnimator getShakeAnimation(View target) {
ObjectAnimator animator = ObjectAnimator.ofFloat(target, "translationX", 0, 25, -25, 25, -25,15, -15, 6, -6, 0);
animator.setDuration(SHAKE_TIME);
return animator;
}
- private ObjectAnimator getUpAnimation(View target) {
- ObjectAnimator animator = ObjectAnimator.ofFloat(target, "translationY", 0, -1 * ViewUtil.dpToPx(getContext(), 32));
+ private static ObjectAnimator getUpAnimation(View target) {
+ ObjectAnimator animator = ObjectAnimator.ofFloat(target, "translationY", 0, -1 * ViewUtil.dpToPx(target.getContext(), 32));
animator.setInterpolator(new AccelerateInterpolator());
animator.setDuration(UP_TIME);
return animator;
}
- private ObjectAnimator getDownAnimation(View target) {
+ private static ObjectAnimator getDownAnimation(View target) {
ObjectAnimator animator = ObjectAnimator.ofFloat(target, "translationY", 0);
animator.setInterpolator(new DecelerateInterpolator());
animator.setDuration(DOWN_TIME);
@@ -282,29 +324,18 @@ public class WebRtcAnswerDeclineButton extends LinearLayout implements View.OnTo
return animator;
}
- private ObjectAnimator getFadeOut(View target) {
+ private static ObjectAnimator getFadeOut(View target) {
ObjectAnimator animator = ObjectAnimator.ofFloat(target, "alpha", 1, 0);
animator.setDuration(FADE_OUT_TIME);
return animator;
}
- private ObjectAnimator getFadeIn(View target) {
+ private static ObjectAnimator getFadeIn(View target) {
ObjectAnimator animator = ObjectAnimator.ofFloat(target, "alpha", 0, 1);
animator.setDuration(FADE_IN_TIME);
return animator;
}
- private void resetElements() {
- animating = false;
- complete = false;
-
- if (animatorSet != null) animatorSet.cancel();
-
- swipeUpText.setTranslationY(0);
- fab.setTranslationY(0);
- swipeDownText.setAlpha(1);
- }
-
public interface AnswerDeclineListener {
void onAnswered();
void onDeclined();
diff --git a/src/org/thoughtcrime/securesms/components/webrtc/WebRtcCallControls.java b/src/org/thoughtcrime/securesms/components/webrtc/WebRtcCallControls.java
index dc65513833..524003a1d9 100644
--- a/src/org/thoughtcrime/securesms/components/webrtc/WebRtcCallControls.java
+++ b/src/org/thoughtcrime/securesms/components/webrtc/WebRtcCallControls.java
@@ -90,7 +90,6 @@ public class WebRtcCallControls extends LinearLayout {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
listener.onToggle();
- updateCameraFlipIcon(isChecked);
cameraFlipButton.setEnabled(false);
}
});
@@ -151,12 +150,6 @@ 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) {
diff --git a/src/org/thoughtcrime/securesms/components/webrtc/WebRtcCallScreen.java b/src/org/thoughtcrime/securesms/components/webrtc/WebRtcCallScreen.java
index 4cf72818ac..331ba35f13 100644
--- a/src/org/thoughtcrime/securesms/components/webrtc/WebRtcCallScreen.java
+++ b/src/org/thoughtcrime/securesms/components/webrtc/WebRtcCallScreen.java
@@ -18,10 +18,6 @@
package org.thoughtcrime.securesms.components.webrtc;
import android.content.Context;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import com.google.android.material.floatingactionbutton.FloatingActionButton;
-import androidx.core.view.ViewCompat;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
@@ -36,7 +32,12 @@ import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.core.view.ViewCompat;
+
import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.mms.GlideApp;
@@ -253,7 +254,11 @@ public class WebRtcCallScreen extends FrameLayout implements RecipientModifiedLi
this.remoteRenderLayout.setHidden(true);
this.minimized = false;
- this.remoteRenderLayout.setOnClickListener(v -> setMinimized(!minimized));
+ this.remoteRenderLayout.setOnClickListener(v -> {
+ if (!this.remoteRenderLayout.isHidden()) {
+ setMinimized(!minimized);
+ }
+ });
}
private void setConnected(SurfaceViewRenderer localRenderer,
diff --git a/src/org/thoughtcrime/securesms/util/ServiceUtil.java b/src/org/thoughtcrime/securesms/util/ServiceUtil.java
index a86d06597a..eb189daf9b 100644
--- a/src/org/thoughtcrime/securesms/util/ServiceUtil.java
+++ b/src/org/thoughtcrime/securesms/util/ServiceUtil.java
@@ -18,6 +18,7 @@ import androidx.annotation.RequiresApi;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.view.WindowManager;
+import android.view.accessibility.AccessibilityManager;
import android.view.inputmethod.InputMethodManager;
public class ServiceUtil {
@@ -61,6 +62,10 @@ public class ServiceUtil {
return (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE);
}
+ public static AccessibilityManager getAccessibilityManager(@NonNull Context context) {
+ return (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
+ }
+
@RequiresApi(26)
public static JobScheduler getJobScheduler(Context context) {
return (JobScheduler) context.getSystemService(JobScheduler.class);