Skip to content

Commit

Permalink
fix: little changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WoLewicki committed Aug 4, 2020
1 parent 78b99cd commit ffba0eb
Show file tree
Hide file tree
Showing 5 changed files with 249 additions and 257 deletions.
3 changes: 0 additions & 3 deletions android/src/main/java/com/swmansion/rnscreens/Screen.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public void onViewDetachedFromWindow(View view) {
private StackAnimation mStackAnimation = StackAnimation.DEFAULT;
private boolean mGestureEnabled = true;


@Override
protected void onAnimationStart() {
super.onAnimationStart();
Expand Down Expand Up @@ -152,7 +151,6 @@ public void setTransitioning(boolean transitioning) {
return;
}
mTransitioning = transitioning;

super.setLayerType(transitioning ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE, null);
}

Expand All @@ -168,7 +166,6 @@ public void setReplaceAnimation(ReplaceAnimation replaceAnimation) {
mReplaceAnimation = replaceAnimation;
}


public void setGestureEnabled(boolean gestureEnabled) {
mGestureEnabled = gestureEnabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void run() {
int transition = FragmentTransaction.TRANSIT_FRAGMENT_OPEN;
if (mStack.size() == mScreenFragments.size() && newTop.getScreen().getReplaceAnimation() == Screen.ReplaceAnimation.POP) {
// new screen was not on the stack before and the stack has the same amount of screens as before,
// so the "replace" action was called
// so probably the "replace" action was called
transition = FragmentTransaction.TRANSIT_FRAGMENT_CLOSE;
}
switch (newTop.getScreen().getStackAnimation()) {
Expand Down
4 changes: 2 additions & 2 deletions ios/RNSScreenStack.m
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ - (void)setPushViewControllers:(NSArray<UIViewController *> *)controllers
[_controller setViewControllers:controllers animated:NO];
} else if (top != lastTop) {
if (![controllers containsObject:lastTop]) {
// if we have same amount of controllers as before, probably replace was called
// if we have same amount of controllers as before and the screen wasn't on the stack before probably replace was called
// so we check if the new screen has "push" replace animation
if (_controller.viewControllers.count == controllers.count && ((RNSScreenView *) top.view).replaceAnimation == RNSScreenReplaceAnimationPush) {
if (_controller.viewControllers.count == controllers.count && ![_controller.viewControllers containsObject:top] && ((RNSScreenView *) top.view).replaceAnimation == RNSScreenReplaceAnimationPush) {
NSMutableArray *newControllers = [NSMutableArray arrayWithArray:controllers];
[_controller pushViewController:top animated:shouldAnimate];
[_controller setViewControllers:newControllers animated:NO];
Expand Down
Loading

0 comments on commit ffba0eb

Please sign in to comment.