Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple: Change accesscontrol to methods that are not used in other files to private. #2296

Merged
merged 7 commits into from
Jan 25, 2024
Merged

Conversation

DevVenusK
Copy link
Contributor

Currently, the updateRasterizationState method is not being used in other files, but the accesscontrol is set to internal. So I changed it to private.

If you need to use it in another file in the future, it would be a good idea to change it to internal.

@calda
Copy link
Member

calda commented Jan 24, 2024

The implementation of LottieAnimationView.updateRasterizationState is:

  func updateRasterizationState() {
    if lottieAnimationLayer.isAnimationPlaying {
      lottieAnimationLayer.animationLayer?.shouldRasterize = false
    } else {
      lottieAnimationLayer.animationLayer?.shouldRasterize = lottieAnimationLayer.shouldRasterizeWhenIdle
    }
  }

which is identical to the implementation of LottieAnimationLayer.updateRasterizationState.

It seems like a better change would be to update LottieAnimationView.updateRasterizationState to just call through to the underlying layer like this:

  func updateRasterizationState() {
    lottieAnimationLayer.updateRasterizationState()
  }

@DevVenusK
Copy link
Contributor Author

DevVenusK commented Jan 25, 2024

The implementation of LottieAnimationView.updateRasterizationState is:

  func updateRasterizationState() {
    if lottieAnimationLayer.isAnimationPlaying {
      lottieAnimationLayer.animationLayer?.shouldRasterize = false
    } else {
      lottieAnimationLayer.animationLayer?.shouldRasterize = lottieAnimationLayer.shouldRasterizeWhenIdle
    }
  }

which is identical to the implementation of LottieAnimationLayer.updateRasterizationState.

It seems like a better change would be to update LottieAnimationView.updateRasterizationState to just call through to the underlying layer like this:

  func updateRasterizationState() {
    lottieAnimationLayer.updateRasterizationState()
  }

@calda That sounds great! I fixed it and requested it again! commit 9d18405

… public method, And LottieAnimationView call that method
… internal method, And LottieAnimationView call that method
@calda calda enabled auto-merge (squash) January 25, 2024 17:15
@calda calda merged commit 99c2f68 into airbnb:master Jan 25, 2024
13 checks passed
MoroziOS pushed a commit to MoroziOS/tmg-lottie-ios that referenced this pull request May 22, 2024
…`LottieAnimationLayer.updateRasterizationState` (airbnb#2296)

Co-authored-by: Hyosung <[email protected]>
Co-authored-by: Cal Stephens <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants