Giter VIP home page Giter VIP logo

Comments (3)

paul-turner avatar paul-turner commented on June 16, 2024 3

@ThatKawaiiGuy I think this has to do with the click listener not debouncing, I recommend using ButterKnife which already has a debouncing click listener that it uses internally: DebouncingOnClickListener

Since it is a common problem not unique to this library I'm going to leave it out of the readme, hope it helps. If not glad you found a solution.

from expandable-recycler-view.

0xKiwi avatar 0xKiwi commented on June 16, 2024

Well, it appears I have fixed my own issue.

I have created a boolean canStart = true in the adapter
And then had made my OnClickListener like so:

childViewHolder.dataText.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(canStart) {
                    // Whatever you want to do and not have run twice due to double tap
                }
            }
}

and then added a setCanStart method to the adapter class:

public void setCanStart(boolean can){
        canStart = can;
}

And then in the fragment's or activity's onResume() where the adapter is assigned to the recyclerview, I added the following method:

@Override
public void onResume() {
    super.onResume();
    mExpandableAdapter.setCanStart(true);
}

I suggest you (@bignerdranch) add this and my previous solution to the README.

from expandable-recycler-view.

0xKiwi avatar 0xKiwi commented on June 16, 2024

I meant to add the solution for the onClickListener to the readme. Might not be something someone would come up with instantly.

from expandable-recycler-view.

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.