Skip to content

Commit 248c59d

Browse files
Repakaging cards-recyclerview module
1 parent e169779 commit 248c59d

36 files changed

+148
-99
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Version 2.0.0 *(2014-XX-XX)*
55
----------------------------
66
* LIB: Added the new **CardViewNative**![(Learn how to migrate your cards)](/doc/MIGRATE)
77
* LIB: New aar modules. [(doc)[(BUILD.md#including-in-your-project-with-gradle)
8+
* LIB-RECYCLERVIEW: Ner module with support for the new RecyclerView
89
* LIB: Added a CardRecyclerView and a CardArrayRecyclerViewAdapter [(doc)](/doc/CARDRECYCLERVIEW.md)
910
* LIB-CARDS: New module with built-in cards.
1011
* LIB-CARDS: Material Cards [(doc)](/doc/MATERIALCARD.md)

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,17 @@ Card Library is pushed to Maven Central as an AAR, so you just need to add the f
5656
//Core
5757
compile 'com.github.gabrielemariotti.cards:cardslib-core:2.0.0'
5858
59+
//Optional for RecyclerView
60+
compile 'com.github.gabrielemariotti.cards:cardslib-recyclerview:2.0.0'
61+
5962
//Optional for built-in cards
6063
compile 'com.github.gabrielemariotti.cards:cardslib-cards:2.0.0'
6164
6265
//Optional for staggered grid view
6366
compile 'com.github.gabrielemariotti.cards:cardslib-extra-staggeredgrid:2.0.0'
6467
65-
//Optional for twoway
66-
compile 'com.github.gabrielemariotti.cards:cardslib-extra-twoway:2.0.0'
68+
//Optional for twoway (coming soon)
69+
//compile 'com.github.gabrielemariotti.cards:cardslib-extra-twoway:2.0.0'
6770
6871
//Optional for drag and drop
6972
compile 'com.github.gabrielemariotti.cards:cardslib-extra-dragdrop:2.0.0'

demo/extras/src/main/java/it/gmariotti/cardslib/demo/extras/fragment/nativeview/GoogleProgressFragment.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
import it.gmariotti.cardslib.library.internal.CardHeader;
4242
import it.gmariotti.cardslib.library.internal.CardThumbnail;
4343
import it.gmariotti.cardslib.library.internal.base.BaseCard;
44-
import it.gmariotti.cardslib.library.internal.recyclerview.CardArrayRecyclerViewAdapter;
45-
import it.gmariotti.cardslib.library.view.CardRecyclerView;
44+
import it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter;
45+
import it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView;
4646

4747
/**
4848
* @author Gabriele Mariotti (gabri.mariotti@gmail.com)

demo/extras/src/main/java/it/gmariotti/cardslib/demo/extras/fragment/nativeview/NativeFabFragment.java

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ public void onActivityCreated(Bundle savedInstanceState) {
8585
if (listView!=null){
8686
listView.setAdapter(mCardArrayAdapter);
8787
}
88-
FloatingActionButton.FabOnScrollListener fabScrollListener = new FloatingActionButton.FabOnScrollListener();
8988

9089
FloatingActionButton floatingActionButton = (FloatingActionButton) getActivity().findViewById(R.id.button_floating_action);
9190
floatingActionButton.attachToListView(listView);

demo/extras/src/main/java/it/gmariotti/cardslib/demo/extras/fragment/twowayview/List2wayFragment.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
import it.gmariotti.cardslib.demo.extras.fragment.BaseListFragment;
3535
import it.gmariotti.cardslib.library.extra.twoway.view.CardTwowayView;
3636
import it.gmariotti.cardslib.library.internal.Card;
37-
import it.gmariotti.cardslib.library.internal.recyclerview.CardArrayRecyclerViewAdapter;
37+
import it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter;
38+
3839

3940
/**
4041
* This example uses a staggered card with different different photos and text.

demo/extras/src/main/java/it/gmariotti/cardslib/demo/extras/fragment/twowayview/SpannableGrid2wayFragment.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
import it.gmariotti.cardslib.library.internal.CardHeader;
4545
import it.gmariotti.cardslib.library.internal.CardThumbnail;
4646
import it.gmariotti.cardslib.library.internal.base.BaseCard;
47-
import it.gmariotti.cardslib.library.internal.recyclerview.CardArrayRecyclerViewAdapter;
47+
import it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter;
48+
4849

4950
/**
5051
* This example uses a staggered card with different different photos and text.

demo/extras/src/main/java/it/gmariotti/cardslib/demo/extras/fragment/twowayview/StaggeredGrid2wayFragment.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
import it.gmariotti.cardslib.library.extra.twoway.view.CardTwowayView;
4444
import it.gmariotti.cardslib.library.internal.Card;
4545
import it.gmariotti.cardslib.library.internal.CardThumbnail;
46-
import it.gmariotti.cardslib.library.internal.recyclerview.CardArrayRecyclerViewAdapter;
46+
import it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter;
47+
4748

4849
/**
4950
* This example uses a staggered card with different different photos and text.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<!--
4+
~ *******************************************************************************
5+
~ Copyright (c) 2013-2014 Gabriele Mariotti.
6+
~
7+
~ Licensed under the Apache License, Version 2.0 (the "License");
8+
~ you may not use this file except in compliance with the License.
9+
~ You may obtain a copy of the License at
10+
~
11+
~ http://www.apache.org/licenses/LICENSE-2.0
12+
~
13+
~ Unless required by applicable law or agreed to in writing, software
14+
~ distributed under the License is distributed on an "AS IS" BASIS,
15+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
~ See the License for the specific language governing permissions and
17+
~ limitations under the License.
18+
~ *****************************************************************************
19+
-->
20+
21+
<selector xmlns:android="http://schemas.android.com/apk/res/android"
22+
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
23+
<item>
24+
<shape android:shape="oval">
25+
<solid android:color="#FFFFFF" />
26+
</shape>
27+
</item>
28+
</selector>

demo/extras/src/main/res/layout/demo_extras_fragment_googleprogress.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
android:layout_width="match_parent"
2424
android:layout_height="match_parent">
2525

26-
<it.gmariotti.cardslib.library.view.CardRecyclerView
26+
<it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView
2727
android:layout_width="match_parent"
2828
android:layout_height="match_parent"
2929
card:list_card_layout_resourceID="@layout/carddemo_extras_list_card_progress_layout"

demo/stock/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ dependencies {
4545
// Cards Library
4646
compile project(':library-core')
4747
compile project(':library-cards')
48+
compile project(':library-recyclerview')
4849
// Support Libraries
4950
compile 'com.android.support:support-v4:21.0.0'
5051
compile 'com.android.support:appcompat-v7:21.0.0'

demo/stock/src/main/java/it/gmariotti/cardslib/demo/fragment/nativeview/NativeRecyclerViewFragment.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@
3535
import it.gmariotti.cardslib.library.internal.CardExpand;
3636
import it.gmariotti.cardslib.library.internal.CardHeader;
3737
import it.gmariotti.cardslib.library.internal.base.BaseCard;
38-
import it.gmariotti.cardslib.library.internal.recyclerview.CardArrayRecyclerViewAdapter;
39-
import it.gmariotti.cardslib.library.view.CardRecyclerView;
38+
import it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter;
39+
import it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView;
40+
4041

4142
/**
4243
* @author Gabriele Mariotti (gabri.mariotti@gmail.com)

demo/stock/src/main/java/it/gmariotti/cardslib/demo/fragment/v1/RecyclerViewFragment.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
import it.gmariotti.cardslib.library.internal.CardExpand;
3636
import it.gmariotti.cardslib.library.internal.CardHeader;
3737
import it.gmariotti.cardslib.library.internal.base.BaseCard;
38-
import it.gmariotti.cardslib.library.internal.recyclerview.CardArrayRecyclerViewAdapter;
39-
import it.gmariotti.cardslib.library.view.CardRecyclerView;
38+
import it.gmariotti.cardslib.library.recyclerview.internal.CardArrayRecyclerViewAdapter;
39+
import it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView;
4040

4141
/**
4242
* @author Gabriele Mariotti (gabri.mariotti@gmail.com)

demo/stock/src/main/res/layout/demo_fragment_native_recyclerview.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
android:paddingRight="12dp"
5555
android:layout_height="match_parent">
5656

57-
<it.gmariotti.cardslib.library.view.CardRecyclerView
57+
<it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView
5858
android:layout_width="match_parent"
5959
android:layout_height="match_parent"
6060
card:list_card_layout_resourceID="@layout/native_recyclerview_card_layout"

demo/stock/src/main/res/layout/demo_fragment_recyclerview.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
android:layout_width="match_parent"
5353
android:layout_height="match_parent">
5454

55-
<it.gmariotti.cardslib.library.view.CardRecyclerView
55+
<it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView
5656
android:layout_width="match_parent"
5757
android:layout_height="match_parent"
5858
card:list_card_layout_resourceID="@layout/list_card_layout"

demo/stock/src/main/res/values/colors.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,5 @@
7878
<color name="navdrawer_scrim">#6000</color>
7979

8080
<color name="carddemo_halfcolored_color">#109D58</color>
81-
<color name="carddemo_blackcolored_color">#000000</color>
81+
<color name="carddemo_blackcolored_color">#272727</color>
8282
</resources>

doc/BUILD.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ Card Library is pushed to Maven Central as a AAR, so you just need to add the fo
1919
//Core card library
2020
compile 'com.github.gabrielemariotti.cards:cardslib-core:2.0.0'
2121
22+
//Optional for RecyclerView
23+
compile 'com.github.gabrielemariotti.cards:cardslib-recyclerview:2.0.0'
24+
2225
//Optional for built-in cards
2326
compile 'com.github.gabrielemariotti.cards:cardslib-cards:2.0.0'
2427
2528
//Optional for staggered grid view support
2629
compile 'com.github.gabrielemariotti.cards:cardslib-extra-staggeredgrid:2.0.0'
2730
28-
//Optional for twowayview support
29-
compile 'com.github.gabrielemariotti.cards:cardslib-extra-twoway:2.0.0'
31+
//Optional for twowayview support (coming soon)
32+
//compile 'com.github.gabrielemariotti.cards:cardslib-extra-twoway:2.0.0'
3033
3134
//Optional for drag and drop support
3235
compile 'com.github.gabrielemariotti.cards:cardslib-extra-dragdrop:2.0.0'

doc/CARDRECYCLERVIEW.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,24 @@
22

33
In this page you can find info about:
44

5+
* [Intro](#intro)
56
* [Creating a base CardRecyclerView](#creating-a-base-cardrecyclerview)
67
* [Use your custom layout for each row](#use-your-custom-layout-for-each-row)
78
* [Style](#style)
89

10+
### Intro
11+
12+
> **PAY ATTENTION:** to use this feature you have to use the **library-recyclerview**.
13+
> [for more info](GUIDE.md#including-in-your-project).
14+
915
### Creating a base CardRecyclerView
1016

1117
Creating a `CardRecyclerView` is pretty simple.
1218

1319
First, you need an XML layout that will display the `CardRecyclerView`.
1420

1521
``` xml
16-
<it.gmariotti.cardslib.library.view.CardRecyclerView
22+
<it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView
1723
android:layout_width="match_parent"
1824
android:layout_height="match_parent"
1925
card:list_card_layout_resourceID="@layout/native_recyclerview_card_layout"
@@ -75,7 +81,7 @@ For the `CardView`:
7581
You can customize the layout used for each item in the RecyclerView using the attr: `card:list_card_layout_resourceID="@layout/my_layout`
7682

7783
``` xml
78-
<it.gmariotti.cardslib.library.view.CardRecyclerView
84+
<it.gmariotti.cardslib.library.recyclerview.view.CardRecyclerView
7985
android:layout_width="match_parent"
8086
android:layout_height="match_parent"
8187
android:id="@+id/carddemo_list_gplaycard"

doc/GUIDE.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ Card Library is pushed to Maven Central as an AAR, so you just need to add the f
1818
//Core card library
1919
compile 'com.github.gabrielemariotti.cards:cardslib-core:2.0.0'
2020
21+
//Optional for RecyclerView
22+
compile 'com.github.gabrielemariotti.cards:cardslib-recyclerview:2.0.0'
23+
2124
//Optional for built-in cards
2225
compile 'com.github.gabrielemariotti.cards:cardslib-cards:2.0.0'
2326
2427
//Optional for staggered grid view support
2528
compile 'com.github.gabrielemariotti.cards:cardslib-extra-staggeredgrid:2.0.0'
2629
27-
//Optional for twowayview support
28-
compile 'com.github.gabrielemariotti.cards:cardslib-extra-twoway:2.0.0'
30+
//Optional for twowayview support (coming soon)
31+
//compile 'com.github.gabrielemariotti.cards:cardslib-extra-twoway:2.0.0'
2932
3033
//Optional for drag and drop support
3134
compile 'com.github.gabrielemariotti.cards:cardslib-extra-dragdrop:2.0.0'

extra/extra-twoway/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ android {
2727
dependencies {
2828
// Cards Library
2929
compile project(':library-core')
30+
compile project(':library-recyclerview')
3031

3132
//Twowayview
32-
compile 'com.android.support:recyclerview-v7:21.0.0'
3333
compile 'org.lucasr.twowayview:core:1.0.0-SNAPSHOT@aar'
3434
compile 'org.lucasr.twowayview:layouts:1.0.0-SNAPSHOT@aar'
3535

extra/extra-twoway/src/main/java/it/gmariotti/cardslib/library/extra/twoway/view/CardTwowayView.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.lucasr.twowayview.widget.TwoWayView;
2727

2828
import it.gmariotti.cardslib.library.extra.twoway.R;
29-
import it.gmariotti.cardslib.library.internal.recyclerview.BaseRecyclerViewAdapter;
29+
import it.gmariotti.cardslib.library.recyclerview.internal.BaseRecyclerViewAdapter;
3030

3131

3232
/**

library-core/build.gradle

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ android {
2323
}
2424

2525
dependencies {
26+
//CardView
2627
compile 'com.android.support:cardview-v7:21.0.0'
27-
compile 'com.android.support:recyclerview-v7:21.0.0'
28+
29+
//Support lib
30+
compile 'com.android.support:support-v4:21.0.0'
31+
32+
//Annotation
33+
compile 'com.android.support:support-annotations:21.0.0'
2834
}
2935

3036
// Used to update in Maven

library-core/src/main/res/values/styles.xml

-15
Original file line numberDiff line numberDiff line change
@@ -393,22 +393,7 @@
393393
</style>
394394

395395

396-
<!--Recycler view-->
397-
<style name="native_recyclerview_card">
398-
<item name="android:layout_marginLeft">@dimen/native_recyclerview_card_margin_left</item>
399-
<item name="android:layout_marginRight">@dimen/native_recyclerview_card_margin_right</item>
400-
<item name="android:layout_marginBottom">@dimen/native_recyclerview_card_margin_bottom</item>
401-
<item name="android:layout_marginTop">@dimen/native_recyclerview_card_margin_top</item>
402-
</style>
403-
404-
<style name="native_recyclerview_card.base" >
405-
406-
</style>
407396

408-
<!-- Thumbnail list -->
409-
<style name="native_recyclerview_card.thumbnail">
410-
411-
</style>
412397

413398

414399
<style name="grid_card">

library-extra/gradle.properties

-3
This file was deleted.

library-extra/src/main/AndroidManifest.xml

-28
This file was deleted.
File renamed without changes.

library-extra/build.gradle library-recyclerview/build.gradle

+4-8
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,12 @@ android {
2424

2525
dependencies {
2626
// Cards Library
27-
compile project(':library')
27+
compile project(':library-core')
28+
2829
//Annotation
2930
compile 'com.android.support:support-annotations:21.0.0'
30-
//StaggeredGrid
31-
compile 'com.etsy.android.grid:library:1.0.5'
32-
//DynamicList
33-
compile ('com.nhaarman.listviewanimations:lib-core:3.1.0')
34-
compile ('com.nhaarman.listviewanimations:lib-manipulation:3.1.0')
35-
36-
31+
//Recycler View
32+
compile 'com.android.support:recyclerview-v7:21.0.0'
3733
}
3834

3935
// Used to update in Maven
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_NAME=Card Library
2+
POM_ARTIFACT_ID=cardslib-recyclerview
3+
POM_PACKAGING=aar
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
21
<!--
3-
~ /*******************************************************************************
4-
~ Copyright (c) 2014 Gabriele Mariotti.
2+
~ *******************************************************************************
3+
~ Copyright (c) 2013-2014 Gabriele Mariotti.
54
~
65
~ Licensed under the Apache License, Version 2.0 (the "License");
76
~ you may not use this file except in compliance with the License.
@@ -14,10 +13,16 @@
1413
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1514
~ See the License for the specific language governing permissions and
1615
~ limitations under the License.
17-
~ ******************************************************************************/
16+
~ *****************************************************************************
1817
-->
1918

20-
<lint>
21-
<!-- Disable MissingTranslation: Incomplete translation -->
22-
<issue id="MissingTranslation" severity="ignore" />
23-
</lint>
19+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
20+
package="it.gmariotti.cardslib.library.recyclerview">
21+
22+
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
23+
24+
<application>
25+
26+
</application>
27+
28+
</manifest>

0 commit comments

Comments
 (0)