Skip to content

Instantly share code, notes, and snippets.

@saishaddai
Created March 4, 2019 06:12
Show Gist options
  • Save saishaddai/22535e4ecb14169d86ee07a68cb88825 to your computer and use it in GitHub Desktop.
Save saishaddai/22535e4ecb14169d86ee07a68cb88825 to your computer and use it in GitHub Desktop.
package com.saishaddai.bwq
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.view.animation.AnimationUtils
import android.widget.TextView
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val bounceAnimation = AnimationUtils.loadAnimation(this, R.anim.bounce_animation)
val textViewToBounce = findViewById<TextView>(R.id.textViewToBounce)
textViewToBounce.setOnClickListener {
textViewToBounce.startAnimation(bounceAnimation)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment