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

FEATURE - Enabled scroll when body is unfilled

Open GIGAMOLE opened this issue 2 years ago • 2 comments

By default, CollapsingToolbarScaffold is scrollable when the body content is unfilled (basically the scrollable body content without Modifier.fillMaxHeight()/Modifier.fillMaxSize()). In order to disable the scroll only when body content is unfilled, set enabledWhenBodyUnfilled = false in CollapsingToolbarScaffold. Also note that if the CollapsingToolbar is collapsed when the body content becomes unfilled, it will be automatically expanded.

Preview:

body-unfilled

GIGAMOLE avatar May 10 '23 12:05 GIGAMOLE

TODO:

Currently automatic expending happened only in CollapsingToolbar. After the merge of Snapping Feature: https://github.com/onebone/compose-collapsing-toolbar/pull/83, it will be required to use expand() function from CollapsingToolbarScaffoldState to properly animate Toolbar offset and height.

GIGAMOLE avatar May 10 '23 12: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 10 '23 12:05 GIGAMOLE