-
Notifications
You must be signed in to change notification settings - Fork 727
Description
Requirements for our project have visibility tracking of elements at 50% visibility. Since both VisibilityState.FOCUSED_VISIBLE
and VisibilityState.FULL_IMPRESSION_VISIBLE
do not cover this state, we were thinking of extending the visibility tracker.
The idea would be to offer some api to define a threshold (range 0..1) for when a visibility state would be triggered. This could either be applied to the VisibilityState.FULL_IMPRESSION_VISIBLE
, which would redefine what a full impression is in the app context, or preferably introduce a new state VisibilityState.PARTIAL_IMPRESSION_VISIBLE
. Implementation would be very similar to VisibilityItem#handleFullImpressionVisible
.
Now we could probably handle this using the visibilityChanged
, but it would be more involved to not double-count the impression and it would trigger quite often (so we would not be able to disable the noisy onChanged (visibilityChangedEnabled
).
I think there might be more use-cases which would warrant to have a single-event impression for a certain threshold of visibility. If you think it might be useful, I will whip up a PR within the next weeks.