Git Product home page Git Product logo

composeoverscroll's Introduction

ComposeOverscroll

Overscroll any scrollable items!

Preview

compare with iOS

overscrollIOS

demo

Preview.for.overscroll.and.nested.invoke.mp4

The 1.4.0-beta02 version has a serious nested gesture dispatch error.You can find a failed test case in the test module.

1.4.0-beta02版本起,存在严重的嵌套手势分发错误,您可以在测试模块中找到失败的测试用例。

You can +1 in the issue at the end of this article

您可以在本文末尾的issue链接中+1帮助google重视此问题

How to use

for column :

Column(Modifier
    .fillMaxSize()
    .overScrollVertical() // invoke before the scrollable Modifier
    //.overScrollHorizontal() // or this
    .verticalScroll(state = scrollState, flingBehavior = rememberOverscrollFlingBehavior { scrollState }) // must use rememberOverscrollFlingBehavior
    //.horizontalScroll(state = scrollState, flingBehavior = rememberOverscrollFlingBehavior { scrollState }) // must use rememberOverscrollFlingBehavior
) {
    // ...
}

for scrollable Composable like lazyColumn :

  val scrollState = rememberLazyListState()
        
        LazyColumn(Modifier
            .fillMaxWidth()
            .overScrollVertical(), // * u should do it
            state = scrollState, // * u should do it 
            flingBehavior = rememberOverscrollFlingBehavior { scrollState } // * u should do it after compose 1.3.x because this's a added param.
        ) {
            // ...
        }

U can call it nested! pls see the demo!

This is an issue submitted to Google about this project: https://issuetracker.google.com/issues/276682419 https://issuetracker.google.com/issues/261895103

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.