mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 16:33:39 +00:00
Fix cards visibility pre API 28
This commit is contained in:
parent
ebbe928fd2
commit
149c81722c
@ -43,11 +43,10 @@ fun DisappearingMessages(
|
||||
) {
|
||||
val scrollState = rememberScrollState()
|
||||
|
||||
Column(modifier = modifier) {
|
||||
Column(modifier = modifier.padding(horizontal = 32.dp)) {
|
||||
Box(modifier = Modifier.weight(1f)) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 32.dp)
|
||||
.padding(bottom = 20.dp)
|
||||
.verticalScroll(scrollState)
|
||||
.fadingEdges(scrollState),
|
||||
|
@ -5,6 +5,7 @@ import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.ScrollState
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.BoxScope
|
||||
import androidx.compose.foundation.layout.Column
|
||||
@ -115,10 +116,13 @@ fun CellWithPaddingAndMargin(
|
||||
|
||||
@Composable
|
||||
fun TitledRadioButton(option: OptionModel, onClick: () -> Unit) {
|
||||
Row(modifier = Modifier
|
||||
.clickable { if (!option.selected) onClick() }
|
||||
.heightIn(min = 60.dp)
|
||||
.padding(horizontal = 34.dp)) {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||
modifier = Modifier
|
||||
.clickable { if (!option.selected) onClick() }
|
||||
.heightIn(min = 60.dp)
|
||||
.padding(horizontal = 32.dp)
|
||||
) {
|
||||
Column(modifier = Modifier
|
||||
.weight(1f)
|
||||
.align(Alignment.CenterVertically)) {
|
||||
@ -182,7 +186,7 @@ fun Modifier.fadingEdges(
|
||||
val topColors = listOf(Color.Transparent, Color.Black)
|
||||
val topStartY = scrollState.value.toFloat()
|
||||
val topGradientHeight = min(topEdgeHeight.toPx(), topStartY)
|
||||
drawRect(
|
||||
if (topGradientHeight > 0f) drawRect(
|
||||
brush = Brush.verticalGradient(
|
||||
colors = topColors,
|
||||
startY = topStartY,
|
||||
@ -195,7 +199,7 @@ fun Modifier.fadingEdges(
|
||||
val bottomEndY = size.height - scrollState.maxValue + scrollState.value
|
||||
val bottomGradientHeight =
|
||||
min(bottomEdgeHeight.toPx(), scrollState.maxValue.toFloat() - scrollState.value)
|
||||
if (bottomGradientHeight != 0f) drawRect(
|
||||
if (bottomGradientHeight > 0f) drawRect(
|
||||
brush = Brush.verticalGradient(
|
||||
colors = bottomColors,
|
||||
startY = bottomEndY - bottomGradientHeight,
|
||||
|
Loading…
x
Reference in New Issue
Block a user