Code Monkey home page Code Monkey logo

Comments (4)

jingibus avatar jingibus commented on August 24, 2024 1

SwappingHolder works by swapping out the drawables of the top-level View. CardView uses its own drawables, so it will not work if you use it as the top-level View.

I do not know of a way to fix SwappingHolder to handle this, but you can fix it by wrapping the CardView in a FrameLayout.

from recyclerview-multiselect.

Protino avatar Protino commented on August 24, 2024

How do i wrap CardView inside a FrameLayout and doesn't CardView extend FrameLayout ? Why wrap it again?

from recyclerview-multiselect.

jingibus avatar jingibus commented on August 24, 2024

Make it a child of a FrameLayout, that's all I mean:

<FrameLayout
    ...
    >
    <CardView 
        ...
        >
    </CardView>
</FrameLayout>

The problem is that CardView uses its own background. SwappingHolder needs to be able to replace that background to do its work.

Another option would be to implement the SelectableHolder interface yourself, and choose how you want to display a selected item.

from recyclerview-multiselect.

Protino avatar Protino commented on August 24, 2024

FrameLayout not only solved the above issue, this issue was also fixed -
Only the card that was long clicked used to appear( Problem was in lollipop only).

Listeners on each of the card's item is not working though, but i'm fine with this. I set listeners on the CardView itself.

Thanks a lot man, appreciate your help.

from recyclerview-multiselect.

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.