Compose doesn't support scrollbar on lazy composables now days.
https://developer.android.com/jetpack/androidx/compose-roadmap#core-libraries
So that I made scrollbar for that composables.
Enjoy your lazy composables with my scrollbar SDK.
Thank you.
settings.gradle.kts
pluginManagement {
repositories {
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
}
}
(module) build.gradle.kts
dependencies {
implementation("io.github.jaehwa-noh:lazy-scroll:1.0.0")
}
In the code
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
HowToUseTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Greeting(
modifier = Modifier.padding(innerPadding)
)
}
}
}
}
}
@Composable
fun Greeting(modifier: Modifier = Modifier) {
LazyListScrollbarHost(modifier = modifier) { lazyListState ->
// If you need a horizontal scrollbar use LazyRow.
// LazyRow(state = lazyListState) { }
LazyColumn(state = lazyListState) {
for (index in 0..100) {
item {
Text(
text = "Hello $index!",
modifier = Modifier
.padding(16.dp)
.fillMaxWidth()
)
}
}
}
}
}
vertical.mp4
horizontal.mp4
Support minSdkVersion >= 21
Always good to use latest Compose version
Composable | support |
---|---|
LazyColumn | ✅ |
LazyRow | ✅ |
LazyVerticalGrid | Planed |
LazyHorizontalGrid | Planed |
LazyVerticalStaggeredGrid | Planed |
LazyHorizontalStaggeredGrid | Planed |
Always welcome to your contribution.
컴포즈는 현재 스크롤바를 지원하지 않습니다.
https://developer.android.com/jetpack/androidx/compose-roadmap#core-libraries
그래서 만들었습니다.
당신의 레이지 컴포저블을 제 스크롤바 SDK로 편하게 사용하세요.
settings.gradle.kts
pluginManagement {
repositories {
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
}
}
(모듈) build.gradle.kts
dependencies {
implementation("io.github.jaehwa-noh:lazy-scroll:1.0.0")
}
코드에서.
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
HowToUseTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Greeting(
modifier = Modifier.padding(innerPadding)
)
}
}
}
}
}
@Composable
fun Greeting(modifier: Modifier = Modifier) {
LazyListScrollbarHost(modifier = modifier) { lazyListState ->
// 가로가 필요하면 LazyRow를 사용하세요.
// LazyRow(state = lazyListState) { }
LazyColumn(state = lazyListState) {
for (index in 0..100) {
item {
Text(
text = "Hello $index!",
modifier = Modifier
.padding(16.dp)
.fillMaxWidth()
)
}
}
}
}
}
vertical.mp4
horizontal.mp4
최소 SDK 버전 >= 21 지원
언제나 최신 컴포즈 버전이 좋습니다.
컴포저블 | 지원 |
---|---|
LazyColumn | ✅ |
LazyRow | ✅ |
LazyVerticalGrid | 계획 |
LazyHorizontalGrid | 계획 |
LazyVerticalStaggeredGrid | 계획 |
LazyHorizontalStaggeredGrid | 계획 |
당신의 기여는 언제나 환영합니다.