Skip to content

Commit

Permalink
Merge branch 'release/v6.0.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Apr 1, 2018
2 parents a6abc67 + c159c18 commit 2c21889
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 60 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
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
implementation("com.mikepenz:materialdrawer:6.0.6@aar") {
implementation("com.mikepenz:materialdrawer:6.0.7@aar") {
transitive = true
}
Expand Down Expand Up @@ -469,7 +469,7 @@ Thanks to @zsmb13 there's now an (in)official Kotlin DSL wrapper for the Materia

# License

Copyright 2016 Mike Penz
Copyright 2018 Mike Penz

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
10 changes: 5 additions & 5 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 6060
versionName "6.0.6"
versionCode 6070
versionName "6.0.7"

setProperty("archivesBaseName", "MaterialDrawer-v$versionName-c$versionCode")
}
Expand Down Expand Up @@ -58,12 +58,12 @@ dependencies {
implementation 'com.mikepenz:fastadapter-commons:3.2.4@aar'
// used to generate the Open Source section
// https://github.com/mikepenz/AboutLibraries
implementation('com.mikepenz:aboutlibraries:6.0.4@aar') {
implementation('com.mikepenz:aboutlibraries:6.0.7@aar') {
transitive = true
}
//used to provide different itemAnimators for the RecyclerView
//https://github.com/mikepenz/ItemAnimators
implementation 'com.mikepenz:itemanimators:1.0.1@aar'
implementation 'com.mikepenz:itemanimators:1.0.2@aar'
// used to provide the MiniDrawer to normal Drawer crossfade effect via a SlidingPane layout
// --> https://github.com/mikepenz/MaterialDrawer/blob/develop/app/src/main/java/com/mikepenz/materialdrawer/app/MiniDrawerActivity.java
// https://github.com/mikepenz/Crossfader
Expand All @@ -81,7 +81,7 @@ dependencies {
}

configurations.all {
resolutionStrategy.force "com.mikepenz:iconics-core:3.0.2"
resolutionStrategy.force "com.mikepenz:iconics-core:3.0.3"
resolutionStrategy.force "com.mikepenz:fastadapter:3.2.4"
resolutionStrategy.force "com.android.support:support-v4:${versions.supportLib}"
resolutionStrategy.force "com.android.support:appcompat-v7:${versions.supportLib}"
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ buildscript {
ext {
setup = [
compileSdk: 27,
buildTools: "27.0.2",
buildTools: "27.0.3",
minSdk : 14,
targetSdk : 27
]

versions = [
supportLib: "27.0.2"
supportLib: "27.1.0"
]
}

Expand All @@ -18,8 +18,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.novoda:bintray-release:0.7.0'
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.novoda:bintray-release:0.8.1'
}
}

Expand Down
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=6.0.6
VERSION_CODE=6060
VERSION_NAME=6.0.7
VERSION_CODE=6070
GROUP=com.mikepenz
POM_DESCRIPTION=MaterialDrawer Library
POM_URL=https://github.com/mikepenz/MaterialDrawer
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
12 changes: 6 additions & 6 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 6060
versionName '6.0.6'
versionCode 6070
versionName '6.0.7'
}
buildTypes {
release {
Expand Down Expand Up @@ -37,16 +37,16 @@ dependencies {
// contains util classes to support various android versions, and clean up code
// comes with the awesome "Holder"-Pattern
// https://github.com/mikepenz/Materialize
compile 'com.mikepenz:materialize:1.1.2@aar'
api 'com.mikepenz:materialize:1.1.2'

// used to provide out of the box icon font support. simplifies development,
// and provides scalable icons. the core is very very light
// https://github.com/mikepenz/Android-Iconics
compile 'com.mikepenz:iconics-core:3.0.2@aar'
api 'com.mikepenz:iconics-core:3.0.3'

// 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:3.2.4@aar'
compile 'com.mikepenz:fastadapter-extensions-expandable:3.2.4@aar'
api 'com.mikepenz:fastadapter:3.2.4@aar'
api 'com.mikepenz:fastadapter-extensions-expandable:3.2.4@aar'
}
Original file line number Diff line number Diff line change
Expand Up @@ -1245,52 +1245,68 @@ public DrawerBuilder withSavedInstance(Bundle savedInstance) {
return this;
}

// shared preferences to use for integrated functions
protected SharedPreferences mSharedPreferences;

/**
* Set the {@link SharedPreferences} to use for the `showDrawerOnFirstLaunch` or the `ShowDrawerUntilDraggedOpened`
*
* @param sharedPreferences SharedPreference to use
* @return this
*/
public DrawerBuilder withSavedInstance(SharedPreferences sharedPreferences) {
this.mSharedPreferences = sharedPreferences;
return this;
}

/**
* helper method to handle when the drawer should be shown on launch
*/
private void handleShowOnLaunch() {
//check if it should be shown on launch (and we have a drawerLayout)
if (mActivity != null && mDrawerLayout != null) {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mActivity);

if(mShowDrawerOnFirstLaunch && !preferences.getBoolean(Drawer.PREF_USER_LEARNED_DRAWER, false)){
//if it was not shown yet
//open the drawer
mDrawerLayout.openDrawer(mSliderLayout);

//save that it showed up once ;)
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean(Drawer.PREF_USER_LEARNED_DRAWER, true);
editor.apply();

} else if(mShowDrawerUntilDraggedOpened && !preferences.getBoolean(Drawer.PREF_USER_OPENED_DRAWER_BY_DRAGGING, false)) {
// open the drawer since the user has not dragged it open yet
mDrawerLayout.openDrawer(mSliderLayout);

// add a listener to detect dragging
mDrawerLayout.addDrawerListener(new DrawerLayout.SimpleDrawerListener() {
boolean hasBeenDragged = false;

@Override
public void onDrawerStateChanged(int newState) {
if(newState == DrawerLayout.STATE_DRAGGING){
// save that the user was dragging
hasBeenDragged = true;

} else if(newState == DrawerLayout.STATE_IDLE){
// check if the user was dragging and if that resulted in an open drawer
if(hasBeenDragged && mDrawerLayout.isDrawerOpen(mDrawerGravity)){
// Save that the user has dragged it open
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean(Drawer.PREF_USER_OPENED_DRAWER_BY_DRAGGING, true);
editor.apply();
} else {
// reset the drag boolean
hasBeenDragged = false;
if (mShowDrawerOnFirstLaunch || mShowDrawerUntilDraggedOpened) {
final SharedPreferences preferences = mSharedPreferences != null ? mSharedPreferences : PreferenceManager.getDefaultSharedPreferences(mActivity);

if (mShowDrawerOnFirstLaunch && !preferences.getBoolean(Drawer.PREF_USER_LEARNED_DRAWER, false)) {
//if it was not shown yet
//open the drawer
mDrawerLayout.openDrawer(mSliderLayout);

//save that it showed up once ;)
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean(Drawer.PREF_USER_LEARNED_DRAWER, true);
editor.apply();

} else if (mShowDrawerUntilDraggedOpened && !preferences.getBoolean(Drawer.PREF_USER_OPENED_DRAWER_BY_DRAGGING, false)) {
// open the drawer since the user has not dragged it open yet
mDrawerLayout.openDrawer(mSliderLayout);

// add a listener to detect dragging
mDrawerLayout.addDrawerListener(new DrawerLayout.SimpleDrawerListener() {
boolean hasBeenDragged = false;

@Override
public void onDrawerStateChanged(int newState) {
if (newState == DrawerLayout.STATE_DRAGGING) {
// save that the user was dragging
hasBeenDragged = true;

} else if (newState == DrawerLayout.STATE_IDLE) {
// check if the user was dragging and if that resulted in an open drawer
if (hasBeenDragged && mDrawerLayout.isDrawerOpen(mDrawerGravity)) {
// Save that the user has dragged it open
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean(Drawer.PREF_USER_OPENED_DRAWER_BY_DRAGGING, true);
editor.apply();
} else {
// reset the drag boolean
hasBeenDragged = false;
}
}
}
}
});
});
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
<b>MaterialDrawer</b> the flexible, easy to use, all in one drawer library for your Android project.
]]>
</string>
<string name="library_materialdrawer_libraryVersion">6.0.6</string>
<string name="library_materialdrawer_libraryVersion">6.0.7</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>
<string name="library_materialdrawer_repositoryLink">https://github.com/mikepenz/MaterialDrawer</string>
<!-- Custom variables section -->
<string name="library_materialdrawer_owner">Mike Penz</string>
<string name="library_materialdrawer_year">2016</string>
<string name="library_materialdrawer_year">2018</string>
</resources>

0 comments on commit 2c21889

Please sign in to comment.