public void pause() { // Show the finish button finishButton.setVisibility(View.VISIBLE); // Changes the text and the colour of the button startButton.setText("Resume"); startButton.getBackground().setColorFilter(Color.GREEN, PorterDuff.Mode.MULTIPLY); // Save the current time timeWhenPaused = myChrono.getBase() - SystemClock.elapsedRealtime(); myChrono.stop(); // Set a yellow marker on the current paused location LatLng pauseLocation = new LatLng(latitude, longitude); map.addMarker( new MarkerOptions() .position(pauseLocation) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_YELLOW))); // Zoom out to fit route points on the map. // This shows the user the total distance travelled on the map int last = routePoints.size(); if (last >= 2) { LatLngBounds.Builder boundsBuilder = new LatLngBounds.Builder(); for (int i = 0; i < last; i++) { boundsBuilder.include(routePoints.get(i)); } LatLngBounds bounds = boundsBuilder.build(); map.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 180)); } else ; }
private void pauseSnapping() { Log.d(LOG_TAG, "pauseSnapping"); mFlightDuraChrono.stop(); mDurationOfFlight = SystemClock.elapsedRealtime() - mFlightDuraChrono.getBase(); isSnapping = false; if (mCamera != null) { mCamera.release(); mCamera = null; } }
private void endGame() { // stop the timer mTimer.stop(); // reset flag mGameInProgress = false; // calculate elapsed time long elapsedTime = SystemClock.elapsedRealtime() - mTimer.getBase(); // calculate score mGameScore = calculateScore(elapsedTime); }
private void finishCalling() { mInfoLl.setVisibility(View.VISIBLE); answer.setVisibility(View.GONE); handUpBefore.setVisibility(View.GONE); mLoaclVideoView.setVisibility(View.GONE); mVideoTopTips.setText(R.string.ec_voip_calling_finish); if (isConnect) { duration = SystemClock.elapsedRealtime() - mChronometer.getBase(); mChronometer.stop(); mVedioGoing.setVisibility(View.GONE); mLoaclVideoView.setVisibility(View.GONE); } // insertCallLog(); finish(); isConnect = false; }
private void stopSnapping() { Log.d(LOG_TAG, "stopSnapping"); isSnapping = false; mFlightDuraChrono.stop(); mDurationOfFlight = SystemClock.elapsedRealtime() - mFlightDuraChrono.getBase(); if (mCamera != null) { mCamera.release(); mCamera = null; } mSnapDisbatcher.stopDisbatching(); mDirectionListener.stopListening(); Intent resultIntent = new Intent(); resultIntent.putExtra(mRes.getString(R.string.intent_extra_flight_duration), mDurationOfFlight); resultIntent.putExtra(mRes.getString(R.string.intent_extra_snap_count), mNumberOfSnapsTaken); setResult(RESULT_OK, resultIntent); finish(); }
private void finishCalling(int reason) { mInfoLl.setVisibility(View.VISIBLE); answer.setVisibility(View.GONE); handUpBefore.setVisibility(View.GONE); mVideoTopTips.setText(CallFailReason.getCallFailReason(reason)); mLoaclVideoView.setVisibility(View.GONE); if (isConnect) { duration = SystemClock.elapsedRealtime() - mChronometer.getBase(); mChronometer.stop(); mVedioGoing.setVisibility(View.GONE); } isConnect = false; VoIPCallHelper.releaseCall(mCallId); if (reason == 175603) { return; } // insertCallLog(); finish(); }
private static String saveLapTime() { long elapsedMillis = SystemClock.elapsedRealtime() - chrono.getBase(); String time = getDate(elapsedMillis, "mm:ss.SSS"); return time; }
public long getMillisecondsLap() { return SystemClock.elapsedRealtime() - chronometer.getBase(); }