Fixed camera switch button visible in PiP

This commit is contained in:
Sylvain Berfini 2023-06-15 10:37:12 +02:00
parent 7519c69de1
commit 747f5288b8
2 changed files with 6 additions and 8 deletions

View file

@ -262,6 +262,8 @@ class Api31Compatibility {
context.startForegroundService(intent) context.startForegroundService(intent)
} catch (fssnae: ForegroundServiceStartNotAllowedException) { } catch (fssnae: ForegroundServiceStartNotAllowedException) {
Log.e("[Api31 Compatibility] Can't start service as foreground! $fssnae") Log.e("[Api31 Compatibility] Can't start service as foreground! $fssnae")
} catch (se: SecurityException) {
Log.e("[Api31 Compatibility] Can't start service as foreground! $se")
} }
} }
@ -270,6 +272,8 @@ class Api31Compatibility {
service.startForeground(notifId, notif) service.startForeground(notifId, notif)
} catch (fssnae: ForegroundServiceStartNotAllowedException) { } catch (fssnae: ForegroundServiceStartNotAllowedException) {
Log.e("[Api31 Compatibility] Can't start service as foreground! $fssnae") Log.e("[Api31 Compatibility] Can't start service as foreground! $fssnae")
} catch (se: SecurityException) {
Log.e("[Api31 Compatibility] Can't start service as foreground! $se")
} }
} }

View file

@ -222,18 +222,12 @@
app:layout_constraintEnd_toEndOf="@id/background" app:layout_constraintEnd_toEndOf="@id/background"
app:layout_constraintTop_toTopOf="@id/background" /> app:layout_constraintTop_toTopOf="@id/background" />
<androidx.constraintlayout.widget.Group
android:id="@+id/video_preview_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="@{controlsViewModel.isVideoEnabled &amp;&amp; !callsViewModel.currentCallData.isRemotelyPaused &amp;&amp; !callsViewModel.currentCallData.isPaused ? View.VISIBLE : View.GONE}"
app:constraint_referenced_ids="local_preview_video_surface,switch_camera" />
<org.linphone.activities.voip.views.RoundCornersTextureView <org.linphone.activities.voip.views.RoundCornersTextureView
android:id="@+id/local_preview_video_surface" android:id="@+id/local_preview_video_surface"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_size="@{controlsViewModel.pipMode ? @dimen/video_preview_pip_max_size : @dimen/video_preview_max_size}" android:layout_size="@{controlsViewModel.pipMode ? @dimen/video_preview_pip_max_size : @dimen/video_preview_max_size}"
android:visibility="@{controlsViewModel.isVideoEnabled &amp;&amp; !callsViewModel.currentCallData.isRemotelyPaused &amp;&amp; !callsViewModel.currentCallData.isPaused ? View.VISIBLE : View.GONE}"
app:alignTopRight="true" app:alignTopRight="true"
app:displayMode="black_bars" app:displayMode="black_bars"
app:layout_constraintBottom_toTopOf="@id/bottom_barrier" app:layout_constraintBottom_toTopOf="@id/bottom_barrier"
@ -251,7 +245,7 @@
android:onClick="@{() -> controlsViewModel.switchCamera()}" android:onClick="@{() -> controlsViewModel.switchCamera()}"
android:padding="10dp" android:padding="10dp"
android:src="@drawable/icon_call_camera_switch" android:src="@drawable/icon_call_camera_switch"
android:visibility="@{controlsViewModel.isSwitchCameraAvailable &amp;&amp; !controlsViewModel.pipMode ? View.VISIBLE : View.GONE, default=gone}" android:visibility="@{controlsViewModel.isVideoEnabled &amp;&amp; !callsViewModel.currentCallData.isRemotelyPaused &amp;&amp; !callsViewModel.currentCallData.isPaused &amp;&amp; controlsViewModel.isSwitchCameraAvailable &amp;&amp; !controlsViewModel.pipMode ? View.VISIBLE : View.GONE, default=gone}"
app:layout_constraintEnd_toEndOf="@id/local_preview_video_surface" app:layout_constraintEnd_toEndOf="@id/local_preview_video_surface"
app:layout_constraintTop_toTopOf="@id/local_preview_video_surface" /> app:layout_constraintTop_toTopOf="@id/local_preview_video_surface" />