Skip to content

Commit

Permalink
Fix brave/brave-ios#6787: Start Brave News onboarding animation after…
Browse files Browse the repository at this point in the history
… a small delay (brave/brave-ios#6951)
  • Loading branch information
kylehickinson authored Feb 16, 2023
1 parent 0ce982f commit 74074ca
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 74074ca

Please sign in to comment.