Skip to content

Commit

Permalink
fix default position and current position issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspsine committed Apr 4, 2016
1 parent a61cc94 commit f075940
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FragmentNavigator {
@IdRes
private int mContainerViewId;

private int mCurrentPosition;
private int mCurrentPosition = -1;

private int mDefaultPosition;

Expand Down Expand Up @@ -125,5 +125,8 @@ private void remove(int position, FragmentTransaction transaction) {

public void setDefaultPosition(int defaultPosition) {
this.mDefaultPosition = defaultPosition;
if (mCurrentPosition == -1) {
this.mCurrentPosition = defaultPosition;
}
}
}

0 comments on commit f075940

Please sign in to comment.