mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Clipping content
This commit is contained in:
parent
4dd84331de
commit
356b105b98
@ -30,6 +30,7 @@ import androidx.compose.foundation.rememberScrollState
|
|||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@ -37,6 +38,7 @@ import androidx.compose.runtime.collectAsState
|
|||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
@ -284,7 +286,10 @@ private fun CarouselPager(
|
|||||||
attachments: List<Attachment>,
|
attachments: List<Attachment>,
|
||||||
onClick: (Int) -> Unit
|
onClick: (Int) -> Unit
|
||||||
) {
|
) {
|
||||||
Cell {
|
Cell(
|
||||||
|
modifier = Modifier
|
||||||
|
.clip(MaterialTheme.shapes.small)
|
||||||
|
) {
|
||||||
HorizontalPager(state = pagerState) { i ->
|
HorizontalPager(state = pagerState) { i ->
|
||||||
GlideImage(
|
GlideImage(
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
|
@ -258,12 +258,13 @@ fun PrewviewItemButton() {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Cell(
|
fun Cell(
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
padding: PaddingValues = PaddingValues(all = 0.dp),
|
padding: PaddingValues = PaddingValues(all = 0.dp),
|
||||||
margin: PaddingValues = PaddingValues(all = 0.dp),
|
margin: PaddingValues = PaddingValues(all = 0.dp),
|
||||||
content: @Composable () -> Unit
|
content: @Composable () -> Unit
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = modifier
|
||||||
.padding(margin)
|
.padding(margin)
|
||||||
.background(
|
.background(
|
||||||
color = LocalColors.current.backgroundSecondary,
|
color = LocalColors.current.backgroundSecondary,
|
||||||
|
Loading…
Reference in New Issue
Block a user