diff --git a/.travis.yml b/.travis.yml index 5095d0f85..db0c4fd5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,10 @@ android: - tools # The BuildTools version used by your project - - build-tools-24.0.1 + - build-tools-25.0.0 # The SDK version used to compile your project - - android-24 + - android-25 # Additional components - extra-google-m2repository diff --git a/FAQ/opening-drawer-from-espresso.md b/FAQ/opening-drawer-from-espresso.md index 5fb7459ba..b3e1d8e40 100644 --- a/FAQ/opening-drawer-from-espresso.md +++ b/FAQ/opening-drawer-from-espresso.md @@ -7,4 +7,4 @@ First, you need a add `espresso-contrib` to your project. It has the needed `Dra Then, you need to open the drawer with his `openDrawer()` method and the drawer layout ID. The generated one is `R.id.material_drawer_layout` -`DrawerActions.openDrawer(R.id.material_drawer_layout);` +`onView(withId(R.id.material_drawer_layout)).perform(DrawerActions.open());` diff --git a/MIGRATION.md b/MIGRATION.md index 3469ffc5b..bfcaf6c51 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,5 +1,11 @@ ###Upgrade Notes +#### v5.7.0 +**IMPORTANT IF YOU IMPLEMENT CUSTOM-DRAWER-ITEMS OR USE THE FASTADAPTER** +* You have to update your `FastAdapter` dependency to v2.0.0 with this release +* If you have `CustomDrawerItem`'s not based on the `AbstractDrawerITems` make sure you implement the `unbindView` method, and the new required methods +* See the MIGRATION information of the **FastAdapter** https://github.com/mikepenz/FastAdapter/blob/develop/MIGRATION.md + #### v5.6.0 **IMPORTANT IF YOU IMPLEMENT CUSTOM-DRAWER-ITEMS OR USE THE FASTADAPTER** * This release brings a breaking interface change. Your items now have to implement `bindView(ViewHolder holder, List payloads)` instead of `bindView(VH holder)`. diff --git a/README.md b/README.md index 99f1cbeef..01563878c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ There is a Header with profiles (**AccountHeader**), a **MiniDrawer** for Table ###A quick overview what's in - **the easiest possible integration** - integrate in less than **5 minutes** -- compatible down to **API Level 10** +- compatible down to **API Level 14** - includes an **AccountSwitcher** - quick and simple api - follows the **Google Material Design Guidelines** @@ -52,7 +52,7 @@ You can find some frequently asked questions and other resources in the [WIKI / ##1. Provide the gradle dependency ```gradle -compile('com.mikepenz:materialdrawer:5.6.0@aar') { +compile('com.mikepenz:materialdrawer:5.7.0@aar') { transitive = true } ``` @@ -419,6 +419,10 @@ builder.withDrawerLayout(R.layout.material_drawer); * [Atmosphere](https://play.google.com/store/apps/details?id=com.peakpocketstudios.atmosphere) * [Slidechat](https://play.google.com/store/apps/details?id=com.taddu.adfree.slidechat) * [Fitness Challenge](https://play.google.com/store/apps/details?id=com.isidroid.fitchallenge) +* [European Capital of Culture - Pafos2017 official app](https://play.google.com/store/apps/details?id=com.trackandtalk.pafos17) +* [I'm Reading Quran - Kur'an Okuyorum](https://play.google.com/store/apps/details?id=com.homemade.kuranokuma) +* [Makota Money Manager](https://play.google.com/store/apps/details?id=be.jatra.makota) +* [Companion for Band](https://github.com/adithya321/Companion-for-Band) #Articles about the MaterialDrawer * [java-help.ru](http://java-help.ru/material-navigationdrawer/) diff --git a/app/build.gradle b/app/build.gradle index 51af8b129..2bc9b11f7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { defaultConfig { minSdkVersion setup.minSdk targetSdkVersion setup.targetSdk - versionCode 560 - versionName "5.6.0" + versionCode 570 + versionName "5.7.0" setProperty("archivesBaseName", "-v$versionName-c$versionCode") } diff --git a/build.gradle b/build.gradle index 130628588..3c3b69e8b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,11 @@ buildscript { ext { - setup = [compileSdk: 24, - buildTools: "24.0.1", + setup = [compileSdk: 25, + buildTools: "25.0.0", minSdk : 14, - targetSdk : 24] + targetSdk : 25] - versions = [supportLib: "24.2.0"] + versions = [supportLib: "25.0.0"] } repositories { @@ -13,7 +13,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.3' + classpath 'com.android.tools.build:gradle:2.2.2' classpath 'com.novoda:bintray-release:0.3.4' } } diff --git a/gradle.properties b/gradle.properties index f9ebe1515..34b3ebd26 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # Maven stuff -VERSION_NAME=5.6.0 -VERSION_CODE=560 +VERSION_NAME=5.7.0 +VERSION_CODE=570 GROUP=com.mikepenz POM_DESCRIPTION=MaterialDrawer Library POM_URL=https://github.com/mikepenz/MaterialDrawer diff --git a/library/build.gradle b/library/build.gradle index a519f4a3e..9b4136043 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion setup.minSdk targetSdkVersion setup.targetSdk - versionCode 560 - versionName '5.6.0' + versionCode 570 + versionName '5.7.0' } buildTypes { release { @@ -47,5 +47,5 @@ dependencies { // used to fill the RecyclerView with the DrawerItems // and provides single and multi selection, expandable items // https://github.com/mikepenz/FastAdapter - compile 'com.mikepenz:fastadapter:1.8.0@aar' + compile 'com.mikepenz:fastadapter:2.0.0@aar' } diff --git a/library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java b/library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java index a8f3a1689..986b6ef80 100644 --- a/library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java +++ b/library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java @@ -6,7 +6,6 @@ import android.view.View; import android.view.ViewGroup; -import com.mikepenz.fastadapter.IExpandable; import com.mikepenz.fastadapter.utils.IdDistributor; import com.mikepenz.fastadapter.utils.ViewHolderFactory; import com.mikepenz.materialdrawer.Drawer; @@ -22,7 +21,7 @@ /** * Created by mikepenz on 14.07.15. */ -public abstract class AbstractDrawerItem implements IDrawerItem, Selectable, Tagable, IExpandable { +public abstract class AbstractDrawerItem implements IDrawerItem, Selectable, Tagable { // the identifier for this item protected long mIdentifier = -1; @@ -186,6 +185,29 @@ public void onPostBindView(IDrawerItem drawerItem, View view) { } } + // the parent of this item + private IDrawerItem mParent; + + /** + * @return the parent of this item + */ + @Override + public IDrawerItem getParent() { + return mParent; + } + + /** + * the parent for this item + * + * @param parent it's parent + * @return this + */ + @Override + public IDrawerItem withParent(IDrawerItem parent) { + this.mParent = parent; + return this; + } + // the subItems to expand for this item protected List mSubItems; @@ -262,6 +284,7 @@ public boolean isAutoExpanding() { */ public abstract ViewHolderFactory getFactory(); + /** * generates a view by the defined LayoutRes * @@ -289,6 +312,16 @@ public View generateView(Context ctx, ViewGroup parent) { return viewHolder.itemView; } + /** + * called when the view is unbound + * + * @param holder + */ + @Override + public void unbindView(VH holder) { + + } + /** * This method returns the ViewHolder for our item, using the provided View. * By default it will try to get the ViewHolder from the ViewHolderFactory. If this one is not implemented it will go over the generic way, wasting ~5ms diff --git a/library/src/main/java/com/mikepenz/materialdrawer/model/ExpandableDrawerItem.java b/library/src/main/java/com/mikepenz/materialdrawer/model/ExpandableDrawerItem.java index b516bbdbd..07afcf404 100644 --- a/library/src/main/java/com/mikepenz/materialdrawer/model/ExpandableDrawerItem.java +++ b/library/src/main/java/com/mikepenz/materialdrawer/model/ExpandableDrawerItem.java @@ -29,6 +29,10 @@ public class ExpandableDrawerItem extends BaseDescribeableDrawerItem extends IItem { +public interface IDrawerItem extends IItem, IExpandable, ISubItem { Object getTag(); @@ -36,6 +40,8 @@ public interface IDrawerItem extends IIte VH getViewHolder(ViewGroup parent); + void unbindView(VH holder); + void bindView(VH holder, List payloads); boolean equals(long id); diff --git a/library/src/main/res/values/library_materialdrawer_strings.xml b/library/src/main/res/values/library_materialdrawer_strings.xml index 23f65891b..c555965e7 100755 --- a/library/src/main/res/values/library_materialdrawer_strings.xml +++ b/library/src/main/res/values/library_materialdrawer_strings.xml @@ -10,7 +10,7 @@ MaterialDrawer the flexible, easy to use, all in one drawer library for your Android project. ]]> - 5.6.0 + 5.7.0 https://github.com/mikepenz/MaterialDrawer apache_2_0 true