Skip to content

Jaehwa-Noh/LazyScroll

Repository files navigation

KDoC Maven Central javadoc

LazyScroll

Compose doesn't support scrollbar on lazy composables now days.
https://developer.android.com/jetpack/androidx/compose-roadmap#core-libraries image

So that I made scrollbar for that composables.
Enjoy your lazy composables with my scrollbar SDK.

Thank you.

Usage

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()
                    )
                }
            }
        }
    }
}

Demo video

Vertical

vertical.mp4

Horizontal

horizontal.mp4

Spec

Support minSdkVersion >= 21
Always good to use latest Compose version

Roadmap

Composable support
LazyColumn
LazyRow
LazyVerticalGrid Planed
LazyHorizontalGrid Planed
LazyVerticalStaggeredGrid Planed
LazyHorizontalStaggeredGrid Planed

Contribution

Always welcome to your contribution.






레이지스크롤

컴포즈는 현재 스크롤바를 지원하지 않습니다.
https://developer.android.com/jetpack/androidx/compose-roadmap#core-libraries image

그래서 만들었습니다.
당신의 레이지 컴포저블을 제 스크롤바 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 계획

기여

당신의 기여는 언제나 환영합니다.

About

Of the Lazy, By the Lazy, For the Lazy. Lazy Composable scrollbar SDK

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages