compose-collapsing-toolbar icon indicating copy to clipboard operation
compose-collapsing-toolbar copied to clipboard

FEATURE - Snapping

Open GIGAMOLE opened this issue 2 years ago • 1 comments

Snap Config

SnapConfig defines how CollapsingToolbar snaps to its edges. You can enable snapping by providing snapConfig to CollapsingToolbarScaffold:

CollapsingToolbarScaffold(
    /* ... */
    snapConfig = SnapConfig() // "collapseThreshold = 0.5" by default
) {
    /* ... */
}

Snap for ScrollStrategy.EnterAlways

Snap for EnterAlways

Snap for ScrollStrategy.EnterAlwaysCollapsed

Snap for EnterAlwaysCollapsed

Snap ScrollStrategy.ExitUntilCollapsed

Snap for ExitUntilCollapsed

GIGAMOLE avatar May 08 '23 14:05 GIGAMOLE

By the way, who wants to use this feature, I created a separated remote dependency, while this PR is under review:

Add it in your root build.gradle at the end of repositories:

all projects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
        implementation 'com.github.GIGAMOLE:ComposeCollapsingToolbar:latest-version'
}

Or you can simply download it from there:

https://github.com/GIGAMOLE/ComposeCollapsingToolbar/releases

GIGAMOLE avatar May 08 '23 17:05 GIGAMOLE