Coder Social home page Coder Social logo

Comments (22)

florent37 avatar florent37 commented on May 18, 2024 1

from expansionpanel.

florent37 avatar florent37 commented on May 18, 2024

so, add id on it ?

from expansionpanel.

JRoot3D avatar JRoot3D commented on May 18, 2024

and this doesn't work.

from expansionpanel.

JRoot3D avatar JRoot3D commented on May 18, 2024

check in you example app. Headers and layouts with id but when screen rotate layout is back to initial state...

from expansionpanel.

florent37 avatar florent37 commented on May 18, 2024

I added this into 1.0.9 can you try ?

from expansionpanel.

JRoot3D avatar JRoot3D commented on May 18, 2024

its partially work, after rotating expanded state is saved but then can't collapse view

from expansionpanel.

JRoot3D avatar JRoot3D commented on May 18, 2024

expansionLayout is null after call setup() from onRestoreInstanceState(...)

from expansionpanel.

florent37 avatar florent37 commented on May 18, 2024

from expansionpanel.

JRoot3D avatar JRoot3D commented on May 18, 2024

Problem with the call to restore super state. I fix this with extends View.BaseSavedState. But found another bug, when header use identical id's in View or RecuclerView, in this case, state is single for all headers.

from expansionpanel.

florent37 avatar florent37 commented on May 18, 2024

from expansionpanel.

florent37 avatar florent37 commented on May 18, 2024

from expansionpanel.

florent37 avatar florent37 commented on May 18, 2024

from expansionpanel.

JRoot3D avatar JRoot3D commented on May 18, 2024

for RecyclerView this is important

from expansionpanel.

florent37 avatar florent37 commented on May 18, 2024

you've got an idea how to fix it ?

from expansionpanel.

florent37 avatar florent37 commented on May 18, 2024

because on RecyclerView, each view can have same ids

from expansionpanel.

JRoot3D avatar JRoot3D commented on May 18, 2024

currently, no...

from expansionpanel.

JRoot3D avatar JRoot3D commented on May 18, 2024

Can you release latest fixes?

from expansionpanel.

florent37 avatar florent37 commented on May 18, 2024

from expansionpanel.

florent37 avatar florent37 commented on May 18, 2024

from expansionpanel.

broakenmedia avatar broakenmedia commented on May 18, 2024

How can we fix this in recyclerview? If i expand several panels, press the home button and come back, everything is reset

from expansionpanel.

webserveis avatar webserveis commented on May 18, 2024

I think that for the recyclerview it is best to implement something like this:

In Recyclerview the following article can be adapted
Android: Handling Checkbox state in Recycler Views.

Use SparseBooleanArray for save state each expandable state

private SparseBooleanArray itemStateArray= new SparseBooleanArray();

Detect expandable state in Viewholder

expansionLayout.addListener(new ExpansionLayout.Listener() {
    @Override
    public void onExpansionChanged(ExpansionLayout expansionLayout, boolean expanded) {
            itemStateArray.put(adapterPosition, true);
    }
});

from expansionpanel.

M0N3 avatar M0N3 commented on May 18, 2024

https://stackoverflow.com/questions/35424232/issue-refreshing-a-view-of-a-row-in-recyclerview?rq=1
This may help to avoid recreating all views and your state will not be changed. You can update only specific view that you need.

from expansionpanel.

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.