Code Monkey home page Code Monkey logo

Comments (7)

cachapa avatar cachapa commented on July 21, 2024

Thanks for the feedback, I'll work on it.

Regarding checking the expandedFraction, it should always return the correct value, unless you're using a Bounce or Overshoot interpolator. If that's not the case then it might be a bug which I'd like to fix.

By the way, checking the expansionFraction value in the listener should have no impact on performance unless you're doing something else in every check. A float compare is trivial work for a modern (even mobile) CPU.

from expandablelayout.

tamhuynhit avatar tamhuynhit commented on July 21, 2024

From my check, the expansionFraction param returns value from 0 to almost 1 (~0.9998...), but not 1, so I need to do some extra work to assume that it's closest to 1. A set of listeners to specific states would be very helpful. Anyway, thanks for the information.

from expandablelayout.

cachapa avatar cachapa commented on July 21, 2024

You're right, I just checked the code and internally I also had to work around the fact that the animator doesn't always reach 1.
I've opened ticket #33 to track this.

from expandablelayout.

Savrov avatar Savrov commented on July 21, 2024

Hi, i've tested my code and it works fine. 0 and 1 values were reached w/o problems. Link to gist
The result is:

  • to open

data body was isCollapsed
expanding expansionFraction = 1.0
dataBody expending

  • to close

data body was isExpanded
collapsing expansionFraction = 0.0
dataHeaderExpanded collapsing

P.S. Thanks for lib!

from expandablelayout.

cachapa avatar cachapa commented on July 21, 2024

@Savrov I think the problem doesn't occur on all interpolators. As far as I remember it works fine on the default one, which would explain why it's working for you.

from expandablelayout.

cachapa avatar cachapa commented on July 21, 2024

Fixed in 2.9

from expandablelayout.

tamhuynhit avatar tamhuynhit commented on July 21, 2024

Thanks a lot, it works now

from expandablelayout.

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.