File tree Expand file tree Collapse file tree 7 files changed +30
-8
lines changed
multibackstack/src/main/java/com/jetradar/multibackstack Expand file tree Collapse file tree 7 files changed +30
-8
lines changed Original file line number Diff line number Diff line change 88 - tools
99
1010 - android-25
11- - build-tools-25.0.2
11+ - build-tools-25.0.3
1212 - extra-google-m2repository
1313 - extra-android-m2repository
1414
Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ Change Log
22==========
33
44
5+ ## Version 1.2.1
6+
7+ _ 2016-07-11_
8+
9+ Implemented the ability to get the number of fragments in the stack (` backStackSize() ` ).
10+
11+
512## Version 1.2.0
613
714_ 2016-07-11_
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ Add the dependency
3838
3939``` groovy
4040dependencies {
41- compile 'com.github.jetradarmobile:multibackstack:1.2.0 '
41+ compile 'com.github.jetradarmobile:multibackstack:1.2.1 '
4242}
4343```
4444
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ buildscript {
33 jcenter()
44 }
55 dependencies {
6- classpath ' com.android.tools.build:gradle:2.3.0-beta1 '
6+ classpath ' com.android.tools.build:gradle:2.3.1 '
77 }
88}
99
@@ -15,11 +15,11 @@ allprojects {
1515
1616ext {
1717 compileSdkVersion = 25
18- buildToolsVersion = ' 25.0.2 '
18+ buildToolsVersion = ' 25.0.3 '
1919
20- supportDesign = ' com.android.support:design:25.0 .1'
21- supportAppCompat = ' com.android.support:appcompat-v7:25.0 .1'
22- bottomNavigationBar = ' com.ashokvarma.android:bottom-navigation-bar:1.3.0 '
20+ supportDesign = ' com.android.support:design:25.3 .1'
21+ supportAppCompat = ' com.android.support:appcompat-v7:25.3 .1'
22+ bottomNavigationBar = ' com.ashokvarma.android:bottom-navigation-bar:1.4.1 '
2323}
2424
2525task clean (type : Delete ) {
Original file line number Diff line number Diff line change 2020import android .os .Parcelable ;
2121import android .support .annotation .NonNull ;
2222import android .support .annotation .Nullable ;
23-
2423import java .util .Stack ;
2524
2625public class BackStack implements Parcelable {
@@ -44,6 +43,10 @@ public boolean empty() {
4443 return entriesStack .empty ();
4544 }
4645
46+ public int size () {
47+ return entriesStack .size ();
48+ }
49+
4750 @ Override
4851 public int describeContents () {
4952 return 0 ;
Original file line number Diff line number Diff line change @@ -94,4 +94,11 @@ protected boolean resetBackStackToRoot(int hostId) {
9494 protected boolean clearBackStack (int hostId ) {
9595 return backStackManager .clear (hostId );
9696 }
97+
98+ /**
99+ * @return the number of fragments in back stack.
100+ */
101+ protected int backStackSize (int hostId ) {
102+ return backStackManager .backStackSize (hostId );
103+ }
97104}
Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ public boolean clear(int hostId) {
7878 return true ;
7979 }
8080
81+ public int backStackSize (int hostId ) {
82+ BackStack backStack = getBackStack (hostId );
83+ return backStack != null ? backStack .size () : 0 ;
84+ }
85+
8186 public boolean resetToRoot (int hostId ) {
8287 BackStack backStack = getBackStack (hostId );
8388 if (backStack == null ) {
You can’t perform that action at this time.
0 commit comments