mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 00:29:11 +01:00
Replace categorical window size classes with breakpoint-based checks.
This commit is contained in:
committed by
Alex Hart
parent
585bd5f24c
commit
4c43bf2228
@@ -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
|
||||
)
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user