Add in-app help page

This commit is contained in:
2026-06-16 19:00:07 +02:00
parent 912a2deeaf
commit f36967541d
4 changed files with 1130 additions and 896 deletions

View File

@@ -50,13 +50,17 @@ Sub Globals
Private BtnConfigSave As Button
Private BtnConfigReset As Button
Private BtnClearToday As Button
Private BtnHelpOpen As Button
Private BtnHelpClose As Button
Private BtnBackground As Label
Private lblElapsedTime As Label
Private lblAutoStatus As Label
Private pnlClock As Panel
Private pnlStats As Panel
Private pnlConfig As Panel
Private pnlHelp As Panel
Private svStats As ScrollView
Private svHelp As ScrollView
Private txtCfgStart As EditText
Private txtCfgPauseStart As EditText
Private txtCfgPauseEnd As EditText
@@ -111,6 +115,7 @@ Sub Activity_Create(FirstTime As Boolean)
CreateStatsPage
CreateConfigButton
CreateConfigPage
CreateHelpPage
CreateBackgroundButton
CreateAutoStatusLabel
LayoutMainButtons
@@ -286,6 +291,41 @@ Private Sub CreateConfigPage
BtnClearToday.Initialize("BtnClearToday")
BtnClearToday.Text = Localization.T("clear_today")
pnlConfig.AddView(BtnClearToday, 12dip, y + 126dip, Activity.Width - 24dip, 48dip)
BtnHelpOpen.Initialize("BtnHelpOpen")
BtnHelpOpen.Text = "Help"
pnlConfig.AddView(BtnHelpOpen, 12dip, y + 182dip, Activity.Width - 24dip, 48dip)
End Sub
Private Sub CreateHelpPage
pnlHelp.Initialize("")
pnlHelp.Color = Colors.White
pnlHelp.Visible = False
Activity.AddView(pnlHelp, 0, 0, Activity.Width, Activity.Height)
Dim title As Label
title.Initialize("")
title.Text = "Help"
title.TextSize = 22
title.TextColor = Colors.Black
title.Gravity = Gravity.CENTER_VERTICAL
pnlHelp.AddView(title, 12dip, 8dip, Activity.Width - 110dip, 46dip)
BtnHelpClose.Initialize("BtnHelpClose")
BtnHelpClose.Text = "Close"
pnlHelp.AddView(BtnHelpClose, Activity.Width - 94dip, 8dip, 84dip, 46dip)
svHelp.Initialize(0)
pnlHelp.AddView(svHelp, 0, 62dip, Activity.Width, Activity.Height - 62dip)
Dim lblHelp As Label
lblHelp.Initialize("")
lblHelp.Text = BuildHelpText
lblHelp.TextSize = 16
lblHelp.TextColor = Colors.Black
lblHelp.Gravity = Gravity.TOP
svHelp.Panel.AddView(lblHelp, 12dip, 12dip, Activity.Width - 24dip, 1180dip)
svHelp.Panel.Height = 1204dip
End Sub
Private Sub AddConfigField(LabelText As String, ValueText As String, y As Int) As EditText
@@ -397,6 +437,14 @@ Sub BtnClearToday_Click
ClearDisplayedDay
End Sub
Sub BtnHelpOpen_Click
ShowHelpPage
End Sub
Sub BtnHelpClose_Click
ShowConfigPage
End Sub
Sub BtnBackground_Click
SaveActiveState
Dim home As Intent
@@ -830,6 +878,7 @@ Private Sub ShowStatsPage
SetMainControlsVisible(False)
pnlStats.Visible = True
pnlConfig.Visible = False
pnlHelp.Visible = False
pnlStats.BringToFront
End Sub
@@ -841,6 +890,7 @@ Private Sub SetMainControlsVisible(Visible As Boolean)
HideLegacyButtons
pnlStats.Visible = False
pnlConfig.Visible = False
pnlHelp.Visible = False
End Sub
Private Sub HideLegacyButtons
@@ -869,13 +919,23 @@ Private Sub ShowConfigPage
SetMainControlsVisible(False)
pnlStats.Visible = False
pnlConfig.Visible = True
pnlHelp.Visible = False
pnlConfig.BringToFront
End Sub
Private Sub ShowHelpPage
SetMainControlsVisible(False)
pnlStats.Visible = False
pnlConfig.Visible = False
pnlHelp.Visible = True
pnlHelp.BringToFront
End Sub
Private Sub ShowMainPage
SetMainControlsVisible(True)
pnlStats.Visible = False
pnlConfig.Visible = False
pnlHelp.Visible = False
End Sub
Private Sub BuildStatsTable
@@ -1139,3 +1199,58 @@ Private Sub AddCell(Text As String, x As Int, y As Int, w As Int, h As Int, Head
End If
svStats.Panel.AddView(lbl, x, y, w, h)
End Sub
Private Sub BuildHelpText As String
Return $"Overtime Guard
Purpose
Overtime Guard is a minimal workday timer. It helps you track work time, breaks, and overtime without projects, tasks, or extra screens.
Main screen
- Start begins manual recording for the current workday.
- End stops manual recording.
- Pause starts a break.
- End pause closes the break and resumes work.
- Bg sends the app to the Android home screen.
- Stats opens the daily totals table.
- Config opens automatic schedule settings.
Clock colors
- Light blue: first 4 hours of productive work.
- Green: productive work from hour 5 to hour 8.
- Yellow: break time.
- Red: overtime after 8 productive hours.
How timing works
- Breaks do not count toward the 8 working hours.
- Overtime starts only after 8 productive work hours.
- Red overtime can continue for up to 1 extra hour.
- At 9 total productive hours, recording stops automatically.
- If midnight is reached, the current day is closed and the next day starts from zero when you start again.
Daily memory
- The app saves the current day locally.
- If you close or background the app, the state is restored when you open it again.
- During the day, multiple work and break segments are added to the same daily record.
Statistics
- The stats page groups totals by date.
- Each row shows Work, Pause, and Overtime for one day.
- The totals row sums all visible stored days.
- Local history is currently kept for about two months.
Automatic mode
- In Config you can set work start, pause start, pause end, and work end.
- Set config enables automatic mode.
- In automatic mode, Start and End on the main screen are disabled.
- Reset config disables automatic mode and returns control to manual mode.
Clear today
- Clear today removes only the currently displayed workday from local history.
- Use it only if you want to restart the day from zero.
Notes
- The app uses the phone local time and time zone.
- The help page is informational only. It does not change your data.
"$
End Sub