Comments (11)
Some from my end as well
2)this effect when you try to do swipe to refresh at the top where you are able to drag the recycler to a bit and then it bounces back to its original place
from ultimaterecyclerview.
@Zeliret Thank you very much for giving advice.
I think the 2,3,4 suggestions are very useful and I try to add these in next version of the library.
I'm a little confused about the first suggestion.What the function swapAdapter()
do?
Thanks.
from ultimaterecyclerview.
@slidenerd Thank you very much.
In fact, the suggestion 2 is what I am doing now as I said in the ReadMe Colorful style of Swipe to refresh
so I think you will see the feature in 0.3.0 of UltimateRecyclerview.
However,for the suggestion 1 which said a swipe to refresh at the bottom , probably instead of the load more
I think the loading more has more situations to be used than swiping to refresh at the bottom. So I don't think it is a good idea to instead of loading but I can manage to set it as a option to choose.
from ultimaterecyclerview.
@cymcsg There are two methods (setAdapter and swapAdapter) in the RecyclerView.
They both call the same internal method but with one little exception. With swapAdapter u can change current adapter with a new one without recreating viewholders if they both are compatible (instances of the same class). When u do this the RecyclerView will animate all changes between both adapters.
Actually the swapAdapter method is a better way to change all data at once. Instead of using something like clear+add(array[]) u can just create a new adapter and set it =)
from ultimaterecyclerview.
There is one thing though, the SwipeToDismiss listener may often be used to delete an item say from a database or a cloud store, if the deletion in the backend is successful then the swipe to dismiss in the front end makes sense, but if in the backend, the delete operation fails for some reason, is it possible to bring the item back in the front end, perhaps a simpe callback that will be triggered where the item is restored and the user can do something about it?
from ultimaterecyclerview.
@Zeliret OK. As I thought you mean more than the default method so I want to know more about this.Now I see what you mean. I'll add this method in next version.Thank you.
from ultimaterecyclerview.
@cymcsg Thank you! I'll look forward to it.
from ultimaterecyclerview.
@slidenerd Good idea! I'll try to achieve the effect but maybe a little longer time. So if you like you can help to implement.
from ultimaterecyclerview.
Thank you for giving these useful advise.
But I wonder why do you deleted them.
2015-03-19 22:45 GMT+08:00 Artem Shalaev [email protected]:
Hi @cymcsg https://github.com/cymcsg! A few additions from me:
- Proxy method for addOnItemTouchListener. It is a little bit ugly to
use myList.mRecyclerView.addOnItemTouchListener =)- Helper methods for the UltimateViewAdapter for example:
public abstract class SimpleAdapter extends UltimateViewAdapter {
protected final ArrayList items = new ArrayList<>();public void add(final T item) { int index = items.size(); items.add(item); notifyItemInserted(index); } public void remove(final int position) { items.remove(position); notifyItemRemoved(position); } public void remove(final T item) { int position = items.indexOf(item); remove(position); } public void replace(final T[] newItems) { clear(); items.addAll(Arrays.asList(newItems)); notifyItemRangeInserted(0, newItems.length); } public void clear() { int count = items.size(); items.clear(); notifyItemRangeRemoved(0, count); } public T get(final int position) { return items.get(position); } @Override public int getAdapterItemCount() { return items.size(); }
}
—
Reply to this email directly or view it on GitHub
#3 (comment)
.
from ultimaterecyclerview.
@cymcsg Well I wasn't sure enough about second part of my suggestion. Your adapter already has insert
, remove
and so on method. But if you think that my post was useful I am glad to hear it =) Thank you =)
from ultimaterecyclerview.
@cymcsg lets add this on the 0.4 milestone
from ultimaterecyclerview.
Related Issues (20)
- implement node connections
- problem while using
- FATAL EXCEPTION java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorListenerCompat
- Error:(50, 67) 错误: 无法从参数化的类型中选择静态类
- loadmore view don't show
- Load more view in first time HOT 3
- OnLoadMoreListener HOT 1
- crash happen when showing the demo of 'Debug Pull to refresh'
- crash happen when showing the demo of 'Debug muti view types'
- Found older version Glide, please update glide version HOT 5
- java.lang.ClassCastException: com.marshalchen.ultimaterecyclerview.UltimateRecyclerviewViewHolder cannot be cast to CFProfileAdapter$VHolder HOT 2
- Handle empty view with AdapterDataObserver
- The app crashes when using the "Delete" feature when deleting all images in the "LauncherActivity" menu
- Gradle Sync Failed! Error: Failed to resolve: library HOT 6
- Is there a sample that uses the URV in fragment?
- Closeerror HOT 1
- Usr
- AndroidX Support HOT 2
- Backrgound color for sticky header
- 刷新是如何刷新header
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 ultimaterecyclerview.