File tree Expand file tree Collapse file tree
src/main/java/com/sackcentury/shinebuttonlib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ android {
1212
1313 defaultConfig {
1414 applicationId " com.sackcentury.shinebutton"
15- minSdkVersion 14
15+ minSdkVersion 21
1616 targetSdkVersion 34
1717 versionCode 1
1818 versionName " 1.0"
Original file line number Diff line number Diff line change @@ -43,15 +43,15 @@ dependencies {
4343 implementation " org.jetbrains.kotlin:kotlin-stdlib:1.7.20"
4444 testImplementation ' junit:junit:4.13.2'
4545 implementation ' androidx.appcompat:appcompat:1.6.1'
46- implementation ' com.github.MasayukiSuda:EasingInterpolator:v1.3.2'
4746
4847 // Compose dependencies
49- def compose_version = ' 1.3.3'
50- implementation " androidx.compose.ui:compose-ui:$compose_version "
51- implementation " androidx.compose.material:compose-material:$compose_version "
52- implementation " androidx.compose.ui:compose-ui-tooling-preview:$compose_version "
53- implementation " androidx.compose.runtime:compose-runtime:$compose_version "
54- implementation " androidx.compose.animation:compose-animation:$compose_version "
48+ def composeBom = platform(' androidx.compose:compose-bom:2023.01.00' )
49+ implementation composeBom
50+ implementation ' androidx.compose.ui:ui'
51+ implementation ' androidx.compose.material:material'
52+ implementation ' androidx.compose.ui:ui-tooling-preview'
53+ implementation ' androidx.compose.runtime:runtime'
54+ implementation ' androidx.compose.animation:animation'
5555}
5656
5757// apply from: '../gradle-mvn-push.gradle'
Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ package com.sackcentury.shinebuttonlib
22
33import android.animation.ValueAnimator
44import android.graphics.Canvas
5- import com.daasuu.ei.Ease
6- import com.daasuu.ei.EasingInterpolator
5+ import com.sackcentury.shinebuttonlib.interpolator.QuartOutInterpolator
76
87/* *
98 * ShineAnimator handles the value animation for the shine effect particles.
@@ -21,7 +20,7 @@ class ShineAnimator : ValueAnimator {
2120 setFloatValues(1f , maxValue)
2221 duration = animDuration
2322 startDelay = 200
24- interpolator = EasingInterpolator ( Ease . QUART_OUT )
23+ interpolator = QuartOutInterpolator ( )
2524 }
2625
2726 constructor (durationMs: Long , maxValue: Float , delay: Long ) {
@@ -30,7 +29,7 @@ class ShineAnimator : ValueAnimator {
3029 setFloatValues(1f , maxValue)
3130 duration = durationMs
3231 startDelay = delay
33- interpolator = EasingInterpolator ( Ease . QUART_OUT )
32+ interpolator = QuartOutInterpolator ( )
3433 }
3534
3635 fun startAnim () {
Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ import android.graphics.RectF
1010import android.util.AttributeSet
1111import android.view.View
1212import android.view.ViewGroup
13- import com.daasuu.ei.Ease
14- import com.daasuu.ei.EasingInterpolator
13+ import com.sackcentury.shinebuttonlib.interpolator.QuartOutInterpolator
1514import com.sackcentury.shinebuttonlib.listener.SimpleAnimatorListener
1615import java.util.*
1716
@@ -124,7 +123,7 @@ class ShineView : View {
124123 // Click splash animation (expanding circle)
125124 clickAnimator = ValueAnimator .ofFloat(0f , 1.1f ).apply {
126125 duration = clickAnimDuration
127- interpolator = EasingInterpolator ( Ease . QUART_OUT )
126+ interpolator = QuartOutInterpolator ( )
128127 addUpdateListener { valueAnimator ->
129128 clickValue = valueAnimator.animatedValue as Float
130129 invalidate()
Original file line number Diff line number Diff line change 1+ package com.sackcentury.shinebuttonlib.interpolator
2+
3+ import android.view.animation.Interpolator
4+ import kotlin.math.pow
5+
6+ /* *
7+ * A local implementation of the QuartOut easing function to remove the dependency
8+ * on the external EasingInterpolator library which was causing JitPack 403 errors.
9+ */
10+ class QuartOutInterpolator : Interpolator {
11+ override fun getInterpolation (input : Float ): Float {
12+ val t = input - 1f
13+ return - (t.pow(3 ) * t - 1f )
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments