diff --git a/dd-sdk-android-internal/src/main/java/com/datadog/android/internal/utils/ImageViewUtils.kt b/dd-sdk-android-internal/src/main/java/com/datadog/android/internal/utils/ImageViewUtils.kt index 73dbcaed52..cf3f148758 100644 --- a/dd-sdk-android-internal/src/main/java/com/datadog/android/internal/utils/ImageViewUtils.kt +++ b/dd-sdk-android-internal/src/main/java/com/datadog/android/internal/utils/ImageViewUtils.kt @@ -19,7 +19,7 @@ import android.widget.ImageView object ImageViewUtils { /** * Resolves the absolute position on the screen of the given [View]. - * @param view: the [View]. + * @param view the [View]. * @return the [Rect] representing the absolute position of the view. */ fun resolveParentRectAbsPosition(view: View): Rect { @@ -42,9 +42,9 @@ object ImageViewUtils { /** * Calculates the clipping [Rect] of the given child [Rect] using its parent [Rect] and * the screen density. - * @param parentRect: the parent [Rect]. - * @param childRect: the child [Rect]. - * @param density: the screen density. + * @param parentRect the parent [Rect]. + * @param childRect the child [Rect]. + * @param density the screen density. * @return the clipping [Rect]. */ fun calculateClipping(parentRect: Rect, childRect: Rect, density: Float): Rect { @@ -78,9 +78,9 @@ object ImageViewUtils { /** * Resolves the [Drawable] content [Rect] using the given [ImageView] scale type. - * @param imageView: the [ImageView]. - * @param drawable: the [Drawable]. - * @param customScaleType: optional custom [ImageView.ScaleType]. + * @param imageView the [ImageView]. + * @param drawable the [Drawable]. + * @param customScaleType optional custom [ImageView.ScaleType]. * @return the resolved content [Rect]. */ fun resolveContentRectWithScaling( diff --git a/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/CheckboxSemanticsNodeMapper.kt b/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/CheckboxSemanticsNodeMapper.kt index 5475fc437a..ed717b9e4b 100644 --- a/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/CheckboxSemanticsNodeMapper.kt +++ b/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/CheckboxSemanticsNodeMapper.kt @@ -46,7 +46,7 @@ internal class CheckboxSemanticsNodeMapper( ) ) } else { - createCheckboxWireframe( + createCheckboxWireframes( parentContext = parentContext, asyncJobStatusCallback = asyncJobStatusCallback, semanticsNode = semanticsNode, @@ -78,7 +78,7 @@ internal class CheckboxSemanticsNodeMapper( ) } - private fun createCheckboxWireframe( + private fun createCheckboxWireframes( parentContext: UiContext, asyncJobStatusCallback: AsyncJobStatusCallback, semanticsNode: SemanticsNode, @@ -140,7 +140,7 @@ internal class CheckboxSemanticsNodeMapper( } // if we failed to create a wireframe from the path - return createManualCheckedWireframe( + return createManualCheckedWireframes( semanticsNode = semanticsNode, globalBounds = globalBounds, backgroundColor = fillColorRgba, @@ -162,7 +162,7 @@ internal class CheckboxSemanticsNodeMapper( } ?: DEFAULT_COLOR_BLACK } - private fun createManualCheckedWireframe( + private fun createManualCheckedWireframes( semanticsNode: SemanticsNode, globalBounds: GlobalBounds, backgroundColor: String, @@ -170,7 +170,7 @@ internal class CheckboxSemanticsNodeMapper( ): List { val strokeColor = getFallbackCheckmarkColor(backgroundColor) - val wireframesList = mutableListOf() + val wireframes = mutableListOf() val background = createUncheckedState( semanticsNode = semanticsNode, @@ -180,7 +180,7 @@ internal class CheckboxSemanticsNodeMapper( currentIndex = 0 ) - wireframesList.add(background) + wireframes.add(background) val checkmarkWidth = globalBounds.width * CHECKMARK_SIZE_FACTOR val checkmarkHeight = globalBounds.height * CHECKMARK_SIZE_FACTOR @@ -203,8 +203,8 @@ internal class CheckboxSemanticsNodeMapper( ) ) - wireframesList.add(foreground) - return wireframesList + wireframes.add(foreground) + return wireframes } private fun createUncheckedState( @@ -213,24 +213,22 @@ internal class CheckboxSemanticsNodeMapper( backgroundColor: String, borderColor: String, currentIndex: Int - ): MobileSegment.Wireframe { - return MobileSegment.Wireframe.ShapeWireframe( - id = resolveId(semanticsNode, currentIndex), - x = globalBounds.x, - y = globalBounds.y, - width = CHECKBOX_SIZE_DP.toLong(), - height = CHECKBOX_SIZE_DP.toLong(), - shapeStyle = MobileSegment.ShapeStyle( - backgroundColor = backgroundColor, - opacity = 1f, - cornerRadius = CHECKBOX_CORNER_RADIUS - ), - border = MobileSegment.ShapeBorder( - color = borderColor, - width = BOX_BORDER_WIDTH_DP - ) + ) = MobileSegment.Wireframe.ShapeWireframe( + id = resolveId(semanticsNode, currentIndex), + x = globalBounds.x, + y = globalBounds.y, + width = CHECKBOX_SIZE_DP.toLong(), + height = CHECKBOX_SIZE_DP.toLong(), + shapeStyle = MobileSegment.ShapeStyle( + backgroundColor = backgroundColor, + opacity = 1f, + cornerRadius = CHECKBOX_CORNER_RADIUS + ), + border = MobileSegment.ShapeBorder( + color = borderColor, + width = BOX_BORDER_WIDTH_DP ) - } + ) private fun isCheckboxChecked(semanticsNode: SemanticsNode): Boolean = semanticsNode.config.getOrNull(SemanticsProperties.ToggleableState) == ToggleableState.On diff --git a/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/ColorUtils.kt b/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/ColorUtils.kt index 5942383824..c0e968ed82 100644 --- a/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/ColorUtils.kt +++ b/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/ColorUtils.kt @@ -28,17 +28,17 @@ internal class ColorUtils( } } - internal fun convertRgbaToArgb(rgbaString: String): String { - if (rgbaString.length < 2) return rgbaString + internal fun convertRgbaToArgb(input: String): String { + if (input.length < RGBA_LENGTH) return input // for takeLast: n > 0 @Suppress("UnsafeThirdPartyFunctionCall") - val alphaValue = rgbaString.takeLast(2) + val alphaValue = input.takeLast(2) // for substring: length is necessarily > 1 at this point // for dropLast: n > 0 @Suppress("UnsafeThirdPartyFunctionCall") - val rgbColor = rgbaString + val rgbColor = input .substring(1) .dropLast(2) return "#$alphaValue$rgbColor" @@ -46,5 +46,6 @@ internal class ColorUtils( internal companion object { internal const val COLOR_PARSE_ERROR = "Failed to parse color: %s" + internal const val RGBA_LENGTH = 8 } } diff --git a/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/SemanticsUtils.kt b/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/SemanticsUtils.kt index 81a5a6a98b..b140ac7ca4 100644 --- a/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/SemanticsUtils.kt +++ b/features/dd-sdk-android-session-replay-compose/src/main/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/SemanticsUtils.kt @@ -332,8 +332,7 @@ internal class SemanticsUtils(private val reflectionUtils: ReflectionUtils = Ref } } - val result = (color?.value as? Color) - ?.value + val result = (color?.value as? Color)?.value return result?.toLong() } diff --git a/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/CheckboxSemanticsNodeMapperTest.kt b/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/CheckboxSemanticsNodeMapperTest.kt index 6c26e38b49..f777465657 100644 --- a/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/CheckboxSemanticsNodeMapperTest.kt +++ b/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/CheckboxSemanticsNodeMapperTest.kt @@ -161,7 +161,8 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest asyncJobStatusCallback = mockAsyncJobStatusCallback ) - val actualWireframe = semanticsWireframe.wireframes[0] as? MobileSegment.Wireframe.ShapeWireframe + // Then + val actualWireframe = semanticsWireframe.wireframes[0] as MobileSegment.Wireframe.ShapeWireframe val expectedShapeBorder = MobileSegment.ShapeBorder( color = fakeBorderColorHexString, @@ -174,9 +175,8 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest cornerRadius = CHECKBOX_CORNER_RADIUS ) - // Then - assertThat(actualWireframe?.border).isEqualTo(expectedShapeBorder) - assertThat(actualWireframe?.shapeStyle).isEqualTo(expectedShapeStyle) + assertThat(actualWireframe.border).isEqualTo(expectedShapeBorder) + assertThat(actualWireframe.shapeStyle).isEqualTo(expectedShapeStyle) } @Test @@ -195,7 +195,8 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest asyncJobStatusCallback = mockAsyncJobStatusCallback ) - val actualWireframe = semanticsWireframe.wireframes[0] as? MobileSegment.Wireframe.ShapeWireframe + // Then + val actualWireframe = semanticsWireframe.wireframes[0] as MobileSegment.Wireframe.ShapeWireframe val expectedShapeBorder = MobileSegment.ShapeBorder( color = DEFAULT_COLOR_BLACK, @@ -208,9 +209,8 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest cornerRadius = CHECKBOX_CORNER_RADIUS ) - // Then - assertThat(actualWireframe?.border).isEqualTo(expectedShapeBorder) - assertThat(actualWireframe?.shapeStyle).isEqualTo(expectedShapeStyle) + assertThat(actualWireframe.border).isEqualTo(expectedShapeBorder) + assertThat(actualWireframe.shapeStyle).isEqualTo(expectedShapeStyle) } @Test @@ -229,7 +229,8 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest asyncJobStatusCallback = mockAsyncJobStatusCallback ) - val backgroundWireframe = semanticsWireframe.wireframes[0] as? MobileSegment.Wireframe.ShapeWireframe + // Then + val backgroundWireframe = semanticsWireframe.wireframes[0] as MobileSegment.Wireframe.ShapeWireframe val expectedBgShapeBorder = MobileSegment.ShapeBorder( color = fakeBorderColorHexString, @@ -242,9 +243,8 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest cornerRadius = CHECKBOX_CORNER_RADIUS ) - // Then - assertThat(backgroundWireframe?.border).isEqualTo(expectedBgShapeBorder) - assertThat(backgroundWireframe?.shapeStyle).isEqualTo(expectedBgShapeStyle) + assertThat(backgroundWireframe.border).isEqualTo(expectedBgShapeBorder) + assertThat(backgroundWireframe.shapeStyle).isEqualTo(expectedBgShapeStyle) } @Test @@ -266,15 +266,15 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest asyncJobStatusCallback = mockAsyncJobStatusCallback ) - val foregroundWireframe = semanticsWireframe.wireframes[1] as? MobileSegment.Wireframe.ShapeWireframe + // Then + val foregroundWireframe = semanticsWireframe.wireframes[1] as MobileSegment.Wireframe.ShapeWireframe val expectedShapeStyle = MobileSegment.ShapeStyle( backgroundColor = DEFAULT_COLOR_WHITE, opacity = 1f, cornerRadius = CHECKBOX_CORNER_RADIUS ) - // Then - assertThat(foregroundWireframe?.shapeStyle).isEqualTo(expectedShapeStyle) + assertThat(foregroundWireframe.shapeStyle).isEqualTo(expectedShapeStyle) } @Test @@ -295,17 +295,18 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest parentContext = mockUiContext, asyncJobStatusCallback = mockAsyncJobStatusCallback ) + + // Then assertThat(semanticsWireframe.wireframes).hasSize(2) - val foregroundWireframe = semanticsWireframe.wireframes[1] as? MobileSegment.Wireframe.ShapeWireframe + val foregroundWireframe = semanticsWireframe.wireframes[1] as MobileSegment.Wireframe.ShapeWireframe val expectedShapeStyle = MobileSegment.ShapeStyle( backgroundColor = DEFAULT_COLOR_BLACK, opacity = 1f, cornerRadius = CHECKBOX_CORNER_RADIUS ) - // Then - assertThat(foregroundWireframe?.shapeStyle).isEqualTo(expectedShapeStyle) + assertThat(foregroundWireframe.shapeStyle).isEqualTo(expectedShapeStyle) } @Test @@ -321,15 +322,15 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest asyncJobStatusCallback = mockAsyncJobStatusCallback ) - val foregroundWireframe = semanticsWireframe.wireframes[1] as? MobileSegment.Wireframe.ShapeWireframe + // Then + val foregroundWireframe = semanticsWireframe.wireframes[1] as MobileSegment.Wireframe.ShapeWireframe val expectedShapeStyle = MobileSegment.ShapeStyle( backgroundColor = DEFAULT_COLOR_BLACK, opacity = 1f, cornerRadius = CHECKBOX_CORNER_RADIUS ) - // Then - assertThat(foregroundWireframe?.shapeStyle).isEqualTo(expectedShapeStyle) + assertThat(foregroundWireframe.shapeStyle).isEqualTo(expectedShapeStyle) } @Test @@ -345,15 +346,15 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest asyncJobStatusCallback = mockAsyncJobStatusCallback ) - val foregroundWireframe = semanticsWireframe.wireframes[1] as? MobileSegment.Wireframe.ShapeWireframe + // Then + val foregroundWireframe = semanticsWireframe.wireframes[1] as MobileSegment.Wireframe.ShapeWireframe val expectedShapeStyle = MobileSegment.ShapeStyle( backgroundColor = DEFAULT_COLOR_BLACK, opacity = 1f, cornerRadius = CHECKBOX_CORNER_RADIUS ) - // Then - assertThat(foregroundWireframe?.shapeStyle).isEqualTo(expectedShapeStyle) + assertThat(foregroundWireframe.shapeStyle).isEqualTo(expectedShapeStyle) } @Test @@ -400,6 +401,7 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest asyncJobStatusCallback = mockAsyncJobStatusCallback ) + // Then val expectedShapeStyle = MobileSegment.ShapeStyle( backgroundColor = fakeFillColorHexString, opacity = 1f, @@ -411,7 +413,6 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest width = BOX_BORDER_WIDTH_DP ) - // Then verify(mockUiContext.imageWireframeHelper).createImageWireframeByPath( id = any(), globalBounds = eq(fakeGlobalBounds), @@ -492,11 +493,12 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest parentContext = mockUiContext, asyncJobStatusCallback = mockAsyncJobStatusCallback ) + + // Then assertThat(wireframes.wireframes).hasSize(1) - val actualWireframe = wireframes.wireframes[0] as? MobileSegment.Wireframe.ShapeWireframe + val actualWireframe = wireframes.wireframes[0] as MobileSegment.Wireframe.ShapeWireframe assertThat(actualWireframe).isNotNull - // Then verify(mockUiContext.imageWireframeHelper, never()).createImageWireframeByBitmap( id = any(), globalBounds = any(), @@ -509,7 +511,7 @@ internal class CheckboxSemanticsNodeMapperTest : AbstractSemanticsNodeMapperTest shapeStyle = anyOrNull(), border = anyOrNull() ) - assertThat(actualWireframe?.shapeStyle?.backgroundColor).isEqualTo(DEFAULT_COLOR_WHITE) - assertThat(actualWireframe?.border?.color).isEqualTo(DEFAULT_COLOR_BLACK) + assertThat(actualWireframe.shapeStyle?.backgroundColor).isEqualTo(DEFAULT_COLOR_WHITE) + assertThat(actualWireframe.border?.color).isEqualTo(DEFAULT_COLOR_BLACK) } } diff --git a/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/RootSemanticsNodeMapperTest.kt b/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/RootSemanticsNodeMapperTest.kt index 12f6a764b0..a8e401c6c0 100644 --- a/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/RootSemanticsNodeMapperTest.kt +++ b/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/mappers/semantics/RootSemanticsNodeMapperTest.kt @@ -104,7 +104,7 @@ class RootSemanticsNodeMapperTest { } @Test - fun `M use ContainerSemanticsNodeMapper W map { role is missing }`() { + fun `M use ContainerSemanticsNodeMapper W createComposeWireframes { role is missing }`() { // Given val mockSemanticsNode = mockSemanticsNode(null) @@ -125,7 +125,7 @@ class RootSemanticsNodeMapperTest { } @Test - fun `M use ButtonSemanticsNodeMapper W map { role is Button }`() { + fun `M use ButtonSemanticsNodeMapper W createComposeWireframes { role is Button }`() { // Given val mockSemanticsNode = mockSemanticsNode(Role.Button) @@ -146,7 +146,7 @@ class RootSemanticsNodeMapperTest { } @Test - fun `M use RadioButtonSemanticsNodeMapper W map { role is RadioButton }`() { + fun `M use RadioButtonSemanticsNodeMapper W createComposeWireframes { role is RadioButton }`() { // Given val mockSemanticsNode = mockSemanticsNode(Role.RadioButton) @@ -167,7 +167,7 @@ class RootSemanticsNodeMapperTest { } @Test - fun `M use TabSemanticsNodeMapper W map { role is Tab }`() { + fun `M use TabSemanticsNodeMapper W createComposeWireframes { role is Tab }`() { // Given val mockSemanticsNode = mockSemanticsNode(Role.Tab) @@ -188,7 +188,7 @@ class RootSemanticsNodeMapperTest { } @Test - fun `M use ImageSemanticsNodeMapper W map { role is Image }`() { + fun `M use ImageSemanticsNodeMapper W createComposeWireframes { role is Image }`() { // Given val mockSemanticsNode = mockSemanticsNode(Role.Image) @@ -209,7 +209,7 @@ class RootSemanticsNodeMapperTest { } @Test - fun `M use CheckboxSemanticsNodeMapper W map { role is Checkbox }`() { + fun `M use CheckboxSemanticsNodeMapper W createComposeWireframes { role is Checkbox }`() { // Given val mockSemanticsNode = mockSemanticsNode(Role.Checkbox) diff --git a/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/ColorUtilsTest.kt b/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/ColorUtilsTest.kt index e10d1ac934..4b6b44940f 100644 --- a/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/ColorUtilsTest.kt +++ b/features/dd-sdk-android-session-replay-compose/src/test/kotlin/com/datadog/android/sessionreplay/compose/internal/utils/ColorUtilsTest.kt @@ -6,13 +6,13 @@ package com.datadog.android.sessionreplay.compose.internal.utils +import com.datadog.android.sessionreplay.compose.internal.utils.ColorUtils.Companion.RGBA_LENGTH import com.datadog.android.sessionreplay.compose.test.elmyr.SessionReplayComposeForgeConfigurator import fr.xgouchet.elmyr.Case import fr.xgouchet.elmyr.Forge import fr.xgouchet.elmyr.junit5.ForgeConfiguration import fr.xgouchet.elmyr.junit5.ForgeExtension import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith import org.junit.jupiter.api.extension.Extensions @@ -28,15 +28,10 @@ import org.mockito.quality.Strictness @ForgeConfiguration(SessionReplayComposeForgeConfigurator::class) internal class ColorUtilsTest { - private lateinit var testedUtils: ColorUtils - - @BeforeEach - fun `set up`() { - testedUtils = ColorUtils() - } + private val testedUtils = ColorUtils() @Test - fun `M return input value W convertRgbaToArgb() { length lt 2 }`( + fun `M return input value W convertRgbaToArgb() { length is less than 8 }`( forge: Forge ) { // Given @@ -51,7 +46,7 @@ internal class ColorUtilsTest { forge: Forge ) { // Given - val fakeColorHexString = forge.anHexadecimalString(Case.UPPER, 8) + val fakeColorHexString = forge.anHexadecimalString(Case.UPPER, RGBA_LENGTH) val expectedResult = "#" + fakeColorHexString.substring(6) + fakeColorHexString.substring(0, 6) // Then diff --git a/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/ResourceResolver.kt b/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/ResourceResolver.kt index b7d757761a..84294b0796 100644 --- a/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/ResourceResolver.kt +++ b/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/ResourceResolver.kt @@ -43,6 +43,8 @@ internal class ResourceResolver( ) ) { + // region internal + @MainThread internal fun resolveResourceIdFromBitmap( bitmap: Bitmap, diff --git a/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/utils/PathUtils.kt b/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/utils/PathUtils.kt index ecb4e08af9..0c07ee6bc4 100644 --- a/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/utils/PathUtils.kt +++ b/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/utils/PathUtils.kt @@ -77,7 +77,7 @@ internal class PathUtils( // path initial bounds val originalBounds = RectF() - @Suppress("DEPRECATION") // the new api is flagged as unstable + @Suppress("DEPRECATION") // # TODO RUM-7784 replace when possible path.computeBounds(originalBounds, true) // calculate the scale factor diff --git a/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/utils/ImageWireframeHelper.kt b/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/utils/ImageWireframeHelper.kt index 0c6790bc6d..8eb79247b8 100644 --- a/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/utils/ImageWireframeHelper.kt +++ b/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/utils/ImageWireframeHelper.kt @@ -24,7 +24,7 @@ import com.datadog.android.sessionreplay.recorder.resources.DrawableCopier interface ImageWireframeHelper { /** - * Asks the helper to create an image wireframe based on a given path. + * Creates an image wireframe based on a given path. * @param id the unique id for the wireframe. * @param globalBounds the global bounds of the bitmap. * @param path the path to use to create the wireframe. @@ -62,7 +62,7 @@ interface ImageWireframeHelper { ): MobileSegment.Wireframe? /** - * Asks the helper to create an image wireframe based on a given bitmap. + * Creates an image wireframe based on a given bitmap. * @param id the unique id for the wireframe. * @param globalBounds the global bounds of the bitmap. * @param bitmap the bitmap to capture. @@ -88,7 +88,7 @@ interface ImageWireframeHelper { ): MobileSegment.Wireframe? /** - * Asks the helper to create an image wireframe, and process the provided drawable in the background. + * Creates an image wireframe, and process the provided drawable in the background. * @param view the view owning the drawable * @param imagePrivacy defines which images should be hidden * @param currentWireframeIndex the index of the wireframe in the list of wireframes for the view diff --git a/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/DefaultImageWireframeHelperTest.kt b/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/DefaultImageWireframeHelperTest.kt index f717801d84..0471d5d111 100644 --- a/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/DefaultImageWireframeHelperTest.kt +++ b/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/DefaultImageWireframeHelperTest.kt @@ -1469,7 +1469,7 @@ internal class DefaultImageWireframeHelperTest { resourceResolverCallback = any() ) ).thenAnswer { - val callback = it.arguments[6] as ResourceResolverCallback + val callback = it.getArgument(6) callback.onSuccess(fakeResourceId) } @@ -1529,7 +1529,7 @@ internal class DefaultImageWireframeHelperTest { resourceResolverCallback = any() ) ).thenAnswer { - val callback = it.arguments[6] as ResourceResolverCallback + val callback = it.getArgument(6) callback.onFailure() }