cheonjaeung / gridlayout-compose Goto Github PK
View Code? Open in Web Editor NEWMissing non lazy grid layout for Compose Multiplatform.
Home Page: https://cheonjaeung.github.io/gridlayout-compose
License: Apache License 2.0
Missing non lazy grid layout for Compose Multiplatform.
Home Page: https://cheonjaeung.github.io/gridlayout-compose
License: Apache License 2.0
안녕하세요, 라이브러리를 잘 사용하고 있습니다.
다름이 아니라, 같은 줄에서 아이템 높이가 다른 경우 더 작은 아이템의 높이를 더 큰 아이템의 높이에 맞추는 기능은 혹시 구현되지 않은 건지, 아니면 제가 못 찾고 있는 건지 궁금해 이슈에 남겨놓습니다.
위와 같은 경우, 3Dㅇㅇㅇㅇㅇ를 제외한 나머지 아이템은 이 아이템보다 높이가 모자란 것을 볼 수 있습니다.
감사합니다!
VerticalGrid(
columns = SimpleGridCells.Adaptive(80.dp),
horizontalArrangement = Arrangement.spacedBy(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
modifier = Modifier
.fillMaxWidth()
.padding(start = 16.dp, end = 16.dp, top = 16.dp)
) {
RoomRow("3D Printer")
RoomRow("3D ㅇㅇㅇㅇㅇㅇㅇㅇㅇ")
RoomRow("3D2")
RoomRow("3D Printer")
RoomRow("3D ㅇㅇㅇㅇㅇㅇㅇㅇㅇ")
RoomRow("3D2")
}
The library is a great addition that's just what I needed but unfortunately there's a bug with spacing. This example will show that horizontalArrangement spacedBy does not add any spacing at all. This issue does not happen with the official LazyVerticalGrid.
VerticalGrid(
columns = SimpleGridCells.Fixed(2),
verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
repeat(4) {
Surface(
modifier = Modifier
.height(100.dp)
.fillMaxWidth()
) {
}
}
}
Can you add drag and drop to each grid item?
`
data class CategoryDto(
val icon: Int,
val title: String
)
@composable
fun Categories() {
val categories = listOf(
CategoryDto(
icon = R.drawable.img_ai,
title = "Ai assistant"
),
CategoryDto(
icon = R.drawable.img_gmail,
title = "Gmail"
),
CategoryDto(
icon = R.drawable.img_mysdu,
title = "MySDU"
),
CategoryDto(
icon = R.drawable.img_sdukz,
title = "Sdu.kz"
),
CategoryDto(
icon = R.drawable.img_mysdu,
title = "Student clubs"
),
CategoryDto(
icon = R.drawable.img_free_offices,
title = "Free Offices"
),
CategoryDto(
icon = R.drawable.img_moodle,
title = "Moodle"
),
CategoryDto(
icon = R.drawable.img_library,
title = "Library"
),
)
VerticalGrid(
columns = SimpleGridCells.Fixed(4),
modifier = Modifier.padding(8.dp)
) {
categories.forEach { category ->
val context = LocalContext.current
Category(
category.icon,
category.title,
onCategoryClick = { navigateToCategory(context, category.title) },
)
}
}
}
@composable
fun Category(
icon: Int,
title: String,
onCategoryClick: () -> Unit,
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
modifier = Modifier
.padding(horizontal = 2.dp, vertical = 8.dp)
.clickable { onCategoryClick() }
) {
Image(
painter = painterResource(icon),
contentDescription = title,
modifier = Modifier
.size(56.dp)
.shadow(elevation = 4.dp, shape = CircleShape)
.clip(CircleShape)
)
Text(
text = title,
textAlign = TextAlign.Center,
)
}
}
`
At first - i want to say thank you for easying our job with this awsome library! buuut here is my code, and i dont know why its laggy. in homescreen i just show in lazyColumn as item this gridlayout and as next item column of notes (just simple notes with room). without this grid - notes work well, i need optimizations, please help
Hi there! Thanks for this awesome library.
I faced an issue while trying to add this to a KMP project (Kotlin 1.9.23 / Compose Multiplatform 1.6.1), as it fails while trying to download iOS artifacts.
Note that I use a Linux machine, so I can't build iOS projects anyways, but leaving iOS enabled doesn't cause me any issues (and I use quite a few KMP libraries without facing this issue). Your library's build.gradle.kts
shows that iOS targets are specified, so maybe this is a publishing issue?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.