Skip to content

Commit 704d926

Browse files
committed
Release 1.6.0
1 parent 69eca31 commit 704d926

File tree

5 files changed

+51
-13
lines changed

5 files changed

+51
-13
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,13 @@ spaceNavigationView.showBadgeAtIndex(int itemIndexToShowBadge, int badgeCountTex
216216

217217
Hide badge at index
218218
```java
219-
spaceNavigationView.hideBudgeAtIndex(int itemIndexToHideBudge);
219+
spaceNavigationView.hideBadgeAtIndex(int itemIndexToHideBadge);
220220
```
221221
![](screens/gif2.gif)
222222

223223
Hide all badges
224224
```java
225-
spaceNavigationView.hideAllBudges();
225+
spaceNavigationView.hideAllBadges();
226226
```
227227

228228
Change badge text
@@ -303,10 +303,19 @@ Add recycler view scroll behavior
303303
[14]: https://github.com/armcha/Space-Navigation-View/issues/29
304304
[16]: https://github.com/armcha/Space-Navigation-View/issues/34
305305
[17]: https://github.com/armcha/Space-Navigation-View/issues/32
306+
[20]: https://github.com/armcha/Space-Navigation-View/issues/41
306307
[15]: https://github.com/ankitpopli1891
308+
[18]: https://github.com/akiraspeirs
309+
[19]: https://github.com/nextdimension
307310

308311
##Versions
309312

313+
##1.6.0
314+
* Added saving translation height on rotation. Thanks to [akiraspeirs][18]
315+
* Fixed requestLayout being improperly called. Thanks to [akiraspeirs][18]
316+
* Fixed inActiveCentreButtonIconColor not being used initially. Thanks to [nextdimension][19]
317+
* Fixed issue [#41][20]
318+
310319
##1.5.0
311320
* Added SpaceNavigationViewBehavior
312321
* Fixed issue [#32][17]

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
jcenter()
55
}
66
dependencies {
7-
classpath 'com.android.tools.build:gradle:2.3.0-alpha1'
7+
classpath 'com.android.tools.build:gradle:2.3.0-beta3'
88
classpath 'com.novoda:bintray-release:0.3.4'
99
}
1010
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Dec 28 10:00:20 PST 2015
1+
#Sun Jan 29 18:23:19 AMT 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

spacelib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies {
3232
publish {
3333
groupId = 'com.github.armcha'
3434
artifactId = 'SpaceNavigationView'
35-
publishVersion = '1.5.0'
35+
publishVersion = '1.6.0'
3636
desc = 'Spaces Navigation View'
3737
licences = ['MIT']
3838
website = 'https://github.com/armcha/Space-Navigation-View'

spacelib/src/main/java/com/luseen/spacenavigation/SpaceNavigationView.java

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class SpaceNavigationView extends RelativeLayout {
4848

4949
private static final String CURRENT_SELECTED_ITEM_BUNDLE_KEY = "currentItem";
5050

51-
private static final String BUDGES_ITEM_BUNDLE_KEY = "budgeItem";
51+
private static final String BADGES_ITEM_BUNDLE_KEY = "badgeItem";
5252

5353
private static final String CHANGED_ICON_AND_TEXT_BUNDLE_KEY = "changedIconAndText";
5454

@@ -642,8 +642,8 @@ private void restoreBadges() {
642642
shouldShowBadgeWithNinePlus = restoredBundle.getBoolean(BADGE_FULL_TEXT_KEY);
643643
}
644644

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

713713
/**
714714
* Initialization with savedInstanceState to save current selected
715-
* position and current budges
715+
* position and current badges
716716
*
717717
* @param savedInstanceState bundle to saveInstance
718718
*/
@@ -721,7 +721,7 @@ public void initWithSaveInstanceState(Bundle savedInstanceState) {
721721
}
722722

723723
/**
724-
* Save budges and current position
724+
* Save badges and current position
725725
*
726726
* @param outState bundle to saveInstance
727727
*/
@@ -733,7 +733,7 @@ public void onSaveInstanceState(Bundle outState) {
733733
outState.putFloat(VISIBILITY, this.getTranslationY());
734734

735735
if (badgeSaveInstanceHashMap.size() > 0)
736-
outState.putSerializable(BUDGES_ITEM_BUNDLE_KEY, badgeSaveInstanceHashMap);
736+
outState.putSerializable(BADGES_ITEM_BUNDLE_KEY, badgeSaveInstanceHashMap);
737737
if (changedItemAndIconHashMap.size() > 0)
738738
outState.putSerializable(CHANGED_ICON_AND_TEXT_BUNDLE_KEY, changedItemAndIconHashMap);
739739
}
@@ -946,10 +946,26 @@ private void restoreTranslation() {
946946
* Hide badge at index
947947
*
948948
* @param index badge index
949+
* @deprecated Use {@link #hideBadgeAtIndex(int index)} instead.
949950
*/
951+
@Deprecated
950952
public void hideBudgeAtIndex(final int index) {
951953
if (badgeList.get(index).getVisibility() == GONE) {
952-
Log.d(TAG, "Budge at index: " + index + " already hidden");
954+
Log.d(TAG, "Badge at index: " + index + " already hidden");
955+
} else {
956+
BadgeHelper.hideBadge(badgeList.get(index));
957+
badgeSaveInstanceHashMap.remove(index);
958+
}
959+
}
960+
961+
/**
962+
* Hide badge at index
963+
*
964+
* @param index badge index
965+
*/
966+
public void hideBadgeAtIndex(final int index) {
967+
if (badgeList.get(index).getVisibility() == GONE) {
968+
Log.d(TAG, "Badge at index: " + index + " already hidden");
953969
} else {
954970
BadgeHelper.hideBadge(badgeList.get(index));
955971
badgeSaveInstanceHashMap.remove(index);
@@ -958,7 +974,9 @@ public void hideBudgeAtIndex(final int index) {
958974

959975
/**
960976
* Hiding all available badges
977+
* @deprecated Use {@link #hideAllBadges()} instead.
961978
*/
979+
@Deprecated
962980
public void hideAllBudges() {
963981
for (RelativeLayout badge : badgeList) {
964982
if (badge.getVisibility() == VISIBLE)
@@ -967,6 +985,17 @@ public void hideAllBudges() {
967985
badgeSaveInstanceHashMap.clear();
968986
}
969987

988+
/**
989+
* Hiding all available badges
990+
*/
991+
public void hideAllBadges() {
992+
for (RelativeLayout badge : badgeList) {
993+
if (badge.getVisibility() == VISIBLE)
994+
BadgeHelper.hideBadge(badge);
995+
}
996+
badgeSaveInstanceHashMap.clear();
997+
}
998+
970999
/**
9711000
* Change badge text at index
9721001
*

0 commit comments

Comments
 (0)