`fun HomePage(){
Код: Выделить всё
val composableWidth = 1000.dp
var composableHeightPx by remember { mutableStateOf(200f) }
val composableHeight = with(LocalDensity.current) { composableHeightPx.toDp() }
val draggableState = rememberDraggableState(onDelta = {
composableHeightPx -= it
})
val profileImage = remember {
mutableIntStateOf(R.drawable.pfp)
}
Column(modifier = Modifier
.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally
)
{
Image(painter = painterResource(id = profileImage.intValue),
contentDescription = "Profile Image",
contentScale = ContentScale.FillHeight,
modifier = Modifier
.fillMaxWidth()
.clip(shape = RoundedCornerShape(7.dp))
)
Card(modifier = Modifier
.width(composableWidth)
.height(composableHeight)
.draggable(draggableState, Orientation.Vertical)
.fillMaxHeight(),
colors = CardDefaults.cardColors(
containerColor = colorResource(id = R.color.black)
)) {
}
}
Результат, который я получил, не соответствует моим ожиданиям!
Я новичок, и я не смог найти идеальное решение
Подробнее здесь: https://stackoverflow.com/questions/784 ... ck-compose