pull/1403/head
gedoor 3 years ago
parent 7aeacfd308
commit c60edaa0fc
  1. 3
      app/src/main/java/io/legado/app/ui/widget/anima/explosion_field/ExplosionAnimator.kt
  2. 8
      app/src/main/java/io/legado/app/ui/widget/anima/explosion_field/ExplosionView.kt

@ -16,14 +16,17 @@
package io.legado.app.ui.widget.anima.explosion_field
import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.graphics.*
import android.view.View
import android.view.animation.AccelerateInterpolator
import java.util.*
import kotlin.math.pow
@SuppressLint("Recycle")
class ExplosionAnimator(private val mContainer: View, bitmap: Bitmap, bound: Rect) :
ValueAnimator() {
private val mPaint: Paint = Paint()
private val mParticles: Array<Particle?>
private val mBound: Rect = Rect(bound)

@ -24,8 +24,8 @@ import android.graphics.Canvas
import android.graphics.Rect
import android.media.MediaPlayer
import android.util.AttributeSet
import android.util.Log
import android.view.View
import timber.log.Timber
import java.util.*
@ -99,8 +99,6 @@ class ExplosionView @JvmOverloads constructor(context: Context, attrs: Attribute
view.getGlobalVisibleRect(r)
val location = IntArray(2)
getLocationOnScreen(location)
// getLocationInWindow(location);
// view.getLocationInWindow(location);
r.offset(-location[0], -location[1])
r.inset(-mExpandInset[0], -mExpandInset[1])
val startDelay = 100
@ -128,11 +126,11 @@ class ExplosionView @JvmOverloads constructor(context: Context, attrs: Attribute
}
override fun onAnimationCancel(animator: Animator) {
Log.i("PRUEBA", "CANCEL")
Timber.i("CANCEL")
}
override fun onAnimationRepeat(animator: Animator) {
Log.i("PRUEBA", "REPEAT")
Timber.i("REPEAT")
}
})

Loading…
Cancel
Save