Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions android/src/legacy/java/com/rive/RiveReactNativeView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ class RiveReactNativeView(context: ThemedReactContext) : FrameLayout(context) {
}

fun configure(config: ViewConfiguration, dataBindingChanged: Boolean, reload: Boolean = false, initialUpdate: Boolean = false) {
// https://github.com/rive-app/rive-nitro-react-native/pull/209
riveAnimationView?.layoutScaleFactor = config.layoutScaleFactor
?: resources.displayMetrics.density

if (reload) {
val hasDataBinding = when (config.bindData) {
is BindData.None -> false
Expand All @@ -121,8 +125,6 @@ class RiveReactNativeView(context: ThemedReactContext) : FrameLayout(context) {
} else {
riveAnimationView?.alignment = config.alignment
riveAnimationView?.fit = config.fit
// TODO: this seems to require a reload for the view to take the new value (bug on Android)
riveAnimationView?.layoutScaleFactor = config.layoutScaleFactor
}

if (dataBindingChanged || initialUpdate || reload) {
Expand Down
Loading