Why CardView will adjust position automatically when scrolling - android

I am using RecyclerView and CardView in my project, most parameters of these two widget were default, I haven't customize it much, but two questions came up.
Why those CardViews will flash one second when pull down to refresh data which is using SwipeRefreshLayout, can I stop this effect?
Why those CardViews will adjust position automatically when scrolling? Can I stop this effect?
The layout I am using for RecyclerView is StaggeredGridLayout, it's inconvenient to post code here beause there too many code in my project to use those widget, so you can tell me which part I should post here, thanks.

Related

How to implement this complex RecyclerView UI design in Android?

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?

Recommend me android best layout structure for this

Hello currently I am working on android and I am stuck to implement the structure picture above.
I need to add and delete the CardView in the list.
I have tried it with RecyclerView and also used NestedScrollView to avoid double scroll, but I
faced a problem that the animation is not available anymore when deletion because when
deleting an item, the size of the recyclerView is forcibly reduced by NestedScrollView, so the
animation cannot be operated normally.
So what I want to know is if there is any way to implement it without NestedScrollView
If not, how can I restore the animation working?
NestedScrollView in this case is unnecessary. You'd better use RecyclerView only with multiple view item types

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.

android animate views inside a scroll view while scrolling

Is there example android code or sample android app which demonstrate animation of the views while scrolling.
For example. In a scroll view some items are not visible when you scroll the items will start to come inside the screen that time i just want to animate that view.
any help would be greatly appreciated.
Thanks.
Download this app. Here you will find tons of libraries of your use. I also seen the library which your are asking in this app. You will find source code links in the app as well.
https://play.google.com/store/apps/details?id=com.desarrollodroide.repos&hl=en
Or You can do one more thing
Just add on scroll listener and some more listeners are there by which you can detect which portion of your scroll view is visible.
Then You can add animation to those views.
Try Listview animation library.
Modify it and use.
https://github.com/nhaarman/ListViewAnimations

Android pull to refresh with ScrollView control

I am using a ScrollView to display a list of items that are inflated on runtime. Like a feed of updates for the user.
While thinking about the options i got to let the user update the view with new notifications I thought about the pull to refresh feature in the twitter app.
Anyone got any idea how and if can it be implemented with a ScrollView ?
Saw there are some implementations for that using ListView but I don't like the idea of changing all of my platform to gain this refresh effect.
There is a solution introduced for implementing pull to refresh for various component which are scrollable like listview and scroollview.
Look at ChangeLog link https://github.com/chrisbanes/Android-PullToRefresh
ListView with just one element can be treated as a ScrollView. You can use the implementation for pull-to-refresh ListView and add just one item in it. I had used this trick in the past.
You can do that. You can increase the top margin of the scrollview when the user moves the finger down and the scrollview it's on it's top. Then on release fire the update and decrease the margin with animation.(You have to create your own animation to pull that off). That's the idea. If you want more particular help ask what you cannot implement.

Categories

Resources