-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add image OOB asset API for iOS native wrapper
- Loading branch information
Showing
13 changed files
with
299 additions
and
13 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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
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,68 @@ | ||
import * as React from 'react'; | ||
import { SafeAreaView, ScrollView, StyleSheet, Text } from 'react-native'; | ||
import Rive, { Fit } from 'rive-react-native'; | ||
|
||
export default function StateMachine() { | ||
return ( | ||
<SafeAreaView style={styles.safeAreaViewContainer}> | ||
<ScrollView contentContainerStyle={styles.container}> | ||
<Rive | ||
autoplay={true} | ||
fit={Fit.Cover} | ||
style={styles.box} | ||
stateMachineName="State Machine 2" | ||
artboardName="Picture 1" | ||
initialAssetsHandled={{ | ||
'cat.webp': { | ||
willHandleAsset: true, | ||
// assetUrl: 'https://www.gstatic.com/webp/gallery/1.webp', | ||
bundledAssetName: 'cat-994454.webp', | ||
}, | ||
}} | ||
resourceName={'cat_wall'} | ||
/> | ||
<Text> | ||
Load in an external asset from a URL or bundled asset on the native | ||
platform | ||
</Text> | ||
</ScrollView> | ||
</SafeAreaView> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
safeAreaViewContainer: { | ||
flex: 1, | ||
}, | ||
container: { | ||
flexGrow: 1, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
marginBottom: 150, | ||
padding: 10, | ||
}, | ||
wrapper: { | ||
flex: 1, | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
justifyContent: 'center', | ||
marginBottom: 20, | ||
}, | ||
box: { | ||
width: '100%', | ||
height: 500, | ||
marginVertical: 20, | ||
}, | ||
picker: { | ||
width: '100%', | ||
height: 50, | ||
}, | ||
radioButtonsWrapper: { | ||
flexDirection: 'row', | ||
}, | ||
radioButtonWrapper: { | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
marginRight: 16, | ||
}, | ||
}); |
Binary file not shown.
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
Oops, something went wrong.
6293de3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any indication of when this branch might get completed and merged? We really need OOB assets in react-native!