SHARE
TWEET

Untitled

a guest Jul 16th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class MainActivity extends AppCompatActivity {
  2.  
  3.     TextView txtv;
  4.     SpringAnimation springAnim;
  5.     @Override
  6.     protected void onCreate(Bundle savedInstanceState) {
  7.         super.onCreate(savedInstanceState);
  8.         setContentView(R.layout.activity_main);
  9.  
  10.         txtv = (TextView) findViewById(R.id.txt1);
  11.  
  12.         txtv.setOnClickListener(new View.OnClickListener() {
  13.             @Override
  14.             public void onClick(View v) {
  15.                 springAnim = new SpringAnimation(txtv, DynamicAnimation.TRANSLATION_Y, 0);
  16.                 springAnim.setStartVelocity(20000);
  17.                 springAnim.setMaxValue(800);
  18.                 springAnim.start();
  19.             }
  20.         });
  21.     }
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top