Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #6787: Start Brave News onboarding animation after a small delay
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehickinson committed Feb 16, 2023
1 parent 48ae17f commit f4d14ba
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ class BraveNewsSectionProvider: NSObject, NTPObservableSectionProvider {

func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
if indexPath.item == 0, let cell = cell as? FeedCardCell<BraveNewsOptInView> {
cell.content.graphicAnimationView.play()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
// Seems like there is a CoreGraphics glitch somewhere here after we create a new tab it starts
// playing too quickly before the tab tray animation is done, so it doesn't play... possibly a Lottie
// bug
cell.content.graphicAnimationView.play()
}
}
if let card = dataSource.state.cards?[safe: indexPath.item] {
if !viewedCards.contains(card) && collectionView.contentOffset.y > 0 {
Expand Down

0 comments on commit f4d14ba

Please sign in to comment.