Skip to content

DragHandleBottomSheet helps to avoid disrupting the basic behavior of scroll views in the dialog by dragging BSD only through the drag handle specified by the user.

License

Notifications You must be signed in to change notification settings

tentenacy/DragHandleBottomSheet

Repository files navigation

DragHandleBottomSheet

When scrolling within Bottom Sheet Dialog(BSD), unexpected behavior occurs when scrolling behavior is implemented using ScrollView or NestedScrollView. This library helps to avoid disrupting the basic behavior of scroll views in the dialog by dragging BSD only through the drag handle specified by the user.

Preview

Release

settings.gradle

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
	    mavenCentral()
	    maven { url 'https://jitpack.io' }
	}
}

build.gradle(app)

dependencies {
    implementation 'com.github.tentenacy:DragHandleBottomSheet:1.0.0'
}

Usage

In onViewCreated of your BottomSheetDialogFragment

makeDraggableByHandle(
    dragHandle = view,              //(required)specifies the view that you want to drag
    scrollVerticalRatio = 0.45f,    //(optional)sets the critical percentage at which the BSD disappears or expands
    animatorDuration = 300L,        //(optional)sets the time (ms) of the animation to be executed
                                    //          when the height of the BSD is greater than the scrollVerticalRatio and expanded
                                    	
    interpolatorFactor = 2f,        //(optional)sets the factor of DecelerateInterpolator
)

Example

For full example, please refer to the DragHandleBottomSheetExample app.

Also you can browse the issue labeled as question here

License

Apache 2.0 License

About

DragHandleBottomSheet helps to avoid disrupting the basic behavior of scroll views in the dialog by dragging BSD only through the drag handle specified by the user.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages