Code Monkey home page Code Monkey logo

Comments (4)

ZacSweers avatar ZacSweers commented on July 17, 2024

Can you give some use cases for either of these?

from bottomsheet.

Brian-McBride avatar Brian-McBride commented on July 17, 2024

Sure. In my case I'm extending bottom sheet to make a shopping cart.

When an item is added, the cart slides up into "peek". This basically is a list view. I've extended the peek size to either be the height of this product list or the maximum size that would be found if the view was expanded. Conversely, the product scrollview also sizes itself to the maximum size of the parent view too.

The end result is a a scroll list of products. When drag the view into an "expanded" state the payment methods from your account are revealed below and you've moved into checkout mode. If you drag back down you move back into cart mode. If you dismiss the view you're back into buy mode.

So in my case, I need to have a similar action to expanded. Where while in peeked if you drag up or down, it passes that event to the sheet unless the sheet isn't scrollable, upon which it then drags the bottomSheetView into expanded or hidden states.

This is a very cool library and I think it would also be very handy to further add a dynamic element to attach it to any side. I could see uses with top-down peeks as well as left or right peeks.

Again, thanks for the open source.

from bottomsheet.

ZacSweers avatar ZacSweers commented on July 17, 2024

This wouldn't really work with how the library works. When the bottom sheet is created, its height is actually the same as the parent. This creates an issue where if you wanted to scroll the list in its peeked state, the bottom n items of the list would conceivably never be visible in the peeked portion, since they're considered visible in the context of the whole sheet itself. The sheet isn't really expanding when you pull it up, rather you're just translating it up from off-screen.

A potential work around for this would maybe be to allow for scrolling until it hits the bottom, and then continuing the scroll by translating the sheet up. I think this behavior would be weird and not exactly obvious, so I don't think it's something we want to figure out just for a niche use case. You'd probably be better off extending BottomSheetLayout and implementing this behavior yourself.

I think it would also be very handy to further add a dynamic element to attach it to any side

There's something for that in the material spec and support library already. It's called the Navigation Drawer ;)

from bottomsheet.

ZacSweers avatar ZacSweers commented on July 17, 2024

Going to close this for now, we can revisit if more people express an interest.

from bottomsheet.

Related Issues (20)

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.