Android: Pull to Refresh for GridView - android

I'm currently looking for a possibility to implement a pull to refresh GridView.
Does anybody have a clue if there's a complete custom view like the one in How to implement android pull to refresh

Chris Banes released a library recently based on Johan Nilsson's library that implements a PullToRefreshGridView widget. I have tried it and it perfectly works!

Related

Swipe to delete for a custom view not for list item

I want to develop a layout with a very simple ImageView and a Listview binded in a Relativelayout . Now for a better user experience I want to delete the Image view by swiping it left or right same like what is implemented in android Gmail app to delete emails.
Implementing it on a listview item is very simple and there are many tuts and sample codes are available over the internet including the official Google I/O talk on animation and explained in a very good way by Chet Hasse here
https://www.youtube.com/watch?v=YCHNAi9kJI4
but I don't require to implement it on the listview items insted I want to implement it in more generic way. In my case I want the same behaviour for my ImageView item as one view and ListView another . Like shown below
As soon as the ImageView item is deleted the whole ListView should smoothly come on the top.
I have tried many way to implement the same without any success.
Suggest me the approach or some samples to do this which is supported in Gingerbread and above android OS.
You can use this code:
https://github.com/romannurik/Android-SwipeToDismiss/blob/master/src/com/example/android/swipedismiss/SwipeDismissTouchListener.java
As described in readme this code works for android 14+.
You can use the NineOldAndroids library to support old versions of Android, or use the Jake Wharton's port:
https://github.com/JakeWharton/SwipeToDismissNOA
I looked around and found this helpful.
https://github.com/nhaarman/ListViewAnimations
I implemented a custom ViewGroup that takes one child and allows you to drag/fling it to the left with a callback once the swipe is complete. My intention was for it to work just like in a RecyclerView. Works well in a LinearLayout with animateLayoutChanges=true and setting the visibility to GONE in the callback.
Gist here: https://gist.github.com/darnmason/38a1a5178a06470202784050f4dc1cdf
All you need is this library: https://github.com/timroes/EnhancedListView

Android Pinterest Like AdapterView: How to add LoadMore event and Listener

I am using Pinterest Like AdapterView open source library found at PinterestLikeAdapterView
The problem is it only support Pull down to Refresh, but I want to use BOTH Pull down to Refresh and Pull up to Loadmore. So I tried to search around and found nothing. I also tried to implement it by myself, but it is not simple. I am a newbie in Android Development with working expierence under 2 months.
I would like to ask for your help to implement Pull up to Loadmore on this Library, or any library that display a grid like Pinterest support Pull down to Refresh and Pull up to Loadmore.
Thank in advanced, and sorry for my bad English :)
It seems I'd found a solution. The Android-PullToRefresh library is really great, I can use it to implement pull up and pull down for normal GridView. Unfotunately it does not support PLA ListView. So I tried to make it support PLA by duplicated two classes PullToRefreshAdapterViewBase:
public abstract class PullToRefreshAdapterViewBase2<T extends PLA_AbsListView> extends PullToRefreshBase<T> implements
OnScrollListener
and
public class PullToRefreshGridView2 extends PullToRefreshAdapterViewBase2<MultiColumnListView>
Luckily it worked, but I have no idea if it works without bugs. If you have any solution, please let me know.

Pull to refresh for GridView in Android

First of all, I want to tell you guys I have read and succeed developing Pull to refresh using Chris Banes library and Johan Nilsson library .
Now I'm trying to go with Johan Nilsson library for GridView. He only implemented for ListView so I have to modify PullToRefreshListView JAVA file.
There I have extends GridView instead of ListView (Line 24). Then it will give me a error on Line 109 by saying addHeaderView(mRefreshView); is not recognized and change it as addView() But addView() methods also give me run time errors.
I am going with Johan Nilsson library, because it gives me the opportunity to add some more form widgets to my Activity and easily customize the design rather than the other library.
This is what your looking for
Works for all AbsListView. I've implemented both ListView and GridView.
GridView doesn't support HeaderView. But Google implemented their own GridView, they use it only for internal purposes. This can solve your problem HeaderView

How to implement pull to refresh with Android's Gallery view

I wanna implement pull to refresh event with Android's Gallery view like IOS application name "500px" how to do this, or I should use HorizontalScrollView instead of Gallery ?
Update
Chris Banes Pull-to-refresh library now implements horizontal pull-to-refresh.
end Update
I'm not aware of any components with horizontal pull-to-refresh available on github or anywhere googleable.
To create your own component, have a look at these pull-to-refresh components and their source code as a starting point. Just check their licenses before you implement anything:
Pull To Refresh for Android by Johan Nilsson. The component extends ListView directly which makes the source straightforward to understand if you've worked with Android's ListView before.
Android-PullToRefresh by Chris Banes. It includes many features including pull-up-to-get-older and a double pull-up pull-down state. This is perhaps not the right starting point IMHO if you want to implement only pull-to-refresh since it's so comprehensive, but can be of interest if you want to build something really feature-rich.

How to create a tree view in Android?

There are no controls in Android that provide Tree-like View. There is an ExpandableList View which I suspect could be used to creating one.
Have you tried imlpementing such a control?
How would one implement such a control in Android?
Our company just open-sourced a small widget that is doing just that... You can see all the sources and add the project (as a library) to your own android project:
http://code.google.com/p/tree-view-list-android/
take a look at ExpandableListView. Besides, see following thread:
http://www.mail-archive.com/android-beginners#googlegroups.com/msg03587.html
this solutions are, very complicate. but can use a ExpandableListView of more levels.
Example: How to implement multilevel ExpandableListview in Android?

Categories

Resources