Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaarman committed Sep 5, 2013
1 parent b07e978 commit 79b838f
Showing 1 changed file with 13 additions and 69 deletions.
82 changes: 13 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ ListViewAnimations ([Play Store Demo][1])

ListViewAnimations is an Open Source Android library that allows developers to easily create ListViews with animations.
Feel free to use it all you want in your Android apps provided that you cite this project and include the license in your app.

ListViewAnimations uses the [NineOldAndroids][2] library to support devices <3.0.
It also uses Roman Nurik's BETA [SwipeDismissListViewTouchListener][5] to support swipe to dismiss.

Version 2.0 now supports GridViews! (And other implementations of AbsListView)
It also contains an ExpandableListItemAdapter for smoothly expanding your Views!
A mention to haarman.niek [at] gmail.com about your app using this library is very welcome! Start your message's title with `[LVA]`.

Known applications using ListViewAnimations
-----
Expand All @@ -18,7 +13,7 @@ Known applications using ListViewAnimations
* Car Hire ([Play Store][10])
* Super BART ([Play Store][11])

If you want your app to be listed as well please contact me via [Google Plus][8]!
If you want your app to be listed as well please contact me via [Google Plus][8], or send me an email at haarman.niek [at] gmail.com, starting the title with `[LVA]`.

Setup
-----
Expand All @@ -29,70 +24,11 @@ Setup
Or:

* [Download the .jar file][4]
* Add the .jar to your project's `libs` folder.
* Add the .jar to your project's `libs` folder, or add it as an external jar to your project's build path.

Usage
-----
This library uses the [Decorator Pattern][3] to stack multiple `BaseAdapterDecorator`s on each other:

* Implement your own `BaseAdapter`, or reuse an existing one.
* Stack multiple `BaseAdapterDecorator`s on each other, with your `BaseAdapter` as a base.
* Set the `ListView` to your last `BaseAdapterDecorator`.
* Set your last `BaseAdapterDecorator` to the `ListView`.

Example:
-----

/* This example will stack two animations on top of eachother */
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

MyListAdapter mAdapter = new MyListAdapter(this, getItems());
SwingBottomInAnimationAdapter swingBottomInAnimationAdapter = new SwingBottomInAnimationAdapter(mAdapter);
SwingRightInAnimationAdapter swingRightInAnimationAdapter = new SwingRightInAnimationAdapter(swingBottomInAnimationAdapter);
// Or in short notation:
swingRightInAnimationAdapter =
new SwingRightInAnimationAdapter(
new SwingBottomInAnimationAdapter(
new MyListAdapter(this, getItems())));
// Assign the ListView to the AnimationAdapter and vice versa
swingRightInAnimationAdapter.setAbsListView(getListView());
getListView().setAdapter(swingRightInAnimationAdapter);
}

private class MyListAdapter extends com.haarman.listviewanimations.ArrayAdapter<String> {

private Context mContext;

public MyListAdapter(Context context, ArrayList<String> items) {
super(items);
mContext = context;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView tv = (TextView) convertView;
if (tv == null) {
tv = (TextView) LayoutInflater.from(mContext).inflate(R.layout.list_row, parent, false);
}
tv.setText(getItem(position));
return tv;
}
}

Custom AnimationAdapters
-----
Instead of using the ready-made adapters in the `.swinginadapters.prepared` package, you can also implement your own `AnimationAdapter`.
Implement one of the following classes:

* `ResourceAnimationAdapter`
* `SingleAnimationAdapter`
* `AnimationAdapter`

See the examples.
Please refer to the [Wiki][13] pages to learn more about how to use this library.

Contribute
-----
Expand All @@ -102,6 +38,12 @@ Developed By
-----
* Niek Haarman

Special thanks
-----
* Roman Nurik - The ListViewAnimations library uses a modified version of his [SwipeDismissListViewTouchListener][5] to support swipe-to-dismiss.
* Jake Warthon - To support devices pre-HC (<3.0), a jar file of [NineOldAndroids][2] is included.
* Emil Sjölander - If you're already using the [StickyListHeaders][14] library, the ListViewAnimations library makes sure your header views are animated as well. Therefore, a copy of the StickyListHeaders jar file is included.

License
-----

Expand All @@ -122,7 +64,7 @@ License
[1]: https://play.google.com/store/apps/details?id=com.haarman.listviewanimations
[2]: http://nineoldandroids.com/
[3]: http://en.wikipedia.org/wiki/Decorator_pattern
[4]: https://github.com/nhaarman/ListViewAnimations/blob/master/com.haarman.listviewanimations-2.2.3.jar?raw=true
[4]: https://github.com/nhaarman/ListViewAnimations/blob/master/com.haarman.listviewanimations-2.3.0.jar?raw=true
[5]: https://gist.github.com/romannurik/2980593
[6]: https://play.google.com/store/apps/details?id=com.haarman.treinverkeer
[7]: https://www.twitter.com/niekfct
Expand All @@ -131,3 +73,5 @@ License
[10]: https://play.google.com/store/apps/details?id=com.rentalcars.handset
[11]: https://play.google.com/store/apps/details?id=com.getgoodcode.bart
[12]: https://play.google.com/store/apps/details?id=com.haarman.ultimatettt
[13]: https://github.com/nhaarman/ListViewAnimations/wiki
[14]: http://emilsjolander.github.io/StickyListHeaders/

0 comments on commit 79b838f

Please sign in to comment.