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.
Related
How can i implement the following UI design in Android?
The data is retrieved from API so each event is an item and also the Big red card is also an item. The problem here is the background, it should scroll with the items and the items should be positioned on the yellow line. I thought of ItemDecoration for item offset and a simple path to draw, but i never used ItemDecoration, and from this UI it seems that the background would be an Image.
Is there any way to implement this?
There is an application called , which has a similar design, but in horizontal scrolling. It has a long horizontal scroll with background image which seems like fragmented images stuck together when scrolling.
So please can any one help me get an idea of how this can be achieved?
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.
I want to animate the RecyclerView scrolling. I don't want to animate adding or removal of items but rather animate items which are on screen, i.e visible items. What I want is, item settle down smoothly when scrolling is about to finish. I am not sure what approach should I take or how this can be done. I have tried following till now
Using RecyclerView.OnScrollListener, when I get onScrolled callback, I find visible items & animate them upside or downside based on scroll direction. But this approach is no-where near to perfect & many times when scrolling fast, some visible views are null so animation doesn't apply on them & it looks weird.
Tried to animate visible items when I receive SCROLL_STATE_IDLE. But there's noticeable delay for a fraction of second when scrolling is finished & then items animate. It doesn't look natural
Tried to figure out when RecyclerView scrolling is "about to" finish so I can start animation to mimic continuity of animation with scrolling. But didn't get success in identifying reliably that scrolling is about to finish.
Instead of above a little complex ways that doen't work the way I need, I wonder if there is any other way like creating custom LayoutManagerwhere I can override the each item scrolling so that it settle to it's aimed position smoothly?
Edit: Here's something very close to what I wanted
I'm trying to do a recycler view animation on scroll, but im struggling to get it started.
Basically, the animation will happen on scroll and always on the first visible child (and only on this one). When the user scrolls the recycler view, second item should overlap the first, and the first will slowly fade out. reverse animation when sliding down.
In short, when the list scroll top for example, when the first item goes offscreen and want to change that behaviour. Instead of going offscreen, it slowly fades based on scroll dY and stay in the same position.
Any hints would be much appreciated.
I think this answer may can help you. I used code like this in my app and work smootly.
https://stackoverflow.com/a/29714138/2971619
Hope to be usefull for you too!
I need a component that works like the picture below but I'm having trouble coming up with some kind of decent solution that works.
I want the list to have a center locked selection but being scrollable with the d-pad. This is for an application running on a TV so no need for touch scroll. So when pressing down on the remote d-pad the list will scroll and a new item will size up and the current selected one will size down and the new selection will still be in the middle.
I've tried doing this using a ListView that I extended and programmatically scrolling when pressing down or up. On scroll finished I called notifyDatasetChanged() on the ListView for re-inflating of the childs and in the ListViews adapters getView() I made the animation of the view located at the current selected position.
This is not optimal since I need to call notifyDatasetChanged(), which re-inflates all visible views, for the animation to apply. The UI becomes laggy when doing this and scrolling fast. It's also not possible to make som kind of compress animation when current selected item goes out of selection. There is also some trouble with the end items (read views) such the first or last in the list when doing animation of them, the may sometimes go out of screen.
I think that his must have been done before and maybe I'm missing it when searching for an answer.
Have anyone done something similar or do you have some suggestions of how this can be achieved? Maybe I'm just starting of with the wrong component here..
Regards,
Kristoffer