Replace categorical window size classes with breakpoint-based checks.

This commit is contained in:
jeffrey-signal
2026-01-22 13:57:09 -05:00
committed by Alex Hart
parent 585bd5f24c
commit 4c43bf2228
7 changed files with 40 additions and 39 deletions

View File

@@ -12,8 +12,7 @@ import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.window.core.layout.WindowWidthSizeClass
import org.thoughtcrime.securesms.window.isAtLeast
import androidx.window.core.layout.WindowSizeClass
/**
* Displays the screen title for split-pane UIs on tablets and foldable devices.
@@ -31,7 +30,7 @@ fun ScreenTitlePane(
color = MaterialTheme.colorScheme.onSurface,
modifier = modifier
.padding(
start = if (windowSizeClass.windowWidthSizeClass.isAtLeast(WindowWidthSizeClass.EXPANDED)) 80.dp else 20.dp,
start = if (windowSizeClass.isWidthAtLeastBreakpoint(WindowSizeClass.WIDTH_DP_EXPANDED_LOWER_BOUND)) 80.dp else 20.dp,
end = 20.dp,
bottom = 12.dp
)

View File

@@ -44,7 +44,6 @@ import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.window.core.layout.WindowWidthSizeClass
import org.signal.core.ui.compose.AllNightPreviews
import org.signal.core.ui.compose.NightPreview
import org.signal.core.ui.compose.Previews
@@ -55,6 +54,7 @@ import org.thoughtcrime.securesms.events.CallParticipant
import org.thoughtcrime.securesms.recipients.Recipient
import org.thoughtcrime.securesms.recipients.rememberRecipientField
import org.thoughtcrime.securesms.service.webrtc.links.CallLinkRoomId
import org.thoughtcrime.securesms.window.isWidthCompact
import kotlin.math.max
/**
@@ -85,7 +85,7 @@ fun CallScreenPreJoinOverlay(
.background(color = Color(0f, 0f, 0f, 0.4f))
.then(modifier)
) {
val isCompactWidth = currentWindowAdaptiveInfo().windowSizeClass.windowWidthSizeClass == WindowWidthSizeClass.COMPACT
val isCompactWidth = currentWindowAdaptiveInfo().windowSizeClass.isWidthCompact
if (!isLocalVideoEnabled) {
TopWithCenteredContentLayout(