v1.1.0 - Update Targeted Version + Enhancements + Bugfixes #1

Merged
me merged 24 commits from dev into main 2025-07-19 15:25:35 -07:00
Showing only changes of commit 219ef6d64e - Show all commits

View File

@@ -207,30 +207,39 @@ public class MainActivity extends AppCompatActivity {
int hours = 0, minutes = 0, seconds = 0; int hours = 0, minutes = 0, seconds = 0;
try { try {
hours = Integer.parseInt("0" + etHours.getText().toString()); hours = Integer.parseInt("0" + etHours.getText().toString());
} catch (NumberFormatException e) { } catch (Exception e) {
if (DEBUG) Log.d(tag, "Hours had an exception, using highest value");
hours = 99; hours = 99;
} }
try { try {
minutes = Integer.parseInt("0" + etMinutes.getText().toString()); minutes = Integer.parseInt("0" + etMinutes.getText().toString());
} catch (NumberFormatException e) { } catch (Exception e) {
if (DEBUG) Log.d(tag, "Minutes had an exception, using highest value");
minutes = 59; minutes = 59;
} }
try { try {
seconds = Integer.parseInt("0" + etSeconds.getText().toString()); seconds = Integer.parseInt("0" + etSeconds.getText().toString());
} catch (NumberFormatException e) { } catch (Exception e) {
if (DEBUG) Log.d(tag, "Seconds had an exception, using highest value");
seconds = 59; seconds = 59;
} }
if ((hours + (minutes/60) + (seconds/60/60)) > 99) { if ((hours + (minutes/60) + (seconds/60/60)) > 99) {
if (DEBUG) Log.d(tag, "Sum is over 99 hours, setting to 99:59:59");
hours = 99; hours = 99;
minutes = 59; minutes = 59;
seconds = 59; seconds = 59;
} }
if (DEBUG) Log.d(tag, "hours=" + hours);
if (DEBUG) Log.d(tag, "minutes=" + minutes);
if (DEBUG) Log.d(tag, "seconds=" + seconds);
if (hours > 0) etHours.setText("" + hours); if (hours > 0) etHours.setText("" + hours);
if (minutes > 0) etMinutes.setText("" + minutes); if (minutes > 0) etMinutes.setText("" + minutes);
if (seconds > 0) etSeconds.setText("" + seconds); if (seconds > 0) etSeconds.setText("" + seconds);
longLoopInterval = (((hours*60*60) + (minutes*60) + seconds) * 1000);
if (DEBUG) Log.d(tag, "longLoopInterval=" + longLoopInterval); if (DEBUG) Log.d(tag, "longLoopInterval=" + longLoopInterval);
setChronometer(longLoopInterval); setChronometer(longLoopInterval);