Skip to content

Commit

Permalink
Prepared 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielemariotti committed Nov 19, 2013
1 parent 5c826b0 commit dddfe60
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 22 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
Change Log
===============================================================================

Version 0.9.0 *(2013-11-XX)*
Version 0.9.0 *(2013-11-19)*
----------------------------
* LIB: Added a CardCursorAdapter [(doc)](https://github.com/gabrielemariotti/cardslib/tree/master/doc/CARDLIST.md#using-a-cursor-adapter)
* LIB: Fixed issue collapsing cards when you don't have enough items to fill the screen.
* DEMO: Added an example with CardCursorAdapter [(source)](https://github.com/gabrielemariotti/cardslib/tree/master/demo/stock/src/main/java/it/gmariotti/cardslib/demo/fragment/ListCursorCardFragment.java)
* DEMO-extras: Added an example with [Crouton by Benjamin Weiss](https://github.com/keyboardsurfer/Crouton) [(doc)](https://github.com/gabrielemariotti/cardslib/tree/master/doc/OTHERLIBRARIES.md#using-card-as-a-crouton)
* DEMO-extras: Updated ActionBar-PullToRefresh example to new API (0.9)
* DEMO-extras: Updated ActionBar-PullToRefresh example to new API (0.9.1)
* DEMO-extras: minor fixes


Version 0.8.0 *(2013-11-11)*
----------------------------

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Card Library provides 3 custom tags:

## Usage

Creating a `Card` is is pretty simple.
Creating a `Card` is pretty simple.

First, you need an XML layout that will display the `Card`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@
import android.database.Cursor;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import it.gmariotti.cardslib.demo.R;
import it.gmariotti.cardslib.demo.cards.CustomExpandCard;
import it.gmariotti.cardslib.demo.db.CardCursorContract;
import it.gmariotti.cardslib.library.internal.Card;
import it.gmariotti.cardslib.library.internal.CardCursorAdapter;
import it.gmariotti.cardslib.library.internal.CardHeader;
import it.gmariotti.cardslib.library.internal.CardThumbnail;
import it.gmariotti.cardslib.library.internal.base.BaseCard;
import it.gmariotti.cardslib.library.view.CardListView;

/**
Expand Down Expand Up @@ -119,17 +120,17 @@ protected Card getCardFromCursor(Cursor cursor) {
//Set the header title

header.setTitle(card.mainHeader);

//Set visible the expand/collapse button
header.setButtonExpandVisible(true);
header.setPopupMenu(R.menu.popupmain, new CardHeader.OnClickCardHeaderPopupMenuListener() {
@Override
public void onMenuItemClick(BaseCard card, MenuItem item) {
Toast.makeText(getContext(), "Click on card menu" + ((MyCursorCard)card).mainTitle +" item=" + item.getTitle(), Toast.LENGTH_SHORT).show();
}
});

//Add Header to card
card.addCardHeader(header);

//This provides a simple (and useless) expand area
CustomExpandCard expand = new CustomExpandCard(getActivity().getApplicationContext());
//Add Expand Area to Card
card.addCardExpand(expand);


CardThumbnail thumb = new CardThumbnail(getActivity().getApplicationContext());
thumb.setDrawableResource(card.resourceIdThumb);
Expand All @@ -138,7 +139,7 @@ protected Card getCardFromCursor(Cursor cursor) {
card.setOnClickListener(new Card.OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
Toast.makeText(getContext(),"Card id="+card.getId()+ " Title="+card.getTitle(),Toast.LENGTH_SHORT).show();
Toast.makeText(getContext(), "Card id=" + card.getId() + " Title=" + card.getTitle(), Toast.LENGTH_SHORT).show();
}
});

Expand Down
16 changes: 8 additions & 8 deletions doc/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ Card Library is pushed to Maven Central as a AAR, so you just need to add the fo

## Reference this project as a library in Eclipse

if you would like to use this library in Eclipse you have to do these steps:
If you would like to use this library in Eclipse you have to do these steps:

- clone a copy of this repository, or download it.
- import the code in your workspace
- mark java(*) folder as source (click on folder -> Build-Path -> use as source folder)
- mark Library as Android Library (Properties -> Android -> Is library)
- clone a copy of this repository, or download it (outside eclipse workspace)
- import the code in your workspace starting from library folder. The Wizard will import the code in library/src/main. I suggest you to name it "cardslib" (or another name) instead of "main".
- mark java(*) folder as source (click on folder -> Build-Path -> use as source folder). You can also remove the src folder, from the project.
- mark cardslib as Android Library (Properties -> Android -> Is library)
- The library targets SDK 19 and works with minSdk=14. In any cases you need to use API>=16 to compile library (Properties -> Android)


If you would like to build the demo-stock you have to do these additional steps:

- import the demo-code in your workspace
- import the demo-code in your workspace starting from demo/stock folder.
- mark java(*) folder as source
- mark aidl(*) folder as source
- add support library v4 rel.18 ( click -> Android Tools -> Add support library , or just copy android-support-v4.jar in libs folder)
- add Library as dependency ( click -> Properties -> Android -> Add library)
- add support library v4 rel.19 ( click -> Android Tools -> Add support library , or just copy android-support-v4.jar in libs folder)
- add cardslib as dependency ( click -> Properties -> Android -> Add library)
- The demo-stock targets SDK 19 and works with minSdk=14. In any cases you need to use API>=16 to compile it


Expand Down
3 changes: 3 additions & 0 deletions doc/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ Last get a reference to the `CardListView` from your code, and set your adapter:
listView.setAdapter(mCardArrayAdapter);
```

Also the `CardListView` can work with a `CardCursorAdapter`.


See this [page](https://github.com/gabrielemariotti/cardslib/tree/master/doc/CARDLIST.md) for more info.


Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_NAME=0.8.1-SNAPSHOT
VERSION_CODE=16
VERSION_NAME=0.9.1-SNAPSHOT
VERSION_CODE=20
GROUP=com.github.gabrielemariotti.cards

POM_DESCRIPTION=Android Library to build a UI Card
Expand Down

0 comments on commit dddfe60

Please sign in to comment.