kikoso/Swipeable-Cards — pull request #5 by Dr-Emann (2014-05-30 17:05:04+00:00)
Title: Some Fixes

# Do not merge #

Putting this up for early feedback and review. Feel free to try it out, and let me know what you think, and especially if you find any bugs.

## Major Changes ##
### CardContainer became an AdapterView ###
Fixes #4. Allows user to specify children more dynamically.

### CardContainer controls children's movement ###
This removes the need for a custom View for cards. Fits with allowing custom cards. Also, allows children to contain buttons and react to touches itself.

Additionally, cards now use a fling gesture to remove them, this seemed to match expectations better than removing if released at a certain position, regardless of current motion.

### Several possible base adapters ###
* BaseCardStackAdapter can be used to specify the adapter from scratch.
* CardStackAdapter is a subclass of BaseCardStackAdapter. It provides a stack-like interface of CardModels (add, pop), and only requires the user to override `getCardView(int position, CardModel model, View convertView, ViewGroup parent)`. It will automatically wrap the returned View in a card.
* SimpleCardStackAdapter extends CardStackAdapter, providing an implementation that returns a standard card view, with a title, image, description, and 2 buttons.

### CardContainer Optimization ###
* Cards are rendered with a software layer, which *GREATLY* increases performance. The top card is instead rendered into a hardware layer for even faster movement (the gpu is really fast at simple translation and rotation).
* Using the new animation system (this could be moved to [nineoldandroids](http://nineoldandroids.com/) for support of old Android versions)
* The layout of a card is flatter, with a relative layout instead of nested linear layouts.
* The stack has a maximum number of views it will show at a time. This is currently 10, but it should probably be dynamic based on the speed of the device.

> TODO: time dispatchDraw(), and use that to tune this

## Minor Changes ##

### CardContainer has custom XML attributes ###
* Support for android:gravity to specify where in the container cards should be put
* orientation, with 2 possible values: `ordered` and `disordered`

### CardModel ###
* Added title and description properties.
* Takes a Drawable, instead of a resource id. This allows for the use of custom images (e.g. downloaded from the internet), while still allowing Drawables from resources.

> NOTE: consider adding a constructor that takes a Context and a resource id

### Orientation ###
* Remove value, recommend using `.index()` instead.
* Rotation is now random
> NOTE: Might need to store rotations, in case of dataSetChanged