Comments (8)
@Ceees2 you can modify this behaviour by configuring notifyOnAutoToggleExpandable
within the ExpandableExtension
It's used here when we toggle the expandable state for the clicked item:
https://github.com/mikepenz/FastAdapter/blob/develop/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/expandable/ExpandableExtension.kt#L168
to:
https://github.com/mikepenz/FastAdapter/blob/develop/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/expandable/ExpandableExtension.kt#L309
to:
https://github.com/mikepenz/FastAdapter/blob/develop/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/expandable/ExpandableExtension.kt#L401-L404
If you don't notify this item, you'd need to make sure alternatively to highlight any indicator that it's expanded
from fastadapter.
@Ceees2 you can modify this behaviour by configuring
notifyOnAutoToggleExpandable
within theExpandableExtension
It's used here when we toggle the expandable state for the clicked item: https://github.com/mikepenz/FastAdapter/blob/develop/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/expandable/ExpandableExtension.kt#L168 to: https://github.com/mikepenz/FastAdapter/blob/develop/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/expandable/ExpandableExtension.kt#L309 to: https://github.com/mikepenz/FastAdapter/blob/develop/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/expandable/ExpandableExtension.kt#L401-L404
If you don't notify this item, you'd need to make sure alternatively to highlight any indicator that it's expanded
I know, that was my proposed solution in the linked PR, but I feel like that is more a work around than an actual solution. notifyOnAutoToggleExpandable
false is fixing the animation issue, but causes the inability to used the extensions expand or collapse since click listeners wont be called and thus no animations. notifyOnAutoToggleExpandable
true would somewhat fix that issue but can cause any unwanted animation behaviour. The linked PR also shows this behaviour is actually present in the current example app.
Might also just be that I'm trying to do something thats just not possible, but not giving up yet.
from fastadapter.
Sorry, missed that this was the exact thing you had linked.
One potential solution would be to do the notify
with a payload
in this case, so you could manually handle the bind
in case of the existence of the payload, allowing you to update the UI?
from fastadapter.
Sorry, missed that this was the exact thing you had linked.
One potential solution would be to do the
notify
with apayload
in this case, so you could manually handle thebind
in case of the existence of the payload, allowing you to update the UI?
I thought about that, but that would mean updating the expand and collapse methods wouldn't it?
Would it also be possible to call bindView/unbindView with the current view instead of creating a new view. Seems like that's also causing issues for animations if the starting state of the view (when starting the animation) is different than when the view is created initially. eg the jumping of the expand icon; when the item is expanded and you want to collapse, the icon jumps to the collapsed rotation(since the view is being recreated), then immediately back to the expanded rotation and then the animation starts to rotate it back to collapse.
from fastadapter.
@Ceees2 it will mean we have to update the extension, but it would still be a good option, and consumers of the SDK can start acting on it optionally.
No it's not anticipated to call bindView
/unbindView
with the current view as those methods are called by the RecyclerView
as the RV will properly handle recycling the re-use of views, and any interception of that is most likely causing significant issues.
The animation parts can all be handled by making use of the payload, as within the bindView
the RV will make sure the right view is provided (reused or new) and based on the payload you can then run the animation
from fastadapter.
That was fast, thanks for all your work.
from fastadapter.
Works like a charm, I've completely removed the click listener triggering the animation and am using the payload now to determine if animations should be shown, and no need to use notifyOnAutoToggleExpandable = false
anymore. All in all nice change, thanks a bunch. 👌
If wanted I can also open a PR updating and applying these changes in the expand example in the fast adapter example app @mikepenz
from fastadapter.
@Ceees2 that's awesome news. Glad it works that great for you.
And yes definitely. Always happy about contributions 😀
from fastadapter.
Related Issues (20)
- how to use multiple items for different models with Model Adapter HOT 3
- compile error HOT 2
- Setting a Snackbar using UndoHelper's withSnackbar does nothing.
- List is not updating after adapter.set()
- Second added item is blank HOT 6
- SelectExtensions.select() not working when create view HOT 2
- Is there any way to add multiple row? HOT 5
- How made dynamic model list? HOT 6
- Overload resolution ambiguity. All these functions match. HOT 4
- How can I judge the item is the last one in AbstractBindingItem HOT 1
- EventHook + RecycledViewPool HOT 3
- How to get access to function of Item from ViewHolder? HOT 4
- ItemFilter publishResults NPE HOT 1
- FastAdapter intercepting clicks for other ViewPager tabs HOT 1
- Drag & drop - animation is broken HOT 1
- could not resolve FastItemAdapter , FooterAdapter, ProgressItem HOT 3
- Weird behavior on scroll with expandable HOT 2
- Runtime layout changes can affect more than one item HOT 5
- Can I Swipe item view then remain it's state then delete button can click HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastadapter.