Created
July 8, 2018 21:06
-
-
Save bogoslavskiy/921144827c4bbdfec2e057a42fe456c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_updateScroll = ({value, manually}) => { | |
if(value && manually) { | |
this._clampedScrollValue = value; | |
} else { | |
const diff = value - this._scrollValue; | |
this._scrollValue = Math.max(value, this.topPartHeight); // Fix normal state | |
this._clampedScrollValue = Math.min( | |
Math.max(this._clampedScrollValue + diff, this.minClamp), | |
this.maxClamp | |
); | |
} | |
this._changeStatusBarStyle(); | |
this._changeStateBar(); | |
}; | |
onTabPress = (route) => { | |
let type = this.stateBarTypes; | |
let offset = (this.stateBar == type.NORMAL) ? this.topPartHeight : | |
(this.stateBar == type.CLAMPED) ? this.maxClamp : 0; | |
this.initialState.scrollToOffset({ | |
offset: offset, | |
animated: false, | |
tab: route.key | |
}); | |
this.scrollY.setValue(offset); | |
this._createClampedScroll(); | |
this._updateScroll({value: offset, manually: true}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment