Skip to content

Commit

Permalink
Fix forgery factory
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmos committed Nov 29, 2023
1 parent 9a120dd commit 9a76ff7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ internal class TelemetryConfigurationEventForgeryFactory :
forge.aNullable { aBool() },
forge.aNullable { aBool() },
forge.aNullable { aBool() },
forge.aNullable { aBool() },
forge.aNullable { aString() },
forge.aNullable { aBool() },
forge.aNullable { aBool() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ internal fun resolveOpacity(view: ReactViewGroup, currentOpacity: Float): Float
return if (view.alpha == 0f) {
0f
} else {
val combinedOpacity = view.alpha * currentOpacity

if (view.parent != null && view.parent is ReactViewGroup) {
resolveOpacity(view.parent as ReactViewGroup, minOf(view.alpha, currentOpacity))
resolveOpacity(view.parent as ReactViewGroup, combinedOpacity)
} else {
minOf(view.alpha, currentOpacity)
combinedOpacity
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.datadog.android.sessionreplay.internal.recorder.OptionSelectorDetecto
import com.datadog.android.sessionreplay.internal.recorder.mapper.WireframeMapper
import com.facebook.react.views.view.ReactViewGroup

internal class ReactNativeSessionReplayExtensionSupport() : ExtensionSupport {
internal class ReactNativeSessionReplayExtensionSupport : ExtensionSupport {

override fun getCustomViewMappers(): Map<SessionReplayPrivacy, Map<Class<*>, WireframeMapper<View, *>>> {
return mapOf(SessionReplayPrivacy.ALLOW to mapOf(
Expand All @@ -25,6 +25,3 @@ internal class ReactNativeSessionReplayExtensionSupport() : ExtensionSupport {
return listOf()
}
}



Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ internal class ReactViewGroupMapper :
cornerRadius = cornerRadiusDp
) to MobileSegment.ShapeBorder(
color = borderColor,
width = borderWidth.toLong()
width = borderWidth.toLong().convertToDensityNormalized(pixelDensity)
)
}
}
Expand All @@ -110,4 +110,4 @@ internal class ReactViewGroupMapper :
val alpha = resolveAlpha(opacity, borderColor)
return colorAndAlphaAsStringHexa(borderColor, alpha)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ internal class ColorUtilsTest {
assertThat(alphaValue)
.isEqualTo(1f)
}
}
}

0 comments on commit 9a76ff7

Please sign in to comment.