summaryrefslogtreecommitdiff
path: root/Source/Android/app/src
diff options
context:
space:
mode:
authorTom Pratt <tom.pratt@outlook.com>2026-05-18 21:35:13 +0200
committerTom Pratt <tompratt@squareup.com>2026-05-19 12:03:02 +0200
commit8d565e0331cf198dddc6d26d8308f8f582e80b13 (patch)
tree78e5833c1fb2b8f9fe960dc1d6c6aec0a29b2c9e /Source/Android/app/src
parent4d1e74997749bca7744c1bbe78225e76f57a260c (diff)
Use the dual pane netplay screen layout only if the width is sufficient
To avoid using dual pane layout on very small devices, ensure that the current width available for display is at least medium (600dp). It also has to be landscape, the dual pane mode looks weird on a tablet in portrait mode since there's not that much content.
Diffstat (limited to 'Source/Android/app/src')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/netplay/ui/NetplayScreen.kt10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/netplay/ui/NetplayScreen.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/netplay/ui/NetplayScreen.kt
index 8150f0b8e7..34958176f7 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/netplay/ui/NetplayScreen.kt
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/netplay/ui/NetplayScreen.kt
@@ -61,6 +61,7 @@ import androidx.compose.material3.Scaffold
import androidx.compose.material3.SheetValue
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
+import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
@@ -87,6 +88,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
+import androidx.window.core.layout.WindowSizeClass
import coil.compose.AsyncImage
import coil.request.ImageRequest
import kotlinx.coroutines.flow.Flow
@@ -171,7 +173,13 @@ fun NetplayScreen(
mutableStateOf(joinAddresses.keys.firstOrNull() ?: JoinInfoType.EXTERNAL)
}
- if (LocalConfiguration.current.orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ val isLandscape =
+ LocalConfiguration.current.orientation == Configuration.ORIENTATION_LANDSCAPE
+ val isWidthAtLeastMedium = currentWindowAdaptiveInfo().windowSizeClass
+ .isWidthAtLeastBreakpoint(WindowSizeClass.WIDTH_DP_MEDIUM_LOWER_BOUND)
+ val useWideLayout = isLandscape && isWidthAtLeastMedium
+
+ if (useWideLayout) {
LandscapeContent(
isHosting = isHosting,
messages = messages,