diff --git a/README.md b/README.md index 9dcadf0..9017296 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ In order to use MaterialList, you can either clone the project and import it as ```groovy dependencies { ... - compile 'com.github.dexafree:materiallist:2.1.1' + compile 'com.github.dexafree:materiallist:2.2.0' } ``` @@ -188,6 +188,7 @@ You can clone the project and compile it yourself (it includes a sample), or you ## Collaborations * [Fabio Hellmann](https://github.com/FHellmann): Great pull request that added MaterialStaggeredGridView, animations, and refactored a lot of code. Thank you very much, really! +* [Ricardo Romero](https://github.com/RicardoRB): Integrating Picasso to the library ## Credits * Jake Wharton: [SwipeToDismissNOA](https://github.com/JakeWharton/SwipeToDismissNOA) diff --git a/app/build.gradle b/app/build.gradle index be97695..66362c1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -21,8 +21,8 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - //compile project(':materialList') - compile 'com.github.dexafree:materiallist:2.1.1' + compile project(':materialList') + //compile 'com.github.dexafree:materiallist:2.1.1' //compile 'com.github.dexafree:materiallist-cards:2.0.7' compile 'com.android.support:appcompat-v7:21.0.3' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fef990c..19dba8a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,8 @@ + + - + android:id="@+id/material_listview"/> - + \ No newline at end of file diff --git a/build.gradle b/build.gradle index d1a1b61..ed0d49b 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.0' + classpath 'com.android.tools.build:gradle:1.0.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle.properties b/gradle.properties index ba404ae..da8a29a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,8 +17,8 @@ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -VERSION_NAME=2.1.1 -VERSION_CODE=211 +VERSION_NAME=2.2.0 +VERSION_CODE=220 GROUP=com.github.dexafree POM_DESCRIPTION=Android library aimed to get the beautiful CardViews that Google shows at its official design specifications diff --git a/materialList/build.gradle b/materialList/build.gradle index 5833cd3..1dbe41e 100644 --- a/materialList/build.gradle +++ b/materialList/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 10 targetSdkVersion 21 - versionCode 211 - versionName "2.1.1" + versionCode 220 + versionName "2.2.0" } buildTypes { release { diff --git a/materialList/src/main/java/com/dexafree/materialList/controller/MaterialInterface.java b/materialList/src/main/java/com/dexafree/materialList/controller/MaterialInterface.java deleted file mode 100644 index f3ea822..0000000 --- a/materialList/src/main/java/com/dexafree/materialList/controller/MaterialInterface.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.dexafree.materialList.controller; - -import android.content.Context; -import android.view.MotionEvent; -import android.view.View; - -import com.dexafree.materialList.MaterialAdapter; - -public interface MaterialInterface { - - int getWidth(); - View getChildAt(int position); - void getLocationOnScreen(int[] listViewCoords); - int getPositionForView(View downView); - MaterialAdapter getMaterialAdapter(); - void requestDisallowInterceptTouchEvent(boolean disallow); - boolean onTouchEvent(MotionEvent cancelEvent); - Context getContext(); - int getChildCount(); - -} diff --git a/materialList/src/main/java/com/dexafree/materialList/view/MaterialGridView.java b/materialList/src/main/java/com/dexafree/materialList/view/MaterialGridView.java deleted file mode 100644 index 2963c90..0000000 --- a/materialList/src/main/java/com/dexafree/materialList/view/MaterialGridView.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.dexafree.materialList.view; - -import android.content.Context; -import android.util.AttributeSet; -import android.widget.GridView; - -import com.dexafree.materialList.MaterialAdapter; -import com.dexafree.materialList.controller.MaterialInterface; -import com.dexafree.materialList.controller.OnDismissCallback; -import com.dexafree.materialList.controller.SwipeDismissListener; -import com.dexafree.materialList.model.Card; - -public class MaterialGridView extends GridView implements MaterialInterface { - - private MaterialAdapter mAdapter; - private OnDismissCallback mDismissCallback; - - public MaterialGridView (Context context) { - super (context); - } - - public MaterialGridView (Context context, AttributeSet attrs, int defStyle) { - super (context, attrs, defStyle); - } - - public MaterialGridView (Context context, AttributeSet attrs) { - super (context, attrs); - } - - public void setMaterialListViewAdapter (MaterialAdapter adapter) { - - mAdapter = adapter; - setAdapter (mAdapter); - setDefaultListeners(); - - } - - public MaterialAdapter getMaterialAdapter(){ - return mAdapter; - } - - public void setOnDismissCallback (OnDismissCallback callback) { - - mDismissCallback = callback; - - } - - private void setDefaultListeners () { - - SwipeDismissListener touchListener = - new SwipeDismissListener( - this, - new SwipeDismissListener.OnDismissCallback () { - - @Override - public void onDismiss (MaterialInterface listView, int[] reverseSortedPositions) { - - for (int position : reverseSortedPositions) { - - if(position < listView.getMaterialAdapter().getCount()) { - - Card currentCard = mAdapter.getItem(position); - - if (mDismissCallback != null) { - - mDismissCallback.onDismiss(currentCard, position); - - } - - mAdapter.remove(currentCard); - } - - } - - mAdapter.notifyDataSetChanged(); - - } - - }); - - setOnTouchListener (touchListener); - setOnScrollListener (touchListener.makeScrollListener()); - } -}