Skip to content

Conversation

@jamie23
Copy link
Contributor

@jamie23 jamie23 commented Apr 21, 2021

Task/Issue URL: #1159
Tech Design URL:
CC:

Description:
When we check that the animation is enabled we can also check that the animator duration scale is set, if it is set to 0 then we skip the animation.

Steps to test this PR:

  1. Set Animator duration scale to Animation off
  2. Select Clear all tabs and data.
  3. Now we skip the animation unlike previously where we would get stuck on a black screen.

Internal references:

Software Engineering Expectations
Technical Design Template

private fun animationEnabled() = settingsDataStore.fireAnimationEnabled && animatorDurationEnabled()

private fun animatorDurationEnabled(): Boolean {
val animatorScale = Settings.Global.getFloat(context.contentResolver, ANIMATOR_DURATION_SCALE, 1.0f)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think default value should not be 1f but rather 0.0f To fall on the safe side when the value is not defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot @aitorvs, I've made the appropriate change.

@aitorvs
Copy link
Collaborator

aitorvs commented Apr 22, 2021

Good job @jamie23 . I left one minor comment to error on the safe side.

I have tested this for:

  1. window animation scale off
  2. transition animation scale off
  3. animator duration scale off
  4. and any combination of the above

All working properly

Copy link
Collaborator

@aitorvs aitorvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome @jamie23! thanks a lot for the contribution.

@aitorvs aitorvs merged commit 75606bc into duckduckgo:develop Apr 27, 2021
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.

2 participants