Skip to content

Commit

Permalink
fix: only track button text for the elementInteraction option of auto…
Browse files Browse the repository at this point in the history
…capture
  • Loading branch information
PouriaAmini committed Aug 13, 2024
1 parent 585b3b5 commit 12c0944
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.amplitude.android.internal.locators

import android.view.View
import android.widget.TextView
import android.widget.Button
import com.amplitude.android.internal.ViewResourceUtils.resourceIdWithFallback
import com.amplitude.android.internal.ViewTarget
import com.amplitude.android.internal.ViewTarget.Type
Expand Down Expand Up @@ -31,7 +31,7 @@ internal class AndroidViewTargetLocator : ViewTargetLocator {
val tag = tag
?.takeIf { it is String || it is Number || it is Boolean || it is Char }
?.toString()
val text = (this as? TextView)?.text?.toString()
val text = (this as? Button)?.text?.toString()
return ViewTarget(this, className, resourceName, tag, text, SOURCE, hierarchy)
}

Expand Down

0 comments on commit 12c0944

Please sign in to comment.