Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 27b6e7c947 | |||
| f36967541d |
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -50,13 +50,18 @@ Sub Globals
|
|||||||
Private BtnConfigSave As Button
|
Private BtnConfigSave As Button
|
||||||
Private BtnConfigReset As Button
|
Private BtnConfigReset As Button
|
||||||
Private BtnClearToday As Button
|
Private BtnClearToday As Button
|
||||||
|
Private BtnHelpOpen As Button
|
||||||
|
Private BtnHelpClose As Button
|
||||||
Private BtnBackground As Label
|
Private BtnBackground As Label
|
||||||
|
Private lblAppName As Label
|
||||||
Private lblElapsedTime As Label
|
Private lblElapsedTime As Label
|
||||||
Private lblAutoStatus As Label
|
Private lblAutoStatus As Label
|
||||||
Private pnlClock As Panel
|
Private pnlClock As Panel
|
||||||
Private pnlStats As Panel
|
Private pnlStats As Panel
|
||||||
Private pnlConfig As Panel
|
Private pnlConfig As Panel
|
||||||
|
Private pnlHelp As Panel
|
||||||
Private svStats As ScrollView
|
Private svStats As ScrollView
|
||||||
|
Private svHelp As ScrollView
|
||||||
Private txtCfgStart As EditText
|
Private txtCfgStart As EditText
|
||||||
Private txtCfgPauseStart As EditText
|
Private txtCfgPauseStart As EditText
|
||||||
Private txtCfgPauseEnd As EditText
|
Private txtCfgPauseEnd As EditText
|
||||||
@@ -111,7 +116,9 @@ Sub Activity_Create(FirstTime As Boolean)
|
|||||||
CreateStatsPage
|
CreateStatsPage
|
||||||
CreateConfigButton
|
CreateConfigButton
|
||||||
CreateConfigPage
|
CreateConfigPage
|
||||||
|
CreateHelpPage
|
||||||
CreateBackgroundButton
|
CreateBackgroundButton
|
||||||
|
CreateAppNameLabel
|
||||||
CreateAutoStatusLabel
|
CreateAutoStatusLabel
|
||||||
LayoutMainButtons
|
LayoutMainButtons
|
||||||
LoadAutoConfig
|
LoadAutoConfig
|
||||||
@@ -202,6 +209,16 @@ Private Sub CreateBackgroundButton
|
|||||||
Activity.AddView(BtnBackground, BtnPause.Left, BtnPause.Top, BtnPause.Width, BtnPause.Height)
|
Activity.AddView(BtnBackground, BtnPause.Left, BtnPause.Top, BtnPause.Width, BtnPause.Height)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CreateAppNameLabel
|
||||||
|
lblAppName.Initialize("")
|
||||||
|
lblAppName.Text = Localization.T("app_title")
|
||||||
|
lblAppName.TextColor = Colors.Black
|
||||||
|
lblAppName.TextSize = 22
|
||||||
|
lblAppName.Typeface = Typeface.CreateNew(Typeface.SANS_SERIF, Typeface.STYLE_BOLD_ITALIC)
|
||||||
|
lblAppName.Gravity = Gravity.CENTER
|
||||||
|
Activity.AddView(lblAppName, 0, 0, 10dip, 10dip)
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub LayoutMainButtons
|
Private Sub LayoutMainButtons
|
||||||
Dim margin As Int = 8dip
|
Dim margin As Int = 8dip
|
||||||
Dim gap As Int = 8dip
|
Dim gap As Int = 8dip
|
||||||
@@ -228,6 +245,11 @@ Private Sub LayoutMainButtons
|
|||||||
BtnBackground.SetLayout(margin, row2Top, smallButtonWidth, buttonHeight)
|
BtnBackground.SetLayout(margin, row2Top, smallButtonWidth, buttonHeight)
|
||||||
BtnStats.SetLayout(margin + smallButtonWidth + gap, row2Top, smallButtonWidth, buttonHeight)
|
BtnStats.SetLayout(margin + smallButtonWidth + gap, row2Top, smallButtonWidth, buttonHeight)
|
||||||
BtnConfig.SetLayout(margin + (2 * (smallButtonWidth + gap)), row2Top, smallButtonWidth, buttonHeight)
|
BtnConfig.SetLayout(margin + (2 * (smallButtonWidth + gap)), row2Top, smallButtonWidth, buttonHeight)
|
||||||
|
If lblAppName.IsInitialized Then
|
||||||
|
Dim titleTop As Int = pnlClock.Top + pnlClock.Height + 4dip
|
||||||
|
Dim titleHeight As Int = Max(28dip, row1Top - titleTop - 4dip)
|
||||||
|
lblAppName.SetLayout(0, titleTop, Activity.Width, titleHeight)
|
||||||
|
End If
|
||||||
If lblElapsedTime.IsInitialized Then lblElapsedTime.SetLayout(0, labelTop, Activity.Width * 0.58, 28dip)
|
If lblElapsedTime.IsInitialized Then lblElapsedTime.SetLayout(0, labelTop, Activity.Width * 0.58, 28dip)
|
||||||
If lblAutoStatus.IsInitialized Then lblAutoStatus.SetLayout(Activity.Width * 0.58, labelTop, Activity.Width * 0.42, 28dip)
|
If lblAutoStatus.IsInitialized Then lblAutoStatus.SetLayout(Activity.Width * 0.58, labelTop, Activity.Width * 0.42, 28dip)
|
||||||
End Sub
|
End Sub
|
||||||
@@ -286,6 +308,41 @@ Private Sub CreateConfigPage
|
|||||||
BtnClearToday.Initialize("BtnClearToday")
|
BtnClearToday.Initialize("BtnClearToday")
|
||||||
BtnClearToday.Text = Localization.T("clear_today")
|
BtnClearToday.Text = Localization.T("clear_today")
|
||||||
pnlConfig.AddView(BtnClearToday, 12dip, y + 126dip, Activity.Width - 24dip, 48dip)
|
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
|
End Sub
|
||||||
|
|
||||||
Private Sub AddConfigField(LabelText As String, ValueText As String, y As Int) As EditText
|
Private Sub AddConfigField(LabelText As String, ValueText As String, y As Int) As EditText
|
||||||
@@ -397,6 +454,14 @@ Sub BtnClearToday_Click
|
|||||||
ClearDisplayedDay
|
ClearDisplayedDay
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Sub BtnHelpOpen_Click
|
||||||
|
ShowHelpPage
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub BtnHelpClose_Click
|
||||||
|
ShowConfigPage
|
||||||
|
End Sub
|
||||||
|
|
||||||
Sub BtnBackground_Click
|
Sub BtnBackground_Click
|
||||||
SaveActiveState
|
SaveActiveState
|
||||||
Dim home As Intent
|
Dim home As Intent
|
||||||
@@ -830,6 +895,7 @@ Private Sub ShowStatsPage
|
|||||||
SetMainControlsVisible(False)
|
SetMainControlsVisible(False)
|
||||||
pnlStats.Visible = True
|
pnlStats.Visible = True
|
||||||
pnlConfig.Visible = False
|
pnlConfig.Visible = False
|
||||||
|
pnlHelp.Visible = False
|
||||||
pnlStats.BringToFront
|
pnlStats.BringToFront
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -841,6 +907,7 @@ Private Sub SetMainControlsVisible(Visible As Boolean)
|
|||||||
HideLegacyButtons
|
HideLegacyButtons
|
||||||
pnlStats.Visible = False
|
pnlStats.Visible = False
|
||||||
pnlConfig.Visible = False
|
pnlConfig.Visible = False
|
||||||
|
pnlHelp.Visible = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub HideLegacyButtons
|
Private Sub HideLegacyButtons
|
||||||
@@ -869,13 +936,23 @@ Private Sub ShowConfigPage
|
|||||||
SetMainControlsVisible(False)
|
SetMainControlsVisible(False)
|
||||||
pnlStats.Visible = False
|
pnlStats.Visible = False
|
||||||
pnlConfig.Visible = True
|
pnlConfig.Visible = True
|
||||||
|
pnlHelp.Visible = False
|
||||||
pnlConfig.BringToFront
|
pnlConfig.BringToFront
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ShowHelpPage
|
||||||
|
SetMainControlsVisible(False)
|
||||||
|
pnlStats.Visible = False
|
||||||
|
pnlConfig.Visible = False
|
||||||
|
pnlHelp.Visible = True
|
||||||
|
pnlHelp.BringToFront
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub ShowMainPage
|
Private Sub ShowMainPage
|
||||||
SetMainControlsVisible(True)
|
SetMainControlsVisible(True)
|
||||||
pnlStats.Visible = False
|
pnlStats.Visible = False
|
||||||
pnlConfig.Visible = False
|
pnlConfig.Visible = False
|
||||||
|
pnlHelp.Visible = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub BuildStatsTable
|
Private Sub BuildStatsTable
|
||||||
@@ -1139,3 +1216,58 @@ Private Sub AddCell(Text As String, x As Int, y As Int, w As Int, h As Int, Head
|
|||||||
End If
|
End If
|
||||||
svStats.Panel.AddView(lbl, x, y, w, h)
|
svStats.Panel.AddView(lbl, x, y, w, h)
|
||||||
End Sub
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user