mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-12 00:28:20 -04:00
fix: ensure snackbar respects safe drawing padding over host modifiers (#5290)
This commit is contained in:
@@ -18,6 +18,7 @@ package org.meshtastic.core.ui.component
|
||||
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.safeDrawingPadding
|
||||
import androidx.compose.material3.SnackbarHost
|
||||
import androidx.compose.material3.SnackbarHostState
|
||||
import androidx.compose.material3.SnackbarResult
|
||||
@@ -61,7 +62,7 @@ fun MeshtasticSnackbarProvider(
|
||||
content()
|
||||
SnackbarHost(
|
||||
hostState = snackbarHostState,
|
||||
modifier = Modifier.align(Alignment.BottomCenter).then(hostModifier),
|
||||
modifier = Modifier.align(Alignment.BottomCenter).safeDrawingPadding().then(hostModifier),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.meshtastic.core.ui.component
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import org.jetbrains.compose.resources.stringResource
|
||||
import org.meshtastic.core.resources.Res
|
||||
import org.meshtastic.core.resources.internal
|
||||
@@ -46,5 +47,5 @@ fun TransportIcon(transport: Int, viaMqtt: Boolean, modifier: Modifier = Modifie
|
||||
MeshtasticIcons.Device to stringResource(Res.string.internal)
|
||||
else -> return
|
||||
}
|
||||
Icon(icon, contentDescription = description, modifier = modifier)
|
||||
Icon(icon, contentDescription = description, modifier = modifier, tint = Color.White)
|
||||
}
|
||||
|
||||
@@ -305,10 +305,7 @@ fun MessageItem(
|
||||
imageVector = MeshtasticIcons.HopCount,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(14.dp),
|
||||
tint =
|
||||
contentColor.copy(
|
||||
alpha = if (contrastLevel == ContrastLevel.HIGH) 1f else 0.7f,
|
||||
),
|
||||
tint = Color.White,
|
||||
)
|
||||
Text(
|
||||
text =
|
||||
@@ -318,6 +315,7 @@ fun MessageItem(
|
||||
"?"
|
||||
},
|
||||
style = metadataStyle,
|
||||
color = Color.White,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user