Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package com.facebook.react.animated

import androidx.core.graphics.ColorUtils
import com.facebook.common.logging.FLog
import com.facebook.react.bridge.JSApplicationIllegalArgumentException
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.bridge.ReadableMap
Expand Down Expand Up @@ -44,6 +45,15 @@ internal class InterpolationAnimatedNode(config: ReadableMap) : ValueAnimatedNod
outputType = OutputType.String
outputRange = fromStringPattern(output)
pattern = output.getString(0)
} else if (output != null && output.size() > 0 && output.getType(0) != ReadableType.Number) {
FLog.e(
TAG,
"Unsupported value type in interpolation outputRange: expected Number but got " +
"${output.getType(0)}. This may indicate PlatformColor or other unsupported " +
"values are being used. Interpolation will not work correctly.",
)
outputType = OutputType.Number
outputRange = DoubleArray(output.size())
} else {
outputType = OutputType.Number
outputRange = fromDoubleArray(output)
Expand Down Expand Up @@ -101,6 +111,8 @@ internal class InterpolationAnimatedNode(config: ReadableMap) : ValueAnimatedNod
"InterpolationAnimatedNode[$tag] super: ${super.prettyPrint()}"

companion object {
private const val TAG = "InterpolationAnimatedNode"

const val EXTRAPOLATE_TYPE_IDENTITY: String = "identity"
const val EXTRAPOLATE_TYPE_CLAMP: String = "clamp"
const val EXTRAPOLATE_TYPE_EXTEND: String = "extend"
Expand Down
Loading