Skip to content

Commit

Permalink
Merge branch 'release/v5.2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed May 10, 2016
2 parents 07643a6 + 10cfecc commit bc331cf
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 27 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#MaterialDrawer [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.mikepenz/materialdrawer/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/com.mikepenz/materialdrawer) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-MaterialDrawer-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1526) [![Join the chat at https://gitter.im/mikepenz/MaterialDrawer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mikepenz/MaterialDrawer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

![Image](https://raw.githubusercontent.com/mikepenz/MaterialDrawer/develop/DEV/github/banner.png)
![MaterialDrawer the flexible, easy to use, all in one drawer library for your android project.](https://raw.githubusercontent.com/mikepenz/MaterialDrawer/develop/DEV/github/banner.png)

> Does your application **contain a Drawer**? Do you want to have it **up and running in less than 5 minutes**? Do you want your drawer to follow the **Android Design Guidelines**?
Do you have **profiles**? Do you need **flexibility**? Is Google's navigation Drawer of the **design support** not enough for you? Do you want a **simple and easy** to understand api?
Expand Down Expand Up @@ -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.2.2@aar') {
compile('com.mikepenz:materialdrawer:5.2.5@aar') {
transitive = true
}
```
Expand Down Expand Up @@ -411,6 +411,7 @@ builder.withDrawerLayout(R.layout.material_drawer);
* [TS3 Viewer for TeamSpeak 3](https://play.google.com/store/apps/details?id=com.game_state.ts3viewer)
* [Teacher Gradebook](https://play.google.com/store/apps/details?id=com.apolosoft.cuadernoprofesor)
* [Tabe3 News Reader](https://play.google.com/store/apps/details?id=com.tabe3.news)
* [Facepunch Droid](https://play.google.com/store/apps/details?id=com.apps.anker.facepunchdroid)

#Articles about the MaterialDrawer
* [java-help.ru](http://java-help.ru/material-navigationdrawer/)
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
defaultConfig {
minSdkVersion setup.minSdk
targetSdkVersion setup.targetSdk
versionCode 522
versionName "5.2.2"
versionCode 525
versionName "5.2.5"

setProperty("archivesBaseName", "-v$versionName-c$versionCode")
}
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.novoda:bintray-release:0.3.4'
}
}
Expand All @@ -27,5 +27,5 @@ allprojects {
}

task wrapper(type: Wrapper) {
gradleVersion = '2.12'
gradleVersion = '2.13'
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Maven stuff
VERSION_NAME=5.2.2
VERSION_CODE=522
VERSION_NAME=5.2.5
VERSION_CODE=525
GROUP=com.mikepenz

POM_DESCRIPTION=MaterialDrawer Library
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Mar 16 19:49:05 CET 2016
#Tue May 10 18:14:12 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip
6 changes: 3 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion setup.minSdk
targetSdkVersion setup.targetSdk
versionCode 522
versionName '5.2.2'
versionCode 525
versionName '5.2.5'
}
buildTypes {
release {
Expand Down Expand Up @@ -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.4.4@aar'
compile 'com.mikepenz:fastadapter:1.5.0@aar'
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.mikepenz.fastadapter.adapters.HeaderAdapter;
import com.mikepenz.fastadapter.adapters.ItemAdapter;
import com.mikepenz.iconics.utils.Utils;
import com.mikepenz.materialdrawer.holder.DimenHolder;
import com.mikepenz.materialdrawer.model.AbstractDrawerItem;
import com.mikepenz.materialdrawer.model.DividerDrawerItem;
import com.mikepenz.materialdrawer.model.PrimaryDrawerItem;
Expand Down Expand Up @@ -538,6 +539,7 @@ public DrawerBuilder withScrollToTopAfterClick(boolean scrollToTopAfterClick) {
protected View mHeaderView;
protected boolean mHeaderDivider = true;
protected boolean mHeaderPadding = true;
protected DimenHolder mHeiderHeight = null;

/**
* Add a header to the DrawerBuilder ListView. This can be any view
Expand Down Expand Up @@ -591,8 +593,21 @@ public DrawerBuilder withHeaderPadding(boolean headerPadding) {
return this;
}

/**
* Sets the header height for the header provided via `withHeader()`
*
* @param headerHeight the DimenHolder with the height we want to set for the header
* @return
*/
public DrawerBuilder withHeaderHeight(DimenHolder headerHeight) {
this.mHeiderHeight = headerHeight;
return this;
}

// sticky view
protected View mStickyHeaderView;
// shadow shown on the top of the sticky header
protected boolean mStickyHeaderShadow = true;

/**
* Add a sticky header below the DrawerBuilder ListView. This can be any view
Expand Down Expand Up @@ -624,6 +639,17 @@ public DrawerBuilder withStickyHeader(@LayoutRes int stickyHeaderRes) {
return this;
}

/**
* Set this to false if you don't want the shadow below the sticky header
*
* @param stickyHeaderShadow
* @return
*/
public DrawerBuilder withStickyHeaderShadow(boolean stickyHeaderShadow) {
this.mStickyHeaderShadow = stickyHeaderShadow;
return this;
}

// footer view
protected View mFooterView;
protected boolean mFooterDivider = true;
Expand Down
28 changes: 15 additions & 13 deletions library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,19 @@ public static void handleHeaderView(DrawerBuilder drawer) {
//set a background color or the elevation will not work
drawer.mStickyHeaderView.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(drawer.mActivity, R.attr.material_drawer_background, R.color.material_drawer_background));

//add a shadow
if (Build.VERSION.SDK_INT >= 21) {
drawer.mStickyHeaderView.setElevation(UIUtils.convertDpToPixel(4, drawer.mActivity));
} else {
View view = new View(drawer.mActivity);
view.setBackgroundResource(R.drawable.material_drawer_shadow_bottom);
drawer.mSliderLayout.addView(view, RelativeLayout.LayoutParams.MATCH_PARENT, (int) UIUtils.convertDpToPixel(4, drawer.mActivity));
//now align the shadow below the stickyHeader ;)
RelativeLayout.LayoutParams lps = (RelativeLayout.LayoutParams) view.getLayoutParams();
lps.addRule(RelativeLayout.BELOW, R.id.material_drawer_sticky_header);
view.setLayoutParams(lps);
if (drawer.mStickyHeaderShadow) {
//add a shadow
if (Build.VERSION.SDK_INT >= 21) {
drawer.mStickyHeaderView.setElevation(UIUtils.convertDpToPixel(4, drawer.mActivity));
} else {
View view = new View(drawer.mActivity);
view.setBackgroundResource(R.drawable.material_drawer_shadow_bottom);
drawer.mSliderLayout.addView(view, RelativeLayout.LayoutParams.MATCH_PARENT, (int) UIUtils.convertDpToPixel(4, drawer.mActivity));
//now align the shadow below the stickyHeader ;)
RelativeLayout.LayoutParams lps = (RelativeLayout.LayoutParams) view.getLayoutParams();
lps.addRule(RelativeLayout.BELOW, R.id.material_drawer_sticky_header);
view.setLayoutParams(lps);
}
}

//remove the padding of the recyclerView again we have the header on top of it
Expand All @@ -229,9 +231,9 @@ public static void handleHeaderView(DrawerBuilder drawer) {
}

if (drawer.mHeaderPadding) {
drawer.getHeaderAdapter().add(new ContainerDrawerItem().withView(drawer.mHeaderView).withDivider(drawer.mHeaderDivider).withViewPosition(ContainerDrawerItem.Position.TOP));
drawer.getHeaderAdapter().add(new ContainerDrawerItem().withView(drawer.mHeaderView).withHeight(drawer.mHeiderHeight).withDivider(drawer.mHeaderDivider).withViewPosition(ContainerDrawerItem.Position.TOP));
} else {
drawer.getHeaderAdapter().add(new ContainerDrawerItem().withView(drawer.mHeaderView).withDivider(drawer.mHeaderDivider).withViewPosition(ContainerDrawerItem.Position.NONE));
drawer.getHeaderAdapter().add(new ContainerDrawerItem().withView(drawer.mHeaderView).withHeight(drawer.mHeiderHeight).withDivider(drawer.mHeaderDivider).withViewPosition(ContainerDrawerItem.Position.NONE));
}
//set the padding on the top to 0
drawer.mRecyclerView.setPadding(drawer.mRecyclerView.getPaddingLeft(), 0, drawer.mRecyclerView.getPaddingRight(), drawer.mRecyclerView.getPaddingBottom());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<b>MaterialDrawer</b> the flexible, easy to use, all in one drawer library for your Android project.
]]>
</string>
<string name="library_materialdrawer_libraryVersion">5.2.2</string>
<string name="library_materialdrawer_libraryVersion">5.2.5</string>
<string name="library_materialdrawer_libraryWebsite">https://github.com/mikepenz/MaterialDrawer</string>
<string name="library_materialdrawer_licenseId">apache_2_0</string>
<string name="library_materialdrawer_isOpenSource">true</string>
Expand Down

0 comments on commit bc331cf

Please sign in to comment.