Skip to content

Commit

Permalink
Release 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
balysv committed Oct 19, 2014
1 parent cad2cb4 commit 0251373
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Change Log
==========

Version 1.4.0 (2014-10-19)

- Added EXTRAS: Toolbar support for `MaterialMenuIcon`.

Usage:

import `com.balysv.materialmenu:material-menu-toolbar:1.x.x` and use `MaterielMenuIconToolbar`

- BUG FIX: left margin fix for Jellybean and ICS devices using `MaterialMenuIcon`

Version 1.3.1 (2014-10-14)
----------------------------

Expand Down
68 changes: 67 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ Check for latest versions at [Gradle Please][3] and import depending on ActionBa
// stock actionBar
compile 'com.balysv.materialmenu:material-menu:1.x.x'
// actionBarCompat
// Toolbar (includes support-v7:21.0.x)
compile 'com.balysv.materialmenu:material-menu-toolbar:1.x.x'
// actionBarCompat (up to support-v7:20.0.0 - does not support Toolbar)
compile 'com.balysv.materialmenu:material-menu-abc:1.x.x'
// actionBarSherlock
Expand Down Expand Up @@ -140,6 +143,69 @@ public boolean onOptionsItemSelected(MenuItem item) {
}
```

#### Use in Toolbar

Use it as a standalone drawable. Note: you have to handle icon state yourself:

```java
private MaterialMenuDrawable materialMenu;

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.toolbar);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
// Handle your drawable state here
materialMenu.animatePressedState(newState);
}
});
materialMenu = new MaterialMenuDrawable(this, Color.WHITE, Stroke.THIN);
toolbar.setNavigationIcon(materialMenu);
materialMenu.setNeverDrawTouch(true);
}
```

OR

Use `MaterialMenuIconToolbar` which handles saved state:

```java
private MaterialMenuIconToolbar materialMenu;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.toolbar);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
// Handle your drawable state here
materialMenu.animatePressedState(newState);
}
});
materialMenu = new MaterialMenuIconToolbar(this, Color.WHITE, Stroke.THIN) {
@Override public int getToolbarViewId() {
return R.id.toolbar;
}
};
materialMenu.setNeverDrawTouch(true);
}

@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
materialMenu.syncState(savedInstanceState);
}

@Override protected void onSaveInstanceState(Bundle outState) {
materialMenu.onSaveInstanceState(outState);
super.onSaveInstanceState(outState);
}
```

#### Use in custom Action Bar view

Simply add `MaterialMenuView` in your custom layout and register an `OnClickListener` to do the
Expand Down
3 changes: 2 additions & 1 deletion extras-toolbar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ android {
buildToolsVersion "21.0.1"

defaultConfig {
applicationId "com.balysv.materialmenu.extras.toolbar"
minSdkVersion 9
targetSdkVersion 21
versionCode 1
Expand All @@ -22,3 +21,5 @@ dependencies {
compile project(':library')
compile 'com.android.support:appcompat-v7:21.0.0'
}

apply from: '../maven_push.gradle'
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_NAME=1.3.1
VERSION_CODE=11
VERSION_NAME=1.4.0
VERSION_CODE=12
GROUP=com.balysv.materialmenu

POM_NAME=Material Menu
Expand Down

0 comments on commit 0251373

Please sign in to comment.