Your First Kotlin Android App · Animations | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4936497-your-first-kotlin-android-app/lessons/40

At 02:37, you said “… will not return to original position before the animation”, which doesn’t make sense. Shouldn’t it say, “… will not return to original position after the animation” instead?

@rbondoc Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hello.
I have this issu after press button:

java.lang.RuntimeException: Unknown interpolator name: set
    at android.view.animation.AnimationUtils.createInterpolatorFromXml(AnimationUtils.java:431)
    at android.view.animation.AnimationUtils.loadInterpolator(AnimationUtils.java:342)
    at android.view.animation.Animation.setInterpolator(Animation.java:406)
    at android.view.animation.Animation.<init>(Animation.java:275)
    at android.view.animation.AnimationSet.<init>(AnimationSet.java:81)
    at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:181)
    at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:158)
    at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:139)
    at com.wagnerrodrigues.timefighter.MainActivity$onCreate$1.onClick(MainActivity.kt:49)
    at android.view.View.performClick(View.java:7448)
    at android.view.View.performClickInternal(View.java:7425)
    at android.view.View.access$3600(View.java:810)
    at android.view.View$PerformClick.run(View.java:28305)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7656)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

My github repository : https://github.com/wagner92sr/TimeFighter

Issue solved.
the error was in this point : android:interpolator="@anim/bounce">
the correct code is android:interpolator="@android:anim/bounce_interpolator">

Hey there Folks!!!

I ran into a little hick up… hoping y’all can help a feller out… Okay so it goes like this… the below code was followed step by step from the video… butt… where it is typed view.startAnimation… the view text gives me an error “unresolved reference: view” okay so that’s a little hick up, but i would like to see the animation for myself, but can’t until the error is resolved… :sunglasses: :+1:

tapMeButton.setOnClickListener{
val bounceAnimation = AnimationUtils.loadAnimation(this, R.anim.bounce)
view.startAnimaiton(bounceAnimation)
incrementScore()
}

@gelliecoltru

Just change view.startAnimaiton(bounceAnimation) with

tapMeButton.startAnimation(bounceAnimation)

and it should work.