Skip to content

Commit

Permalink
Release 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
armcha committed Jan 29, 2017
1 parent 69eca31 commit 704d926
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 13 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ spaceNavigationView.showBadgeAtIndex(int itemIndexToShowBadge, int badgeCountTex

Hide badge at index
```java
spaceNavigationView.hideBudgeAtIndex(int itemIndexToHideBudge);
spaceNavigationView.hideBadgeAtIndex(int itemIndexToHideBadge);
```
![](screens/gif2.gif)

Hide all badges
```java
spaceNavigationView.hideAllBudges();
spaceNavigationView.hideAllBadges();
```

Change badge text
Expand Down Expand Up @@ -303,10 +303,19 @@ Add recycler view scroll behavior
[14]: https://github.com/armcha/Space-Navigation-View/issues/29
[16]: https://github.com/armcha/Space-Navigation-View/issues/34
[17]: https://github.com/armcha/Space-Navigation-View/issues/32
[20]: https://github.com/armcha/Space-Navigation-View/issues/41
[15]: https://github.com/ankitpopli1891
[18]: https://github.com/akiraspeirs
[19]: https://github.com/nextdimension

##Versions

##1.6.0
* Added saving translation height on rotation. Thanks to [akiraspeirs][18]
* Fixed requestLayout being improperly called. Thanks to [akiraspeirs][18]
* Fixed inActiveCentreButtonIconColor not being used initially. Thanks to [nextdimension][19]
* Fixed issue [#41][20]

##1.5.0
* Added SpaceNavigationViewBehavior
* Fixed issue [#32][17]
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-alpha1'
classpath 'com.android.tools.build:gradle:2.3.0-beta3'
classpath 'com.novoda:bintray-release:0.3.4'
}
}
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 @@
#Mon Dec 28 10:00:20 PST 2015
#Sun Jan 29 18:23:19 AMT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
2 changes: 1 addition & 1 deletion spacelib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies {
publish {
groupId = 'com.github.armcha'
artifactId = 'SpaceNavigationView'
publishVersion = '1.5.0'
publishVersion = '1.6.0'
desc = 'Spaces Navigation View'
licences = ['MIT']
website = 'https://github.com/armcha/Space-Navigation-View'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class SpaceNavigationView extends RelativeLayout {

private static final String CURRENT_SELECTED_ITEM_BUNDLE_KEY = "currentItem";

private static final String BUDGES_ITEM_BUNDLE_KEY = "budgeItem";
private static final String BADGES_ITEM_BUNDLE_KEY = "badgeItem";

private static final String CHANGED_ICON_AND_TEXT_BUNDLE_KEY = "changedIconAndText";

Expand Down Expand Up @@ -642,8 +642,8 @@ private void restoreBadges() {
shouldShowBadgeWithNinePlus = restoredBundle.getBoolean(BADGE_FULL_TEXT_KEY);
}

if (restoredBundle.containsKey(BUDGES_ITEM_BUNDLE_KEY)) {
badgeSaveInstanceHashMap = (HashMap<Integer, Object>) savedInstanceState.getSerializable(BUDGES_ITEM_BUNDLE_KEY);
if (restoredBundle.containsKey(BADGES_ITEM_BUNDLE_KEY)) {
badgeSaveInstanceHashMap = (HashMap<Integer, Object>) savedInstanceState.getSerializable(BADGES_ITEM_BUNDLE_KEY);
if (badgeSaveInstanceHashMap != null) {
for (Integer integer : badgeSaveInstanceHashMap.keySet()) {
BadgeHelper.forceShowBadge(
Expand Down Expand Up @@ -712,7 +712,7 @@ private void throwArrayIndexOutOfBoundsException(int itemIndex) {

/**
* Initialization with savedInstanceState to save current selected
* position and current budges
* position and current badges
*
* @param savedInstanceState bundle to saveInstance
*/
Expand All @@ -721,7 +721,7 @@ public void initWithSaveInstanceState(Bundle savedInstanceState) {
}

/**
* Save budges and current position
* Save badges and current position
*
* @param outState bundle to saveInstance
*/
Expand All @@ -733,7 +733,7 @@ public void onSaveInstanceState(Bundle outState) {
outState.putFloat(VISIBILITY, this.getTranslationY());

if (badgeSaveInstanceHashMap.size() > 0)
outState.putSerializable(BUDGES_ITEM_BUNDLE_KEY, badgeSaveInstanceHashMap);
outState.putSerializable(BADGES_ITEM_BUNDLE_KEY, badgeSaveInstanceHashMap);
if (changedItemAndIconHashMap.size() > 0)
outState.putSerializable(CHANGED_ICON_AND_TEXT_BUNDLE_KEY, changedItemAndIconHashMap);
}
Expand Down Expand Up @@ -946,10 +946,26 @@ private void restoreTranslation() {
* Hide badge at index
*
* @param index badge index
* @deprecated Use {@link #hideBadgeAtIndex(int index)} instead.
*/
@Deprecated
public void hideBudgeAtIndex(final int index) {
if (badgeList.get(index).getVisibility() == GONE) {
Log.d(TAG, "Budge at index: " + index + " already hidden");
Log.d(TAG, "Badge at index: " + index + " already hidden");
} else {
BadgeHelper.hideBadge(badgeList.get(index));
badgeSaveInstanceHashMap.remove(index);
}
}

/**
* Hide badge at index
*
* @param index badge index
*/
public void hideBadgeAtIndex(final int index) {
if (badgeList.get(index).getVisibility() == GONE) {
Log.d(TAG, "Badge at index: " + index + " already hidden");
} else {
BadgeHelper.hideBadge(badgeList.get(index));
badgeSaveInstanceHashMap.remove(index);
Expand All @@ -958,7 +974,9 @@ public void hideBudgeAtIndex(final int index) {

/**
* Hiding all available badges
* @deprecated Use {@link #hideAllBadges()} instead.
*/
@Deprecated
public void hideAllBudges() {
for (RelativeLayout badge : badgeList) {
if (badge.getVisibility() == VISIBLE)
Expand All @@ -967,6 +985,17 @@ public void hideAllBudges() {
badgeSaveInstanceHashMap.clear();
}

/**
* Hiding all available badges
*/
public void hideAllBadges() {
for (RelativeLayout badge : badgeList) {
if (badge.getVisibility() == VISIBLE)
BadgeHelper.hideBadge(badge);
}
badgeSaveInstanceHashMap.clear();
}

/**
* Change badge text at index
*
Expand Down

0 comments on commit 704d926

Please sign in to comment.