How can I animate individual elements in recycler view simultaneously - android

I have been working on recycler view animations and I stumbled upon a great app (Relay) animation example (video link below) which I have been trying to replicate.
I want to animate each layout item simultaneously inside the recycler view but am not able to figure out the approach for this.
Should I create a custom LayoutManager that animates the views whenever the item layout is changed or use RecyclerView.ItemAnimator is there some better approach to achieve something similar?
https://imgur.com/a/GsM8kO5

Related

Why RecyclerView items disappear immediately when using Transition API?

This is a question regarding the use of Android Transition API.
I am trying to animate the height change of a list, just like a dropdown menu.
I tried 2 approaches
Use a RecyclerView and animates its height change
Use a ScrollView > LinearLayout hierarchy and animates ScrollView's height.
The 2nd approach works perfectly.
But the 1st approach has a serious glitch - when the collapse transition starts, items disappear immediately.
By looking at the below GIF you can observe clearly the difference:
To be exact, items' visibility changes at the moment I change RecyclerView's LayoutParams, without waiting for the transition to finish, whatever it is expanding or collapsing
Code
I have created a minimal project on Github.
If you just want to look at the code, here is the MainActivity.
Question
Is it possible to achieve ScrollView's effect with a RecyclerView?
If yes, how?
My Idea is to do the transition of all the recycler view rows individual rather than the whole RecyclerView:
So when collapsing iterate through each ROW of a RecyclerView and do a transition. Remember to check for null if some rows are recycled they may return null. So after that collapse the whole recyclerView.
And like wise for the expanding do the same for the views.
This issue is cause by RecyclerView has many views with it but Scroll View has only one View nested in it.

Design an expandable list with recycler view and supporting grid layout for child views in android

I am trying to design a recycler view with expandable design , it will have groups which on click would open and show child views. But the child views need to support linear layout and grid layout as well.
Currently I am using a recycler view within another recycler view to achieve the same, and used expandable layout for expanding collapsing items. This does get me the desired effect but neither is it a good programming practice and nor is it bug free. It does some unexpected things at all times, which is really annoying and a bad UX experience.
Please tell me other reliable and bug free ways to do it.
This image is approximately what I am trying to achieve. Cannot show the actual work I have done because of company policy.
I am not asking to source code to solve my problem, but some general design directions to achieve the same goal. As mentioned before, what I did, using recycler view inside another did do the trick, but also created other problems(unpredicatble behaviour to say the least.)
It seems like using nested scroll view and setting the inner recycler views to 'setNestedScrollingEnabled(false)' did the trick. Now I can make what I wanted to after all.

Shifting touch focus from one recycle view to another

I am new to android development and got stuck with this.
I have implemented drag and drop for recycle view using ItemTouchHelper.Callback. Now drag and drop is working perfectly within the recycler view. But in my case, i have two recycler views and i want to drag item from one recycler view to another. Is there any ways to achieve this using ItemTouchHelper.Callback?
Thanks in advance.

Animate RecyclerView onLoad

I have been looking for a long time for a Android RecyclerView onLoad animation
but until now I have not found anything really helpful.
What I want is to have an animation when the RecyclerView loads and displays the cells animated.
But I want to have that animation just when the RecyclerView loads and not when the cells are loaded by the ViewHolder.
Because when the cells are loaded by the ViewHolder the RecyclerView animates the cells while scrolling and so on...
So I don't want no animation while scrolling anymore.
And some guys will know that the effect I would like to implement is
a standard animation effect the TableView of iOS supports.
I have found a tutorial where is exactly done what I would like to do.
The last example is what I mean.
So all solutions I have found were similar to that one
Has anyone an idea?
Or is the way I would like to animate the cells "not Android standard like"?
kind regards
Well one way to do this is to make sure that you are animating the entire recyclerview when your activity / fragment is ready and displayed on screen. So instead of animating each individual item in the recyclerview, you set an animation on the recyclerview as a whole to "fly" in for example, by animating the TranslateY element of the recyclerview.

A recycler view vs the linear layout inside a scroll view?

Am trying to create a page with a scrollable list. Features would be a normal list to remove item by clicking on it. Number of items in that list are limited and added dynamically by user. You can consider a to do list as example. Now which would be a better approach to implement it? Recycler view with data bound to its adapter? Or the normal linear layout with items added as children at run time?
My current implementation is recycler view. But,I found it lagging and animations are not performing well. So a linear layout is auto animated by specifying it xml -- by setting animate layout changes to true.
FYI data is local and syncs in background.
Never use a LinearLayout for anything longer than a single screen. The whole point of ListView and RecyclerView is to efficiently reuse views instead of needing to hold things in memory when they're not visible. Maybe you can refine or reask your question so people can help you with whatever difficulty you're having with animations, rather than avoiding the issue.

Categories

Resources