Skip to content

Commit

Permalink
chore: upgrade rive-ios to 6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
lancesnider committed Nov 1, 2024
1 parent ba12e7a commit d055196
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 10 deletions.
2 changes: 2 additions & 0 deletions android/src/main/java/com/rivereactnative/RNFit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import app.rive.runtime.kotlin.core.Fit

enum class RNFit(private val mValue: String) {
Cover("cover"),
layout("layout"),
Contain("contain"),
Fill("fill"),
FitWidth("fitWidth"),
Expand All @@ -24,6 +25,7 @@ enum class RNFit(private val mValue: String) {
fun mapToRiveFit(rnFit: RNFit): Fit {
return when (rnFit) {
Cover -> Fit.COVER
Layout -> Fit.LAYOUT
Contain -> Fit.CONTAIN
Fill -> Fit.FILL
FitWidth -> Fit.FIT_WIDTH
Expand Down
1 change: 1 addition & 0 deletions docs/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
```ts
export enum Fit {
Cover = 'cover',
Layout = 'layout',
Contain = 'contain',
Fill = 'fill',
FitWidth = 'fitWidth',
Expand Down
Binary file added example/android/app/src/main/res/raw/layouts.riv
Binary file not shown.
Binary file added example/ios/Assets/layouts.riv
Binary file not shown.
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ PODS:
- React-perflogger (= 0.72.7)
- rive-react-native (8.0.0):
- React-Core
- RiveRuntime (= 6.2.1)
- RiveRuntime (6.2.1)
- RiveRuntime (= 6.3.1)
- RiveRuntime (6.3.1)
- RNCMaskedView (0.2.9):
- React-Core
- RNCPicker (1.16.8):
Expand Down Expand Up @@ -744,8 +744,8 @@ SPEC CHECKSUMS:
React-runtimescheduler: 7649c3b46c8dee1853691ecf60146a16ae59253c
React-utils: 56838edeaaf651220d1e53cd0b8934fb8ce68415
ReactCommon: 5f704096ccf7733b390f59043b6fa9cc180ee4f6
rive-react-native: 555505d7a84182ea159d5856bcda8ba01057f256
RiveRuntime: 23b2f53b5439c38f716b2f1a5d2a9e3a24683877
rive-react-native: f73f70e67c53ba2d755b20f7350378fcdf2620b6
RiveRuntime: 6c8d8553ba11599f7336a7c1be835a4584606678
RNCMaskedView: 949696f25ec596bfc697fc88e6f95cf0c79669b6
RNCPicker: 0991c56da7815c0cf946d6f63cf920b25296e5f6
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
Expand Down
4 changes: 1 addition & 3 deletions example/src/Simple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ export default function Simple() {
fit={Fit.Contain}
alignment={Alignment.Center}
style={styles.animation}
artboardName={'Avatar 3'}
autoplay={true}
animationName="idlePreview"
resourceName={'avatars'}
resourceName={'layouts'}
/>
</ScrollView>
</SafeAreaView>
Expand Down
7 changes: 5 additions & 2 deletions ios/RNFit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@ import RiveRuntime

enum RNFit: String {
case Contain = "contain"
case Layout = "layout"
case Cover = "cover"
case Fill = "fill"
case FitWidth = "fitWidth"
case FitHeight = "fitHeight"
case None = "none"
case ScaleDown = "scaleDown"

static func mapToRNFit(value: String) -> RNFit {
if let rnEnum = RNFit(rawValue: value) {
return rnEnum
} else {
fatalError("Unsupported fit type: \(value)")
}
}

static func mapToRiveFit(rnFit: RNFit) -> RiveFit {
switch rnFit {
case .Contain:
return RiveFit.contain
case .Layout:
return RiveFit.layout
case .Cover:
return RiveFit.cover
case .Fill:
Expand Down
2 changes: 1 addition & 1 deletion rive-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Pod::Spec.new do |s|
s.swift_version = "5.0"

s.dependency "React-Core"
s.dependency "RiveRuntime", "6.2.1"
s.dependency "RiveRuntime", "6.3.1"
end
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export enum ViewManagerMethod {

export enum Fit {
Cover = 'cover',
Layout = 'layout',
Contain = 'contain',
Fill = 'fill',
FitWidth = 'fitWidth',
Expand Down

0 comments on commit d055196

Please sign in to comment.