Skip to content
Merged
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
14 changes: 10 additions & 4 deletions android/src/main/java/com/ease/EaseView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,10 @@ class EaseView(context: Context) : ReactViewGroup(context) {
}

// Update backface visibility after setting initial rotation values.
// Skip when opacity is animated — backface check resets alpha.
// https://github.com/facebook/react-native/blob/a98aa814/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt#L967-L985
if (mask and (MASK_ROTATE or MASK_ROTATE_X or MASK_ROTATE_Y) != 0) {
if (mask and (MASK_ROTATE or MASK_ROTATE_X or MASK_ROTATE_Y) != 0 &&
mask and MASK_OPACITY == 0) {
setBackfaceVisibilityDependantOpacity()
}
} else if (allTransitionsNone()) {
Expand Down Expand Up @@ -820,7 +822,10 @@ class EaseView(context: Context) : ReactViewGroup(context) {

val batchId = animationBatchId
pendingBatchAnimationCount++
val needsBackfaceUpdate = propertyName in isRotationProperty
// Only update backface visibility when opacity is NOT animated — the backface
// check resets alpha, which would clobber the animated opacity value.
val needsBackfaceUpdate = propertyName in isRotationProperty &&
(animatedProperties and MASK_OPACITY == 0)

val animator = ObjectAnimator.ofFloat(this, propertyName, fromValue, toValue).apply {
duration = config.duration.toLong()
Expand Down Expand Up @@ -880,9 +885,10 @@ class EaseView(context: Context) : ReactViewGroup(context) {
val batchId = animationBatchId
pendingBatchAnimationCount++

val needsBackfaceUpdate = viewProperty == DynamicAnimation.ROTATION ||
val needsBackfaceUpdate = (viewProperty == DynamicAnimation.ROTATION ||
viewProperty == DynamicAnimation.ROTATION_X ||
viewProperty == DynamicAnimation.ROTATION_Y
viewProperty == DynamicAnimation.ROTATION_Y) &&
(animatedProperties and MASK_OPACITY == 0)

val dampingRatio = (config.damping / (2.0f * sqrt(config.stiffness * config.mass)))
.coerceAtLeast(0.01f)
Expand Down
Loading