Skip to content

ComponentPredicate

Xavier F. Gouchet edited this page Sep 4, 2024 · 1 revision

interface ComponentPredicate<T>

Used to decide which Android component of your application should be considered as a RUM View Event instance in a ViewTrackingStrategy.

See also

FragmentViewTrackingStrategy
ActivityViewTrackingStrategy

Inheritors

AcceptAllActivities
AcceptAllDefaultFragment
AcceptAllNavDestinations
AcceptAllSupportFragments

Functions

accept

abstract fun accept(component: T): Boolean

Decides whether the provided component should be considered as a RUM View. Make sure you are consistent when you validate a component otherwise you may experience some weird behaviours (e.g. by returning true in a first interrogation for a component followed by false in a second interrogation we might alter the data in the in progress View event or we might close the current valid View prematurely).

Return

true if you want the component to be tracked as a View, false otherwise

Parameters
component a component whose state changed

getViewName

abstract fun getViewName(component: T): String?

Sets a custom name for the tracked RUM View.

Return

the name to use for this view (if null or blank, the default will be used)

Clone this wiki locally