Git Product home page Git Product logo

collapsible-navbar's People

Contributors

janicduplessis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

collapsible-navbar's Issues

Need to recompute _clampedScrollValue when offsetAnim changes

Thanks for creating this. Very useful!

Since the clampedScroll depends on both the offsetAnim and the scrollAnim _clampedScrollValue needs to be computed for both.

Here is my code (slightly modified to fit our client)

    // Keep track of animation values because we need them when the scrolling ends.

    const updateClampedScrollValue = diff => {
      this._clampedScrollValue = Math.min(
        Math.max(this._clampedScrollValue + diff, 0),
        TOOLBAR_HEIGHT,
      );
    };

    this._scrollAnim.addListener(({value}) => {
      // clamped animation does not implement addListener but since the animation depends on the
      // this anim we compute the value here.
      const diff = value - this._scrollValue;
      this._scrollValue = value;
      updateClampedScrollValue(diff);

      const {onScrolledToTop} = this.props;
      onScrolledToTop(value === 0);
    });

    this._toolbarOffsetAnim.addListener(({value}) => {
      // clamped animation does not implement addListener but since the animation depends on the
      // this anim we compute the value here.
      const diff = value - this._toolbarOffsetValue;
      this._toolbarOffsetValue = value;
      updateClampedScrollValue(diff);
    });
  }

Without this fix, scrolling a few pixels at a time ends up hiding the toolbar when it should be shown.

I can make this into a PR if you want?

Android FPS

Great stuff, however I'm only able to get 3FPS on Android devices. Do you think it has to do with Animation support on Android?

Cheers @janicduplessis

RefreshControl

Hi @janicduplessis,

Thanks a lot for this UI pattern, it's very usefull !

Juste one thing ; when i'm adding a RefreshControl to the AnimatedListView, the navbar is not collapsible anymore on Android only and I can't figure why (everything is working fine on IOS).
I saw you manage to handle it on the Th3rdwave app, can you give me an hint to make it work ?

Thanks a lot !

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.