Skip to content

Commit

Permalink
Simplifying conditional logic.
Browse files Browse the repository at this point in the history
Summary:
This should be functionally identical, but avoids unnecessary conditionals in the code.

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes #15147

Differential Revision: D5497883

Pulled By: javache

fbshipit-source-id: a4b182084ffce87adac56013a178fbc5a7a5d1bb
  • Loading branch information
tomasreimers authored and facebook-github-bot committed Jul 26, 2017
1 parent 4d55ce3 commit 88a9845
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,22 +284,18 @@ public void run() {
mActivelyScrolling = false;
ReactHorizontalScrollView.this.postOnAnimationDelayed(this, ReactScrollViewHelper.MOMENTUM_DELAY);
} else {
boolean doneWithAllScrolling = true;
if (mPagingEnabled && !mSnappingToPage) {
// Only if we have pagingEnabled and we have not snapped to the page do we
// need to continue checking for the scroll. And we cause that scroll by asking for it
mSnappingToPage = true;
smoothScrollToPage(0);
doneWithAllScrolling = false;
}
if (doneWithAllScrolling) {
ReactHorizontalScrollView.this.postOnAnimationDelayed(this, ReactScrollViewHelper.MOMENTUM_DELAY);
} else {
if (mSendMomentumEvents) {
ReactScrollViewHelper.emitScrollMomentumEndEvent(ReactHorizontalScrollView.this);
}
ReactHorizontalScrollView.this.mPostTouchRunnable = null;
disableFpsListener();
} else {
ReactHorizontalScrollView.this.postOnAnimationDelayed(this, ReactScrollViewHelper.MOMENTUM_DELAY);
}
}
}
Expand Down

0 comments on commit 88a9845

Please sign in to comment.