Skip to content

Commit

Permalink
Version 1.1.1: adding removeLast() method
Browse files Browse the repository at this point in the history
  • Loading branch information
MDXDave committed Feb 20, 2016
1 parent 40d9cd2 commit eede354
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories {
Add to _dependencies_:

```gradle
compile 'de.mdxdave:materialbreadcrumbsnavigation:1.1'
compile 'de.mdxdave:materialbreadcrumbsnavigation:1.1.1'
```


Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.1"
versionCode 111
versionName "1.1.1"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,17 @@ private void remove(int child){
}
}

public void removeLast(){
if(list.size()>1){
remove(list.size()-1);
}else if(list.size() == 1){
throw new IllegalStateException("You can not remove the root item!");
}else{
throw new IndexOutOfBoundsException("There are only one root item, so there is nothing to remove");
}

}

public void removeItem(int child){
if(child > list.size()) {
throw new IndexOutOfBoundsException("There are only "+list.size()+" items, you can not remove the "+child+" one");
Expand Down

0 comments on commit eede354

Please sign in to comment.