Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MainActivity extends AppCompatActivity {
- TextView txtv;
- SpringAnimation springAnim;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- txtv = (TextView) findViewById(R.id.txt1);
- txtv.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- springAnim = new SpringAnimation(txtv, DynamicAnimation.TRANSLATION_Y, 0);
- springAnim.setStartVelocity(20000);
- springAnim.setMaxValue(800);
- springAnim.start();
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement