Skip to content

Commit fc0ea4c

Browse files
fix(android): sync animated borderRadius to BorderDrawable
When borderRadius is animated via ObjectAnimator, the BorderDrawable was not updated, causing borders to render with square corners. Now setAnimateBorderRadius also calls BackgroundStyleApplicator.setBorderRadius to keep the border drawable in sync with the animated corner radius.
1 parent cfba87e commit fc0ea4c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

android/src/main/java/com/ease/EaseView.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import androidx.dynamicanimation.animation.SpringAnimation
1515
import androidx.dynamicanimation.animation.SpringForce
1616
import com.facebook.react.bridge.ReadableMap
1717
import com.facebook.react.uimanager.BackgroundStyleApplicator
18+
import com.facebook.react.uimanager.LengthPercentage
19+
import com.facebook.react.uimanager.LengthPercentageType
20+
import com.facebook.react.uimanager.PixelUtil
21+
import com.facebook.react.uimanager.style.BorderRadiusProp
1822
import com.facebook.react.uimanager.style.LogicalEdge
1923
import com.facebook.react.views.view.ReactViewGroup
2024
import kotlin.math.sqrt
@@ -164,6 +168,12 @@ class EaseView(context: Context) : ReactViewGroup(context) {
164168
clipToOutline = false
165169
}
166170
invalidateOutline()
171+
// Sync border drawable so borders follow the animated corner radius.
172+
// Value is in pixels; convert back to DIPs for BackgroundStyleApplicator.
173+
val dip = PixelUtil.toDIPFromPixel(value)
174+
BackgroundStyleApplicator.setBorderRadius(
175+
this, BorderRadiusProp.BORDER_RADIUS,
176+
LengthPercentage(dip, LengthPercentageType.POINT))
167177
}
168178
}
169179

0 commit comments

Comments
 (0)