Commit de9db737 authored by Oscar Megia Lopez's avatar Oscar Megia Lopez
Browse files

version 0.5beta

Fix different miliseconds in elapsed time when reload from file.
parent 7b5479b1
......@@ -8,7 +8,7 @@ android {
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "0.4beta"
versionName "0.5beta"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
......
......@@ -9,6 +9,7 @@ import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
......@@ -87,14 +88,13 @@ public class ScrollingActivity extends AppCompatActivity {
Date dFechaHora = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss.SSS", Locale.ROOT);
CharSequence csFechaHora = dateFormat.format(dFechaHora);
Date dAhora = new Date();
text.append(String.format(Locale.ROOT, "%03d ", linea));
text.append(csFechaHora);
text.append(" ");
if (linea > 1) {
DiasHorasMinutosSegundosMilisegundos dhmsmTempo =
new DiasHorasMinutosSegundosMilisegundos();
calculaDiasHorasMinutosSegundos(dFechaAnterior, dAhora, dhmsmTempo);
calculaDiasHorasMinutosSegundos(dFechaAnterior, dFechaHora, dhmsmTempo);
text.append(String.format(Locale.ROOT, " %03d %s %02d:%02d:%02d.%03d",
(int) dhmsmTempo.getDias(), getResources().getString(R.string.dias), (int) dhmsmTempo.getHoras(),
(int) dhmsmTempo.getMinutos(), (int) dhmsmTempo.getSegundos(),
......@@ -103,7 +103,7 @@ public class ScrollingActivity extends AppCompatActivity {
linea++;
text.append("\n");
tView.setText(text);
dFechaAnterior = new Date();
dFechaAnterior = new Date(dFechaHora.getTime());
data = dateFormat.format(dFechaHora) + "\n";
// Save line in file
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment