From d66cce94db63b34a7400dd4ab481319fce40de07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Muller?= Date: Tue, 30 Jul 2024 16:50:47 +0200 Subject: [PATCH] Fix "Metrics overlay" setting on mobile --- .../demo/ui/player/settings/PlaybackSettingsContent.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/player/settings/PlaybackSettingsContent.kt b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/player/settings/PlaybackSettingsContent.kt index 685607588..f0f2a914e 100644 --- a/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/player/settings/PlaybackSettingsContent.kt +++ b/pillarbox-demo/src/main/java/ch/srgssr/pillarbox/demo/ui/player/settings/PlaybackSettingsContent.kt @@ -54,8 +54,14 @@ fun PlaybackSettingsContent(player: Player) { SettingsHome( settings = settings, settingsClicked = { - navController.navigate(it.destination.route) { - launchSingleTop = true + val destination = it.destination + + if (destination is SettingsRoutes.MetricsOverlay) { + settingsViewModel.setMetricsOverlayEnabled(!destination.enabled) + } else { + navController.navigate(destination.route) { + launchSingleTop = true + } } }, )