Skip to content

Commit

Permalink
Merge branch 'release/v6.1.0-rc02'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Sep 15, 2018
2 parents 0eda3e7 + 5da8ee0 commit cc45a49
Show file tree
Hide file tree
Showing 70 changed files with 1,151 additions and 840 deletions.
Binary file added DEV/github/2018-08-18 20.14.34.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DEV/github/2018-08-18 20.14.36.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DEV/github/2018-08-18 20.14.38.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DEV/github/2018-08-18 20.14.42.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DEV/github/2018-08-18 20.14.47.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DEV/github/2018-08-18 20.14.49.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed DEV/github/Screenshot_2015-08-12-18-57-35.png
Binary file not shown.
Binary file removed DEV/github/Screenshot_2015-08-12-18-59-06.png
Binary file not shown.
Binary file removed DEV/github/Screenshot_2015-08-12-19-00-38.png
Binary file not shown.
Binary file removed DEV/github/Screenshot_2015-08-12-19-01-18.png
Binary file not shown.
Binary file removed DEV/github/Screenshot_2015-08-12-19-03-24.png
Binary file not shown.
Binary file removed DEV/github/Screenshot_2015-08-12-19-10-41.png
Binary file not shown.
Binary file removed DEV/github/Screenshot_2015-08-12-19-12-45.png
Binary file not shown.
Binary file removed DEV/github/Screenshot_2015-08-12-19-13-45.png
Binary file not shown.
Binary file removed DEV/github/screenshots1.jpg
Binary file not shown.
Binary file modified DEV/github/screenshots1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed DEV/github/screenshots2.jpg
Binary file not shown.
Binary file modified DEV/github/screenshots2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
### Upgrade Notes

#### v6.1.0-rc01.2
* With the introduction of the material 2 design behaviour, new theme attributes were added.
```xml
<item name="material_drawer_selected_legacy">@color/material_drawer_selected</item> <!-- Defines the color if legacy style (Material 1, is enabled) -->
<item name="material_drawer_legacy_style">false</item> <!-- Enables legacy Material 1 style -->
```
* Reworked the header views to be a lot more simple by using a `ConstraintLayout`
* Any previously custom headers require to be adjusted to the new structure. (The statusbar `Guideline` is required, for example)
* The viewHolder.item has no longer the item itself as tag directly. It is now defined with an id `R.id.material_drawer_item`. `ViewHolder.itemView.getTag(R.id.material_drawer_item)` will now return the `IDrawerItem`.

#### v6.1.0-rc01
* Final upgrade to the new shiny androidX dependencies :)

Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ There is a Header with profiles (**AccountHeader**), a **MiniDrawer** for Table
### A quick overview of what's in it
- **the easiest possible integration**
- integrate in less than **5 minutes**
- depends on androidX
- compatible down to **API Level 14**
- includes an **AccountSwitcher**
- quick and simple api
- follows the **Google Material Design Guidelines**
- follows the **NEW Google Material Design Guidelines**
- use **vector** (.svg) icons and **icon fonts** via the [Android-Iconics](https://github.com/mikepenz/Android-Iconics) integration
- **Google Material Design Icons**, Google **Material Community** Design Icons, FontAwesome and more
- comes with various **themes** which help to get your own themes clean
Expand All @@ -35,15 +36,15 @@ There is a Header with profiles (**AccountHeader**), a **MiniDrawer** for Table
- sticky footer or headers
- **absolutely NO limits**

> If you upgrade from < 5.9.0 follow the [MIGRATION GUIDE](https://github.com/mikepenz/MaterialDrawer/blob/develop/MIGRATION.md)
> If you upgrade from < 6.1.0 follow the [MIGRATION GUIDE](https://github.com/mikepenz/MaterialDrawer/blob/develop/MIGRATION.md)
# Preview
## Demo
You can try it out here [Google Play](https://play.google.com/store/apps/details?id=com.mikepenz.unsplash) (wall:splash an open source application which uses this drawer implementation). Or you try the [Sample Application](https://play.google.com/store/apps/details?id=com.mikepenz.materialdrawer.app)
You can try it out here [Sample Application](https://play.google.com/store/apps/details?id=com.mikepenz.materialdrawer.app)

## Screenshots
![Image](https://raw.githubusercontent.com/mikepenz/MaterialDrawer/develop/DEV/github/screenshots1.jpg)
![Image](https://raw.githubusercontent.com/mikepenz/MaterialDrawer/develop/DEV/github/screenshots2.jpg)
![Image](DEV/github/screenshots1.png)
![Image](DEV/github/screenshots2.png)

# WIKI / FAQ
You can find some frequently asked questions and other resources in the [WIKI / FAQ](FAQ.md) site.
Expand All @@ -52,13 +53,14 @@ You can find some frequently asked questions and other resources in the [WIKI /
## 1. Provide the gradle dependency

```gradle
implementation "com.mikepenz:materialdrawer:6.1.0-rc01"
implementation "com.mikepenz:materialdrawer:6.1.0-rc02"
//required support lib modules
implementation "androidx.appcompat:appcompat:${versions.androidX}"
implementation "androidx.recyclerview:recyclerview:${versions.androidX}"
implementation "androidx.annotation:annotation:${versions.androidX}"
implementation "com.google.android.material:material:${versions.androidX}"
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"
```

To use appcompat please use a version smaller than 6.1.0. (See the releases on GitHub)
Expand Down Expand Up @@ -310,9 +312,11 @@ Create your custom style and use one of the provided themes as parent. If you do
<item name="material_drawer_secondary_text">@color/material_drawer_secondary_text</item>
<item name="material_drawer_hint_text">@color/material_drawer_hint_text</item>
<item name="material_drawer_divider">@color/material_drawer_divider</item>
<item name="material_drawer_selected">@color/material_drawer_selected</item>
<item name="material_drawer_selected">@color/material_drawer_selected</item> <!-- Material 2 defines 12% alpha, primary color -->
<item name="material_drawer_selected_legacy">@color/material_drawer_selected</item> <!-- Defines the color if legacy style (Material 1, is enabled) -->
<item name="material_drawer_selected_text">@color/material_drawer_selected_text</item>
<item name="material_drawer_header_selection_text">@color/material_drawer_header_selection_text</item>
<item name="material_drawer_legacy_style">false</item> <!-- Enables legacy Material 1 style -->
</style>
```

Expand All @@ -335,7 +339,8 @@ No need to create a custom theme. Just set these colors (or some of them) and yo
<color name="material_drawer_hint_text">#42000000</color>
<color name="material_drawer_divider">#1F000000</color>
<!-- Material DEFAULT drawer colors -->
<color name="material_drawer_selected">#E8E8E8</color>
<color name="material_drawer_selected">#1F2196F3</color>
<color name="material_drawer_selected_legacy">#E8E8E8</color>
<color name="material_drawer_selected_text">#2196F3</color>
<color name="material_drawer_header_selection_text">#FFF</color>

Expand All @@ -349,7 +354,8 @@ No need to create a custom theme. Just set these colors (or some of them) and yo
<color name="material_drawer_dark_hint_text">#42FFFFFF</color>
<color name="material_drawer_dark_divider">#1FFFFFFF</color>
<!-- MaterialDrawer DEFAULT DARK drawer colors -->
<color name="material_drawer_dark_selected">#202020</color>
<color name="material_drawer_dark_selected">#1F2196F3</color>
<color name="material_drawer_dark_selected_legacy">#202020</color>
<color name="material_drawer_dark_selected_text">@color/material_drawer_primary</color>
<color name="material_drawer_dark_header_selection_text">#FFF</color>
```
Expand Down
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ dependencies {

// the sample uses more advanced functions of the fastadapter
// https://github.com/mikepenz/FastAdapter/
implementation 'com.mikepenz:fastadapter-commons:3.3.0-rc01'
implementation 'com.mikepenz:fastadapter-commons:3.3.0-rc02'
// used to generate the Open Source section
// https://github.com/mikepenz/AboutLibraries
implementation 'com.mikepenz:aboutlibraries:6.2.0-rc01'
implementation 'com.mikepenz:aboutlibraries:6.2.0-rc02'

//used to provide different itemAnimators for the RecyclerView
//https://github.com/mikepenz/ItemAnimators
implementation 'com.mikepenz:itemanimators:1.1.0-rc01'
// 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
implementation 'com.mikepenz:crossfader:1.5.1'
implementation 'com.mikepenz:crossfader:1.6.0-rc01'
// used to provide the two step crossfade DrawerLayout. Which allows to have a mini layout which transforms to a normal layout within the drawer
// --> https://github.com/mikepenz/MaterialDrawer/blob/develop/app/src/main/java/com/mikepenz/materialdrawer/app/CrossfadeDrawerLayoutActvitiy.java
// https://github.com/mikepenz/CrossfadeDrawerLayout
implementation('com.mikepenz:crossfadedrawerlayout:1.0.1')
implementation('com.mikepenz:crossfadedrawerlayout:1.1.0-rc01')

// icon fonts used inside the sample
// https://github.com/mikepenz/Android-Iconics
Expand All @@ -80,8 +80,8 @@ dependencies {
}

configurations.all {
resolutionStrategy.force "com.mikepenz:iconics-core:3.1.0-rc01"
resolutionStrategy.force "com.mikepenz:fastadapter:3.3.0-rc01"
resolutionStrategy.force "com.mikepenz:iconics-core:3.1.0-rc02"
resolutionStrategy.force "com.mikepenz:fastadapter:3.3.0-rc02"
resolutionStrategy.force "com.android.support:support-v4:${versions.androidX}"
resolutionStrategy.force "com.android.support:appcompat-v7:${versions.androidX}"
resolutionStrategy.force "com.android.support:cardview-v7:${versions.androidX}"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mikepenz.materialdrawer.app">

<uses-permission android:name="android.permission.INTERNET" />
Expand All @@ -8,7 +9,8 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round">
android:roundIcon="@mipmap/ic_launcher_round"
tools:ignore="GoogleAppIndexingWarning">
<!-- android:supportsRtl="true" -->
<activity
android:name=".DrawerActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import android.graphics.Color;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.PopupMenu;
import androidx.appcompat.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
Expand All @@ -29,6 +26,11 @@
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import com.mikepenz.materialdrawer.model.interfaces.IProfile;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.PopupMenu;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;

public class AdvancedActivity extends AppCompatActivity {
private static final int PROFILE_SETTING = 1;

Expand Down Expand Up @@ -131,6 +133,7 @@ private void buildHeader(boolean compact, Bundle savedInstanceState) {
new ProfileSettingDrawerItem().withName("Add Account").withDescription("Add new GitHub Account").withIcon(new IconicsDrawable(this, GoogleMaterial.Icon.gmd_add).actionBar().paddingDp(5).colorRes(R.color.material_drawer_dark_primary_text)).withIdentifier(PROFILE_SETTING),
new ProfileSettingDrawerItem().withName("Manage Account").withIcon(GoogleMaterial.Icon.gmd_settings)
)
.withTextColor(ContextCompat.getColor(this, R.color.material_drawer_dark_primary_text))
.withOnAccountHeaderListener(new AccountHeader.OnAccountHeaderListener() {
@Override
public boolean onProfileChanged(View view, IProfile profile, boolean current) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.view.ActionMode;
import androidx.appcompat.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
Expand All @@ -27,6 +24,10 @@
import com.mikepenz.materialdrawer.model.interfaces.Nameable;
import com.mikepenz.materialize.util.UIUtils;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.view.ActionMode;
import androidx.appcompat.widget.Toolbar;

public class CompactHeaderDrawerActivity extends AppCompatActivity {
private static final int PROFILE_SETTING = 1;

Expand Down Expand Up @@ -55,7 +56,6 @@ protected void onCreate(Bundle savedInstanceState) {
headerResult = new AccountHeaderBuilder()
.withActivity(this)
.withCompactStyle(true)
.withHeaderBackground(R.drawable.header)
.addProfiles(
profile,
profile2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import androidx.core.view.GravityCompat;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
Expand All @@ -30,6 +27,10 @@
import com.mikepenz.materialdrawer.util.DrawerUIUtils;
import com.mikepenz.materialize.util.UIUtils;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.GravityCompat;

public class CrossfadeDrawerLayoutActvitiy extends AppCompatActivity {
//save our header or result
private AccountHeader headerResult = null;
Expand All @@ -56,7 +57,6 @@ protected void onCreate(Bundle savedInstanceState) {
// Create the AccountHeader
headerResult = new AccountHeaderBuilder()
.withActivity(this)
.withHeaderBackground(R.drawable.header)
.addProfiles(
profile, profile2
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.View;

import com.mikepenz.aboutlibraries.Libs;
Expand All @@ -29,6 +27,9 @@
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import com.mikepenz.materialdrawer.model.interfaces.IProfile;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

public class DrawerActivity extends AppCompatActivity {
private static final int PROFILE_SETTING = 100000;

Expand Down Expand Up @@ -61,7 +62,6 @@ protected void onCreate(Bundle savedInstanceState) {
headerResult = new AccountHeaderBuilder()
.withActivity(this)
.withTranslucentStatusBar(true)
.withHeaderBackground(R.drawable.header)
.addProfiles(
profile,
profile2,
Expand Down Expand Up @@ -124,8 +124,8 @@ public boolean onProfileChanged(View view, IProfile profile, boolean current) {
new SecondaryDrawerItem().withName("CollapsableItem 2").withLevel(2).withIcon(GoogleMaterial.Icon.gmd_format_bold).withIdentifier(2001)
),
new ExpandableDrawerItem().withName("Collapsable").withIcon(GoogleMaterial.Icon.gmd_filter_list).withIdentifier(19).withSelectable(false).withSubItems(
new SecondaryDrawerItem().withName("CollapsableItem").withLevel(2).withIcon(GoogleMaterial.Icon.gmd_filter_list).withIdentifier(2002),
new SecondaryDrawerItem().withName("CollapsableItem 2").withLevel(2).withIcon(GoogleMaterial.Icon.gmd_filter_list).withIdentifier(2003)
new SecondaryDrawerItem().withName("CollapsableItem").withLevel(2).withIcon(GoogleMaterial.Icon.gmd_filter_list).withIdentifier(2002),
new SecondaryDrawerItem().withName("CollapsableItem 2").withLevel(2).withIcon(GoogleMaterial.Icon.gmd_filter_list).withIdentifier(2003)
),
new SectionDrawerItem().withName(R.string.drawer_item_section_header),
new SecondaryDrawerItem().withName(R.string.drawer_item_open_source).withIcon(FontAwesome.Icon.faw_github).withIdentifier(20).withSelectable(false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
Expand Down Expand Up @@ -33,6 +31,9 @@
import com.mikepenz.materialdrawer.model.interfaces.Nameable;
import com.mikepenz.octicons_typeface_library.Octicons;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

public class EmbeddedDrawerActivity extends AppCompatActivity {
private static final int PROFILE_SETTING = 1;

Expand Down Expand Up @@ -64,7 +65,6 @@ protected void onCreate(Bundle savedInstanceState) {
// Create the AccountHeader
headerResult = new AccountHeaderBuilder()
.withActivity(this)
.withHeaderBackground(R.drawable.header)
.withTranslucentStatusBar(false)
.addProfiles(
profile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ protected void onCreate(Bundle savedInstanceState) {
// Create the AccountHeader
headerResult = new AccountHeaderBuilder()
.withActivity(this)
.withHeaderBackground(R.drawable.header)
.withTranslucentStatusBar(false)
.addProfiles(
profile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

import android.content.Context;
import android.net.Uri;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.StringRes;
import androidx.recyclerview.widget.RecyclerView;

import com.mikepenz.materialdrawer.holder.ColorHolder;
import com.mikepenz.materialdrawer.holder.ImageHolder;
import com.mikepenz.materialdrawer.holder.StringHolder;
import com.mikepenz.materialdrawer.model.BaseDrawerItem;
import com.mikepenz.materialdrawer.util.DrawerImageLoader;
import com.mikepenz.materialdrawer.util.DrawerUIUtils;
import com.mikepenz.materialize.util.UIUtils;

import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.StringRes;
import androidx.recyclerview.widget.RecyclerView;

import static com.mikepenz.materialdrawer.util.DrawerUIUtils.themeDrawerItem;

/**
* Created by mikepenz on 03.02.15.
Expand Down Expand Up @@ -79,12 +81,9 @@ protected void bindViewHelper(CustomBaseViewHolder viewHolder) {
//get the correct color for the text
int color = getColor(ctx);
int selectedTextColor = getSelectedTextColor(ctx);
//get the correct color for the icon
int iconColor = getIconColor(ctx);
int selectedIconColor = getSelectedIconColor(ctx);

//set the background for the item
UIUtils.setBackground(viewHolder.view, UIUtils.getSelectableBackground(ctx, selectedColor, true));
themeDrawerItem(ctx, viewHolder.view, selectedColor, isSelectedBackgroundAnimated());
//set the text for the name
StringHolder.applyTo(this.getName(), viewHolder.name);
//set the text for the description or hide
Expand Down
Loading

0 comments on commit cc45a49

Please sign in to comment.