mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
Adjusted visibility actions work for video start
commit_hash:4c560ff792489455c3f5da2cbde80b4781dc3b80
This commit is contained in:
+2
-1
@@ -447,6 +447,7 @@ private final class DecoratingView: UIControl, BlockViewProtocol, VisibleBoundsT
|
||||
passVisibleBoundsChanged(from: from, to: to)
|
||||
|
||||
if model.visibilityParams != nil {
|
||||
if from == .zero, to == .zero { return }
|
||||
visibilityActionPerformers?.onVisibleBoundsChanged(to: to, bounds: bounds)
|
||||
}
|
||||
}
|
||||
@@ -498,7 +499,7 @@ extension DecoratingView {
|
||||
case let .actions(actions):
|
||||
actions.forEach { $0.perform(sendingFrom: self) }
|
||||
case .contextMenu:
|
||||
break;
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -39,6 +39,11 @@ final class VisibilityActionPerformers {
|
||||
} else {
|
||||
min(Int(to.area * 100 / bounds.area), 100)
|
||||
}
|
||||
|
||||
guard visibleAreaPercentageAfter != visibleAreaPercentageBefore else {
|
||||
return
|
||||
}
|
||||
|
||||
visibilityParams.lastVisibleArea.value = visibleAreaPercentageAfter
|
||||
|
||||
for performer in actionPerformers {
|
||||
|
||||
Reference in New Issue
Block a user