Last active
May 28, 2019 05:00
-
-
Save rutvikbhatt9/a1982f50bbce1070cd3f6668e0f0d0fc to your computer and use it in GitHub Desktop.
Get Interpolation value for artist profile image top, height and width
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
//artist profile image position from top | |
_getImageTopPosition = () => { | |
const {scrollY} = this.state; | |
return scrollY.interpolate({ | |
inputRange: [0, 140], | |
outputRange: [ThemeUtils.relativeHeight(20), Platform.OS === 'ios' ? 8 : 10], | |
extrapolate: 'clamp', | |
useNativeDriver: true | |
}); | |
}; | |
//artist profile image width | |
_getImageWidth = () => { | |
const {scrollY} = this.state; | |
return scrollY.interpolate({ | |
inputRange: [0, 140], | |
outputRange: [ThemeUtils.relativeWidth(40), ThemeUtils.APPBAR_HEIGHT - 20], | |
extrapolate: 'clamp', | |
useNativeDriver: true | |
}); | |
}; | |
//artist profile image height | |
_getImageHeight = () => { | |
const {scrollY} = this.state; | |
return scrollY.interpolate({ | |
inputRange: [0, 140], | |
outputRange: [ThemeUtils.relativeWidth(40), ThemeUtils.APPBAR_HEIGHT - 20], | |
extrapolate: 'clamp', | |
useNativeDriver: true | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment