-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [RNKC-055] - lottie example * [RNKC-055] - always specify a color for text elements (otherwise using dark theme on Android the text can be not visible)
- Loading branch information
1 parent
5101a8a
commit 6b051f9
Showing
10 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from 'react'; | ||
import { StyleSheet, TextInput, View } from 'react-native'; | ||
import Lottie from 'lottie-react-native'; | ||
import { useKeyboardAnimation } from 'react-native-keyboard-controller'; | ||
|
||
// animation is taken from lottie public animations: https://lottiefiles.com/46216-lock-debit-card-morph | ||
import LockDebitCardMorph from './animation.json'; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
}, | ||
input: { | ||
width: '100%', | ||
height: 40, | ||
backgroundColor: '#5C5C5C', | ||
}, | ||
lottie: { | ||
height: 200, | ||
}, | ||
}); | ||
|
||
function LottieAnimation() { | ||
const { progress } = useKeyboardAnimation(); | ||
|
||
const animation = progress.interpolate({ | ||
inputRange: [0, 1], | ||
// 104 - total frames | ||
// 7 frame - transition begins | ||
// 35 frame - transition ends | ||
outputRange: [7 / 104, 35 / 104], | ||
}); | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<Lottie | ||
style={styles.lottie} | ||
source={LockDebitCardMorph} | ||
progress={animation} | ||
/> | ||
<TextInput style={styles.input} /> | ||
</View> | ||
); | ||
} | ||
|
||
export default LottieAnimation; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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