Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chrono = new Timer();
- AnimationSet animationSet = new AnimationSet(true);
- animationSet.setFillAfter(true);
- Animation anim2 = AnimationUtils.loadAnimation(RecordActivity.this, R.anim.rotate_90);
- animationSet.addAnimation(anim2);
- int txtHeight = chronoView.getHeight();
- int txtWidth = chronoView.getWidth();
- int surfaceWidth = surfaceView.getWidth();
- TranslateAnimation anim = new TranslateAnimation(0,(surfaceWidth-txtWidth),0,(txtHeight/2)-10);
- anim.setDuration(anim2.getDuration());
- animationSet.addAnimation(anim);
- if(animationSet != null) chronoView.startAnimation(animationSet);
- chrono.scheduleAtFixedRate(new TimerTask() {
- @Override
- public void run() {
- Log.i(TAG,""+time);
- if(time == 5) {
- runOnUiThread(new Runnable() {
- @Override
- public void run() {
- recordButton.setEnabled(true);
- recordButton.setColorFilter(Color.argb(0,155,155,155));
- chronoView.setText(secondsToString(time));
- }
- });
- }
- else {
- runOnUiThread(new Runnable() {
- @Override
- public void run() {
- chronoView.setText(secondsToString(time));
- }
- });
- }
- time++;
- }
- },
- 0,
- 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement