Class VisibilityTrackerExtsKt
-
- All Implemented Interfaces:
public final class VisibilityTrackerExtsKt
-
-
Method Summary
Modifier and Type Method Description final static BooleancheckVisibility(View adView, Dimension minDimension)Checks if an ad view is visible based on its basic properties. final static BooleancheckVisibility(View adView, Rect adViewRect, Integer minPercentageViewable, Dimension minDimension)Checks if an ad view is visible based on its properties, visible area, and minimum percentage. final static BooleanisNotObstructed(View adView, Rect adViewRect, Integer minPercentageViewable, List<View> friendlyViews)Checks if an ad view is not obstructed by other views. final static BooleanisTransparent(View $self)Checks if a view has a transparent view. -
-
Method Detail
-
checkVisibility
final static Boolean checkVisibility(View adView, Dimension minDimension)
Checks if an ad view is visible based on its basic properties.
This function checks if the ad view is visible, has a parent, is shown, and meets the minimum dimension requirements.
- Parameters:
adView- The ad view to check.minDimension- The minimum dimension requirements.- Returns:
trueif the ad view is visible,falseotherwise.
-
checkVisibility
final static Boolean checkVisibility(View adView, Rect adViewRect, Integer minPercentageViewable, Dimension minDimension)
Checks if an ad view is visible based on its properties, visible area, and minimum percentage.
This function checks if the ad view is visible, meets the minimum dimension requirements, and has a visible area that meets the minimum percentage requirement.
- Parameters:
adView- The ad view to check.adViewRect- The rectangle representing the visible area of the ad view.minPercentageViewable- The minimum percentage of the ad view that must be visible.minDimension- The minimum dimension requirements.- Returns:
trueif the ad view is visible,falseotherwise.
-
isNotObstructed
final static Boolean isNotObstructed(View adView, Rect adViewRect, Integer minPercentageViewable, List<View> friendlyViews)
Checks if an ad view is not obstructed by other views.
This function checks if the ad view is obstructed by any of its siblings in the view hierarchy. It considers friendly views as non-obstructing.
- Parameters:
adView- The ad view to check.adViewRect- The rectangle representing the visible area of the ad view.minPercentageViewable- The minimum percentage of the ad view that must be visible.friendlyViews- The list of friendly views that should not be considered obstructions.- Returns:
trueif the ad view is not obstructed,falseotherwise.
-
isTransparent
final static Boolean isTransparent(View $self)
Checks if a view has a transparent view.
This function checks if the view's background and foreground (if available) are transparent.
- Returns:
trueif the view has a transparent background,falseotherwise.
-
-
-
-