@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    BugSenseHandler.initAndStartSession(SplashActivity.this, "bfdfcbf3");

    setContentView(R.layout.splash);

    startService(new Intent(this, downloadData.class));

    //        pb = (ProgressBar) findViewById(R.id.downprogress);
    CountDownTimer countDownTimer =
        new CountDownTimer(6000, 1000) {

          @Override
          public void onTick(long millisUntilFinished) {
            // TODO Auto-generated method stub

          }

          @Override
          public void onFinish() {
            // TODO Auto-generated method stub
            goNext();
          }
        };
    countDownTimer.start();
  }
示例#2
0
  // Get current location
  public void getLatitudeLongitude() {
    // Get the location manager
    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    // Provider is GPS
    provider = LocationManager.GPS_PROVIDER;
    if (locationManager != null) {
      locationManager.requestLocationUpdates(provider, 500, 10, locationListener);
      // stop update GPS after 6s
      CountDownTimer aCounter =
          new CountDownTimer(10000, 1000) {
            public void onTick(long millisUntilFinished) {}

            public void onFinish() {
              if (locationManager != null) {
                location = locationManager.getLastKnownLocation(provider);
                // locationManager.removeUpdates(locationListener);
              }
            }
          };
      aCounter.start();
    }
    // Initialize the location fields
    if (location != null) {
      this.curLAT = location.getLatitude();
      this.curLNG = location.getLongitude();
      // stop receive GPS signal
      // locationManager.removeUpdates(locationListener);
    } else {
      this.curLAT = ConfigUtil.LATITUDE;
      this.curLNG = ConfigUtil.LONGITUDE;
    }
  }
        public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {

          if (previewHolder.getSurface() == null) {
            // preview surface does not exist
            return;
          }

          // stop preview before making changes
          try {
            camera.stopPreview();
          } catch (Exception e) {
            // ignore: tried to stop a non-existent preview
          }

          // set preview size and make any resize, rotate or
          // reformatting changes here

          // start preview with new settings

          try {
            setCameraDisplayOrientation(TakePictureActivity.this, 0, camera);
            initPreview(width, height);
            startPreview();
            safeToTakePicture = true;
            timer.cancel();
            timer.start();
          } catch (Exception e) {
          }
        }
示例#4
0
  // TODO:
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle presses on the action bar items
    switch (item.getItemId()) {
      case R.id.mainMenu:
        notDone = false;
        timer.cancel();
        endPlay();
        return true;
      case R.id.play:
        notDone = true;
        startTimer(sec);
        MainActivity.gameSong.start();
        comboTimer();
        return true;
      case R.id.pause:
        notDone = false;
        timer.cancel();
        MainActivity.gameSong.pause();
        combocombo.cancel();

        return true;
      default:
        return super.onOptionsItemSelected(item);
    }
  }
示例#5
0
  public void pauseClick(View a) {
    if (mCountDownTimer != null) {
      mCountDownTimer.cancel();
    }
    moveTimer.cancel();
    lifeTimer.cancel();

    pauseDialog();
  }
  public CountDownTimer countDown(
      long interval, final TextView textView, final DownFinish downFinish) {
    CountDownTimer timer =
        new CountDownTimer(interval, 1000) {
          @Override
          public void onTick(long millisUntilFinished) {
            long seconds = millisUntilFinished / 1000;

            long one_day = 60 * 60 * 24;
            long one_hour = 60 * 60;
            long one_minute = 60;
            long minute, second = 0L;
            ;
            String time = "";
            minute = seconds % one_day % one_hour / one_minute;
            second = seconds % one_day % one_hour % one_minute;

            String leftminute = "";
            String leftseconds = "";

            if (minute < 10) {
              leftminute = "0" + minute;
            } else {
              leftminute = minute + "";
            }

            if (second < 10) {
              leftseconds = "0" + second;
            } else {
              leftseconds = second + "";
            }

            /*if(seconds < one_minute){
                time = leftseconds + "秒";
            }else if(seconds >= one_minute && seconds < one_hour){
                time = leftminute + ":" + leftseconds + ":";
            }*/
            textView.setText(leftminute + ":" + leftseconds);
          }

          @Override
          public void onFinish() {
            textView.setText("00:00");
            if (downFinish != null) {
              downFinish.finish();
            }
          }
        };

    timer.start();
    return timer;
  }
示例#7
0
  @Override
  public void onDestroy() {
    Ioc.getIoc().getLogger().d("销毁fragment");
    dismissDialog();
    if (null != countDownTimer) {
      countDownTimer.cancel();
      countDownTimer.onFinish();
      countDownTimer = null;
      Ioc.getIoc().getLogger().d("清除计时器");
    }

    super.onDestroy();
  }
  @Override
  public void afterTextChanged(final Editable editable) {
    CountDownTimer downTimer =
        new CountDownTimer(300, 301) {
          @Override
          public void onTick(long millisUntilFinished) {}

          @Override
          public void onFinish() {
            presenter.filter(editable.toString());
          }
        };
    downTimer.start();
  }
  public void setFeedback(String message, String state) {
    int imageResource = 0;

    setUIForState();

    if (state.equals("success")) {
      imageResource = R.drawable.irma_icon_ok_520px;
    }
    if (state.equals("warning")) {
      imageResource = R.drawable.irma_icon_warning_520px;
    }
    if (state.equals("failure")) {
      imageResource = R.drawable.irma_icon_missing_520px;
    }

    ((TextView) findViewById(R.id.feedback_text)).setText(message);

    if (imageResource != 0) {
      ((ImageView) findViewById(R.id.statusimage)).setImageResource(imageResource);
      showingFeedback = true;
    }

    if (cdt != null) cdt.cancel();

    cdt =
        new CountDownTimer(FEEDBACK_SHOW_DELAY, 1000) {
          public void onTick(long millisUntilFinished) {}

          public void onFinish() {
            clearFeedback();
          }
        }.start();
  }
示例#10
0
  @Override
  protected void onDestroy() {
    super.onDestroy();

    // 종료시 타이머 멈춤
    cTimer.cancel();
  }
示例#11
0
  private void stopTreatment() {
    // send 0V command
    sendDataToDevice(EbandageGattAttributes.ZERO_VOLTS);
    voltageTextView.setText("");
    polarityTextView.setText("");
    max_volt = false; // default state
    polarityChanged = false; // default state POSITIVE
    timerStopped = true; // default timer stopped state
    // set button default state
    showMinutes(true);
    setButtonDisabled(true);
    increaseThread = null;
    decreaseThread = null;
    countDownTimer.cancel();

    // send OFF command to device
    if (mBluetoothLeService.sendPolarityCharacteristics(
        hexStringToByteArray(EbandageGattAttributes.EBANDAGE_OFF))) {
      Log.i(TAG, "Device is turned off");
    } else {
      Log.i(TAG, "Turning device off failed");
      // Try again !
      mBluetoothLeService.sendPolarityCharacteristics(
          hexStringToByteArray(EbandageGattAttributes.EBANDAGE_OFF));
    }
  }
示例#12
0
 private void b()
 {
   a = ((TextView)findViewById(2131624176));
   e = new SimpleDateFormat("HH:mm:ss");
   e.setLenient(false);
   long l = System.currentTimeMillis();
   c = (ManagerApp.n().e() + 1000L - l);
   if (c <= 1000L)
   {
     dismiss();
     return;
   }
   a.setText(com.tinder.utils.g.c(c));
   f = new CountDownTimer(c, 1000L)
   {
     public void onFinish()
     {
       dismiss();
     }
     
     public void onTick(long paramAnonymousLong)
     {
       s.a(s.this, paramAnonymousLong - 1000L);
       s.b(s.this).setText(com.tinder.utils.g.c(s.a(s.this)));
     }
   };
   f.start();
 }
 /** {@inheritDoc} */
 public void onPause() {
   if (mCountdownTimer != null) {
     mCountdownTimer.cancel();
     mCountdownTimer = null;
   }
   mKeyguardStatusViewManager.onPause();
 }
 @Override
 public void onStop() {
   if (countDown != null) {
     countDown.cancel();
   }
   super.onDestroy();
 }
  @Override
  public void onSpeedValuesChanged(SpeedOsciConfiguratorView that, int[] values, int rangeOffset) {
    if (values == null || values.length == 0) {
      return;
    }

    mLastSpeedValue = values[0];

    if (mTimer != null) {
      mTimer.cancel();
    }
    // wait 500ms for the reaction to a change of the number picker to avoid too many bluetooth
    // commands
    mTimer =
        new CountDownTimer(500 /*ms*/, 500) {

          public void onTick(long millisUntilFinished) {}

          public void onFinish() {
            // set position
            mRoboterHelper.sendDfSpeedCommand(
                RoboterHelper.MotorNumber.SPEEDER, new RangeType("" + mLastSpeedValue));
          }
        }.start();
  }
 private void startTraining() {
   if (!foodItem.isFinishTraining()) {
     play = true;
     setPlayPauseIcon(true);
     mHandler.postDelayed(stepDelayRunnable, STEP_DISPLAY_TIME);
     countDownTimer.start();
   }
 }
示例#17
0
 protected void stopChronoAndSeek() {
   if (observer != null) observer.stop();
   seekBarSound.setProgress(0);
   firstChornometer.stop();
   firstChornometer.setBase(SystemClock.elapsedRealtime());
   if (soundLeft != null) soundLeft.cancel();
   secondChronometer.setText("00:00");
 }
示例#18
0
  // ----------------------------------------------------------------------------------------------
  // stopCountdownTimer
  // ----------------------------------------------------------------------------------------------
  public synchronized void stopShotCountdown() {

    if (mShotTimer != null) {
      mShotTimer.cancel();
      mShotTimer = null;
      mTimerView.setText("");
    }
  }
 /**
  * Start or Resume the countdown.
  *
  * @return CountDownTimerPausable current instance
  */
 public final synchronized AppCountDownTimerPausable start() {
   if (isPaused) {
     createCountDownTimer();
     countDownTimer.start();
     isPaused = false;
   }
   return this;
 }
    @Override
    public void onPause() {
      super.onPause();

      if (mCountdownTimer != null) {
        mCountdownTimer.cancel();
      }
    }
 @Override
 protected void onDestroy() {
   super.onDestroy();
   cameraFuncation.clearCamera();
   appLockApplication.setLastAppEnterPwdState(
       bPwdIsCorrent, new Date().getTime(), errorCount, lastDelayTime);
   if (mCountdownTimer != null) mCountdownTimer.cancel();
 }
 private void nextStep() {
   playNavigationSound();
   foodItem.nextStep();
   displayStepImage();
   if (!foodItem.isFinishTraining()) {
     mHandler.postDelayed(stepDelayRunnable, STEP_DISPLAY_TIME);
     countDownTimer.start();
   }
 }
示例#23
0
  public void resetTimer() {

    timerTextView.setText("0:30");
    timerSeekBar.setProgress(30);
    countDownTimer.cancel();
    controllerButton.setText("Go!");
    timerSeekBar.setEnabled(true);
    counterIsActive = false;
  }
示例#24
0
 // stop recodrding for extaudio class
 private void stopRecording() {
   mExtAudioRecorder.stop();
   mExtAudioRecorder.release();
   mRecordTime.stop();
   //        mRecordTime.setVisibility(View.INVISIBLE);
   showSoundController();
   mIsRecording = false;
   mRecordingTimer.cancel();
 }
  private void TOTPTimer(final TextView textView, final DonutProgress donutProgress) {
    final CountDownTimer timer =
        new CountDownTimer((1000 * 5), 1000) {
          @Override
          public void onTick(long millisUntilFinished) {
            donutProgress.setProgress((int) (millisUntilFinished / 1000));
          }

          @Override
          public void onFinish() {
            String secret = Base32.random();
            textView.setText((new Totp(secret)).now());
            donutProgress.setProgress(0);
            TOTPTimer(textView, donutProgress);
          }
        };
    timer.start();
  }
示例#26
0
  @Override
  protected void onPause() {
    super.onPause();

    notDone = false;
    MainActivity.gameSong.pause();

    timer.cancel();
  }
 /**
  * Pauses the CountDownTimerPausable, so it could be resumed(start) later from the same point
  * where it was paused.
  */
 public void pause() throws IllegalStateException {
   if (isPaused == false) {
     countDownTimer.cancel();
   } else {
     throw new IllegalStateException(
         "CountDownTimerPausable is already in pause state, start counter before pausing it.");
   }
   isPaused = true;
 }
示例#28
0
 // Called if user presses menu button or back button
 public void onPause() {
   super.onPause();
   if (mCountDownTimer != null) {
     mCountDownTimer.cancel();
   }
   if (lifeTimer != null) {
     lifeTimer.cancel();
   }
   if (mySound != null) {
     mySound.stop();
     if (isFinishing()) {
       mySound.stop();
       mySound.release();
     }
   }
   if (!gameOver) {
     pauseDialog();
   }
 }
示例#29
0
 public void onStopClicked(View view) {
   cdt.cancel();
   // mplay.stop();
   mplay.end();
   mplay = null;
   finish();
   AudioManager am =
       (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
   am.setStreamVolume(AudioManager.STREAM_MUSIC, currentVolume, AudioManager.FLAG_PLAY_SOUND);
 }
示例#30
0
  @Override
  public void onDestroyView() {
    super.onDestroyView();
    InputFragmentView = null; // now cleaning up!
    countDownTimer.cancel();
    countDownTimer = null;
    ExerciseFragment.onDestroyView();

    Log.d("Fragment Exercise", "DestroyView Called");
  }