Coder Social home page Coder Social logo

Comments (1)

tunjid avatar tunjid commented on August 24, 2024 1

@dave-kennedy

With regards to the first icon that shows up, that code blocks sets it up, you can use the unfold icon there instead of the first one from the speed dial items.

        _fabExtensionAnimator = FabExtensionAnimator(expandable_fab).apply {
            speedDialItems[1].run { updateGlyphs("Hello", R.drawable.ic_unfold_less_24dp) }
        }

Next, the run guard prevents the animation from running while it is currently animating. I use a immutable UiState for this, and you're right that you don't need it in your project. You also don't need to call configure spring, that's just for the demo to change the bounciness of the spring.

Change your declaration of

expandable_fab.setOnClickListener {
            _fabExtensionAnimator.isExtended = !_fabExtensionAnimator.isExtended
        }

to

expandable_fab.setOnClickListener(_fabClickListener)

That should at least get the speed dial showing.

Finally, the mappings you have for your dismiss listener have to be updated.

dismissListener = {
                when (it) {
                    null -> Unit // means it was dismissed with no selection
                    0 -> Unit // The first item was clicked, you may want to collapse your fab here.
                    else -> Unit // Some other item was clicked
                }
            }

from android-extensions.

Related Issues (13)

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.