diff options
Diffstat (limited to 'java/com/android/incallui/video/impl/VideoCallFragment.java')
-rw-r--r-- | java/com/android/incallui/video/impl/VideoCallFragment.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/java/com/android/incallui/video/impl/VideoCallFragment.java b/java/com/android/incallui/video/impl/VideoCallFragment.java index 6e45f928a..8e2f5aefd 100644 --- a/java/com/android/incallui/video/impl/VideoCallFragment.java +++ b/java/com/android/incallui/video/impl/VideoCallFragment.java @@ -59,7 +59,6 @@ import android.widget.TextView; import com.android.dialer.common.Assert; import com.android.dialer.common.FragmentUtils; import com.android.dialer.common.LogUtil; -import com.android.dialer.common.concurrent.ThreadUtil; import com.android.dialer.compat.ActivityCompat; import com.android.incallui.audioroute.AudioRouteSelectorDialogFragment; import com.android.incallui.audioroute.AudioRouteSelectorDialogFragment.AudioRouteSelectorPresenter; @@ -666,14 +665,22 @@ public class VideoCallFragment extends Fragment updateRemoteVideoScaling(); } + /** + * This method scales the video feed inside the texture view, it doesn't change the texture view's + * size. In the old UI we would change the view size to match the aspect ratio of the video. In + * the new UI the view is always square (with the circular clip) so we have to do additional work + * to make sure the non-square video doesn't look squished. + */ @Override public void onLocalVideoDimensionsChanged() { LogUtil.i("VideoCallFragment.onLocalVideoDimensionsChanged", null); + updatePreviewVideoScaling(); } @Override public void onLocalVideoOrientationChanged() { LogUtil.i("VideoCallFragment.onLocalVideoOrientationChanged", null); + updatePreviewVideoScaling(); } /** Called when the remote video's dimensions change. */ @@ -846,9 +853,6 @@ public class VideoCallFragment extends Fragment } @Override - public void onAudioRouteSelectorDismiss() {} - - @Override public void setPrimary(@NonNull PrimaryInfo primaryInfo) { LogUtil.i("VideoCallFragment.setPrimary", primaryInfo.toString()); contactGridManager.setPrimary(primaryInfo); @@ -1041,6 +1045,7 @@ public class VideoCallFragment extends Fragment params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); previewTextureView.setLayoutParams(params); previewTextureView.setOutlineProvider(circleOutlineProvider); + updatePreviewVideoScaling(); updateOverlayBackground(); contactGridManager.setIsMiddleRowVisible(false); updateMutePreviewOverlayVisibility(); @@ -1048,9 +1053,6 @@ public class VideoCallFragment extends Fragment previewOffBlurredImageView.setLayoutParams(params); previewOffBlurredImageView.setOutlineProvider(circleOutlineProvider); previewOffBlurredImageView.setClipToOutline(true); - - // Wait until the layout pass has finished before updating the scaling - ThreadUtil.postOnUiThread(this::updatePreviewVideoScaling); } private void updateVideoOffViews() { |