|
|
|
@ -4,11 +4,7 @@
|
|
|
|
|
|
|
|
|
|
package org.mozilla.fenix.wallpapers
|
|
|
|
|
|
|
|
|
|
import android.animation.AnimatorSet
|
|
|
|
|
import android.animation.ObjectAnimator
|
|
|
|
|
import android.content.Context
|
|
|
|
|
import android.os.Handler
|
|
|
|
|
import android.os.Looper
|
|
|
|
|
import android.view.View
|
|
|
|
|
import androidx.appcompat.app.AppCompatDelegate
|
|
|
|
|
import mozilla.components.support.base.log.logger.Logger
|
|
|
|
@ -100,41 +96,4 @@ class WallpaperManager(private val settings: Settings) {
|
|
|
|
|
Wallpaper.valueOf(currentWallpaper)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Animates the Firefox logo, if it hasn't been animated before, otherwise nothing will happen.
|
|
|
|
|
* After animating the first time, the [Settings.shouldAnimateFirefoxLogo] setting
|
|
|
|
|
* will be updated.
|
|
|
|
|
*/
|
|
|
|
|
@Suppress("MagicNumber")
|
|
|
|
|
fun animateLogoIfNeeded(logo: View) {
|
|
|
|
|
if (!settings.shouldAnimateFirefoxLogo) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
Handler(Looper.getMainLooper()).postDelayed(
|
|
|
|
|
{
|
|
|
|
|
val animator1 = ObjectAnimator.ofFloat(logo, "rotation", 0f, 10f)
|
|
|
|
|
val animator2 = ObjectAnimator.ofFloat(logo, "rotation", 10f, 0f)
|
|
|
|
|
val animator4 = ObjectAnimator.ofFloat(logo, "rotation", 10f, 0f)
|
|
|
|
|
val animator3 = ObjectAnimator.ofFloat(logo, "rotation", 0f, 10f)
|
|
|
|
|
|
|
|
|
|
animator1.duration = 200
|
|
|
|
|
animator2.duration = 200
|
|
|
|
|
animator3.duration = 200
|
|
|
|
|
animator4.duration = 200
|
|
|
|
|
|
|
|
|
|
val set = AnimatorSet()
|
|
|
|
|
|
|
|
|
|
set.play(animator1).before(animator2).after(animator3).before(animator4)
|
|
|
|
|
set.start()
|
|
|
|
|
|
|
|
|
|
settings.shouldAnimateFirefoxLogo = false
|
|
|
|
|
},
|
|
|
|
|
ANIMATION_DELAY_MS
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
companion object {
|
|
|
|
|
private const val ANIMATION_DELAY_MS = 1500L
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|