小编And*_*ton的帖子

Kotlin中列表或数组的产品

我试图找到一种方法来获得List或Array的产品而不使用"重复"或Kotlin上的任何循环但经过一些研究我找不到类似的东西.

Python中的这样的东西是:

>>> reduce(lambda x, y: x*y, [1,2,3,4,5,6])
output: 720
Run Code Online (Sandbox Code Playgroud)

kotlin

5
推荐指数
3
解决办法
1146
查看次数

暂停和恢复Lottie动画

我正在实施一个Lottie动画,整个动画效果很好!但是,我想添加一些代码,这些代码将在30帧之后暂停动画,然后我可以在一定时间后恢复.这是迄今为止的代码

animationView.playAnimation(0, 30)
animationView.addAnimatorListener(object : Animator.AnimatorListener {
   override fun onAnimationEnd(animation: Animator) {
      if (isLoading == false) {
         //Everything has loaded. Continue Animation 

         //This line has no effect. The animation does not continue
         animationView.playAnimation(30, 60)
         //Resuming the animation just makes the animation disappear
         //animation.resume()
      }
 }
Run Code Online (Sandbox Code Playgroud)

任何意见,将不胜感激!

android android-animation kotlin lottie-android

4
推荐指数
2
解决办法
6846
查看次数