Features
- Interactive checkboxes for all five daily prayers
- Tap to toggle prayer completion status
- Live progress counter showing completed prayers (e.g., “3/5”)
- Visual feedback with color changes when prayers are marked complete
- Syncs with app - updates reflect in the main prayer tracking feature
- Daily reset - automatically clears at midnight for the new day
Widget appearance
The widget displays:Header row
- Left: Date label (e.g., “Today”)
- Right: Progress counter (e.g., “3/5”)
Prayer checkboxes
A horizontal row of five interactive circles:- Fajr (F)
- Dhuhr (D)
- Asr (A)
- Maghrib (M)
- Isha (I)
- Circle with checkmark when completed
- Empty circle when not yet prayed
- Short letter label below the circle
This is the only fully interactive widget in Nimaz. Other widgets are read-only displays that open the app when tapped.
Adding the widget
Place on home screen
Drag the widget to your preferred location. It’s optimized for small horizontal layouts.
Using the widget
Marking prayers as completed
- After praying, tap the corresponding prayer circle
- The circle fills with color and shows a checkmark (✓)
- The progress counter increments (e.g., “2/5” → “3/5”)
- The prayer label becomes bold to indicate completion
Unmarking prayers
- Tap a completed prayer circle
- The checkmark disappears and circle becomes empty
- The progress counter decrements
- Useful for accidental taps
Visual states
Unchecked prayer:- Light gray circle background
- No checkmark
- Dimmed label text
- Regular font weight
- Green circle background (configurable via theme)
- White checkmark (✓)
- Bold label text
- Primary text color
Implementation details
Interactive widget
Unlike other widgets, the Prayer Tracker handles clicks on individual UI elements:Toggle prayer status
Clicking a prayer triggers database updates:Widget state
Widget receiver
Database integration
The widget directly interacts with the app’s Room database:Hilt entry point
Accesses the prayer DAO through Hilt:Prayer records
Each prayer tap creates or updates aPrayerRecordEntity:
Sync with main app
Prayers marked complete in the widget:- Appear in the app’s prayer tracker screen
- Count toward daily/weekly statistics
- Are included in prayer analytics
- Can be modified later in the app (e.g., marking as jamaah)
Update lifecycle
The widget updates through two mechanisms:Periodic background updates
PrayerTrackerWorker refreshes widget data:
- Runs periodically to check for new day
- Updates prayer status from database
- Resets progress counter at midnight
Immediate updates after interaction
When a prayer is toggled:- Database is updated immediately
PrayerTrackerWorker.enqueueImmediateWork()is called- Widget refreshes within seconds
- New state is displayed
Styling
Colors
Checkbox styling
- Size: 28dp diameter circles
- Border radius: 14dp (perfect circles)
- Checkmark: Unicode ✓ character
- Font: System default, bold weight
Progress counter
- Format: “X/5” where X is completed prayers
- Color: Primary accent color
- Font: 12sp, bold
Android manifest registration
Daily reset behavior
At midnight:PrayerTrackerWorkerdetects the date change- Widget state is updated with new date
- All prayer checkboxes reset to unchecked
- Progress counter resets to “0/5”
- Previous day’s data is preserved in database
Troubleshooting
Taps not registering
If tapping prayers doesn’t work: Solution:- Ensure you’re tapping the circle itself, not the label
- Wait a moment for the update to process
- Check battery optimization isn’t too aggressive
- Remove and re-add the widget if needed
Progress counter not updating
If the counter doesn’t increment after marking prayers: Solution:- Wait a few seconds for the update to complete
- Check that background data is enabled for Nimaz
- Verify the app has database access
- Restart the app and check again
Status not syncing with app
If widget and app show different prayer statuses: Solution:- Open the app to trigger a sync
- Wait for the next automatic update cycle
- Check that both widget and app are on the same date
- Force refresh by removing and re-adding widget
Widget showing wrong date
If the widget displays yesterday’s prayers: Solution:- Check your device date and time settings
- Verify timezone is correct
- Tap the widget to open the app and force refresh
- Wait for midnight transition to complete
All prayers marked but counter shows less
Rare edge case with state inconsistency: Solution:- Open the main app
- Navigate to prayer tracker screen
- Verify which prayers are actually marked
- Widget will sync on next update
Use cases
Daily tracking
Use the widget to:- Quickly mark prayers as you complete them
- See at a glance which prayers remain
- Track your daily progress
- Build a consistent prayer habit
Motivation
The visible progress counter:- Provides positive reinforcement
- Creates a sense of accomplishment
- Encourages completing all five prayers
- Makes tracking effortless
Home screen integration
Benefits of widget-based tracking:- No need to open the app
- Always visible reminder
- One-tap interaction
- Faster than app-based tracking
Privacy considerations
The widget displays prayer status on your home screen:- Visible to others: Anyone seeing your screen can see your prayer status
- Lock screen: Widget doesn’t appear on lock screen by default
- Screenshots: Prayer status may appear in screenshots
If you prefer privacy, use the in-app prayer tracker instead of the widget, or place the widget on a secondary home screen page.
Accessibility
The widget follows accessibility guidelines:- Touch targets: 28dp circles exceed minimum 48dp touch target (with padding)
- Color contrast: High contrast between checked/unchecked states
- Visual feedback: Clear checkmark indication
- Labels: Text labels identify each prayer
Related features
In-app prayer tracker
The main app provides:- Detailed prayer tracking with notes
- Jamaah (congregation) marking
- Historical data and statistics
- Qada prayer tracking
- Custom prayer notes
Prayer statistics
Data tracked via the widget feeds into:- Weekly prayer completion percentages
- Monthly tracking calendars
- Streak tracking
- Prayer analytics
Related widgets
- Prayer times widget - See prayer times with countdown
- Next prayer widget - Focus on upcoming prayer
- Hijri date widget - Track Islamic calendar dates