From 8938c3665eb247b6c388fe84075bbf47688be089 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Fri, 8 Nov 2024 10:05:59 -0500 Subject: [PATCH] SImplify Android Session Replay configuration --- .../kotlin/io/bitdrift/capture/ContextHolder.kt | 2 +- .../capture/replay/ReplayMapperConfiguration.kt | 16 ---------------- .../capture/replay/SessionReplayConfiguration.kt | 7 ++++--- .../replay/internal/ViewMapperConfiguration.kt | 2 +- .../features/SessionReplayConfiguration.swift | 4 +--- 5 files changed, 7 insertions(+), 24 deletions(-) delete mode 100644 platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/ReplayMapperConfiguration.kt diff --git a/platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/ContextHolder.kt b/platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/ContextHolder.kt index 955b46e5..1c68c729 100644 --- a/platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/ContextHolder.kt +++ b/platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/ContextHolder.kt @@ -12,7 +12,7 @@ import android.content.Context import androidx.startup.Initializer /** - * Allows Bitdrift to be initialized with the host ApplicationContext instance + * Allows Capture SDK to be initialized with the host ApplicationContext instance */ class ContextHolder : Initializer { override fun create(context: Context): ContextHolder { diff --git a/platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/ReplayMapperConfiguration.kt b/platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/ReplayMapperConfiguration.kt deleted file mode 100644 index 134417e2..00000000 --- a/platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/ReplayMapperConfiguration.kt +++ /dev/null @@ -1,16 +0,0 @@ -// capture-sdk - bitdrift's client SDK -// Copyright Bitdrift, Inc. All rights reserved. -// -// Use of this source code is governed by a source available license that can be found in the -// LICENSE file or at: -// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt - -package io.bitdrift.capture.replay - -/** - * Map used to matching third party Android views to Bitdrift view types - * @param customMapper list of known types - */ -class ReplayMapperConfiguration( - val customMapper: Map>, -) diff --git a/platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/SessionReplayConfiguration.kt b/platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/SessionReplayConfiguration.kt index cc3d7901..e568f39a 100644 --- a/platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/SessionReplayConfiguration.kt +++ b/platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/SessionReplayConfiguration.kt @@ -8,9 +8,10 @@ package io.bitdrift.capture.replay /** - * A configuration used to configure Bitdrift session replay feature. - * @param replayMapperConfiguration Map used to matching third party Android views to Bitdrift view types. + * A configuration used to configure bitdrift session replay feature. + * + * @param categorizers Map used to matching third party Android views to bitdrift view types. */ data class SessionReplayConfiguration @JvmOverloads constructor( - val replayMapperConfiguration: ReplayMapperConfiguration? = null, + val categorizers: Map>? = null, ) diff --git a/platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/internal/ViewMapperConfiguration.kt b/platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/internal/ViewMapperConfiguration.kt index 959727db..3ca4fcbe 100644 --- a/platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/internal/ViewMapperConfiguration.kt +++ b/platform/jvm/replay/src/main/kotlin/io/bitdrift/capture/replay/internal/ViewMapperConfiguration.kt @@ -12,7 +12,7 @@ import io.bitdrift.capture.replay.ReplayType internal class ViewMapperConfiguration( private val externalMapper: Map>? = - ReplayModule.replayDependencies.sessionReplayConfiguration.replayMapperConfiguration?.customMapper, + ReplayModule.replayDependencies.sessionReplayConfiguration.categorizers, ) { /** diff --git a/platform/swift/source/features/SessionReplayConfiguration.swift b/platform/swift/source/features/SessionReplayConfiguration.swift index 32a56db4..ddb05f90 100644 --- a/platform/swift/source/features/SessionReplayConfiguration.swift +++ b/platform/swift/source/features/SessionReplayConfiguration.swift @@ -13,9 +13,7 @@ public struct SessionReplayConfiguration { /// Initializes a new session replay configuration. /// - /// - parameter categorizers: A mapping that provides additional instructions on how views implemented - /// with specific class names should be represented in session replay - /// capture visualizations. + /// - parameter categorizers: Map used to match third-party views to bitdrift session replay view types. public init(categorizers: [String: AnnotatedView] = [:]) { self.categorizers = categorizers }