pCalendar guide
The full reference. For an overview, see the README. A tiny, fast, dependency-free Android organizer combining Calendar, Notes, and ToDo into a single cohesive app. Built exclusively with the Android framework and the Kotlin standard library — no external libraries, jetpack dependencies, or bloated runtimes.
The release APK is ~87 KB (minified and resource-shrunk).
Features
Calendar
- Month grid drawn directly on a custom
Canvas(MonthView). Adapts to your locale's first day of the week, highlighting weekends, today, events, and tasks. - Event & task markers: Days with events show a blue dot. Days with open due tasks show a green dot. Days with both display side-by-side dots. The selected day renders open tasks as a ring.
- Month navigation: Swipe horizontally or use the ‹ › controls to flip months. Tap the title to return to the current month.
- Day agenda: Lists the selected day's events alongside all tasks due on that day (with direct completion checkboxes).
- Quick entry: Tap + to add a calendar event; tap + Task to add a task with its due date pre-filled to the selected day.
- Calendar widget (
CalendarWidget): Resizable 4×3 month grid on the home screen with date indicators, month switching controls, and tap-to-open day navigation. Automatically refreshes at midnight, on locale/time changes, and upon any event or task edit.
Notes
- Notes list: Quick overview of all notes with titles, snippet previews, and relative timestamps (e.g., "3 hr. ago").
- Editor (
EditActivity): Distraction-free editing with automatic saving on pause or exit. Deletion is confirmable with an alert dialog. - Note widget (
NoteWidget): Pin any selected note to your home screen using the configuration picker (WidgetConfigActivity). Scrollable content powered byNoteWidgetService.
ToDo
- Task list: Tasks ordered by status (pending first, then by due date, created date, and completed items).
- Status & overdue tracking: Interactive checkboxes toggle completion with strikethrough styling. Tasks past their due date are clearly highlighted with overdue indicators.
- Task editor (
TodoEditor): Clean modal dialog with multi-line input, date picker integration (DatePickerDialog), and quick "No date" toggle. - Clear completed: Text action in the header dynamically appears whenever completed tasks exist, allowing bulk cleanup with a confirmation dialog.
- Seamless synchronization: Toggling or editing a task immediately updates the Calendar day view, month dots, and home-screen widget.
General
- Adaptive themes: Full support for both light and dark themes across all sections.
- Edge-to-edge: Transparent system bars and inset padding on Android 5.0 through Android 15+ (minSdk 21, targetSdk 36).
- Single launcher entry: Single activity architecture with a bottom navigation bar switching between Calendar, Notes, and ToDo. Restores selected section and calendar state on configuration changes and process recreation.
Storage
All data is stored locally in the app's internal storage (context.filesDir) with atomic writes using android.util.AtomicFile or file replacements to prevent data corruption:
| File | Format | Description |
|---|---|---|
files/notes.tsv | Tab-Separated Values (YYYYMMDD\ttext) | Calendar events per day. Retains full backwards compatibility with earlier pCalendar releases. |
files/notes.json | JSON array of {id, title, body, updated} | Standalone notes. |
files/todos.json | JSON array of {id, text, done, due, created, completedAt} | ToDo tasks. due is represented as civil epoch days (days since 1970-01-01), unaffected by timezone shifts. |
Widgets
- Calendar Widget: Provider
x.vladgba.calendar.CalendarWidget. Built entirely from lightweightRemoteViewswithout adapter services or background overhead. - Note Widget: Provider
x.vladgba.calendar.notes.NoteWidget. Interactive pinned note configured viaWidgetConfigActivityand rendered with aRemoteViewsService.
Architecture
MainActivityacts as a thin shell holding aFrameLayoutwith the three section views and a 3-tab bottom bar (Calendar | Notes | ToDo). Tab switching manages visibility and lifecycle hooks without destroying view state.Sectioninterface (Ui.kt): Exposesviewand activity lifecycle hooks (onShow,onHide,onSave).Ui.kt: Minimalist extension helpers forcolor,dp, andripple.EventStore: Synchronized TSV storage manager for calendar events.NoteStore: Thread-safe cached JSON storage for notes.TodoStore: Thread-safe cached JSON storage for tasks with epoch-day queries (openDueKeys,dueOn,daysWithDue).
Structure
app/src/main/
├── AndroidManifest.xml
├── java/x/vladgba/calendar/
│ ├── CalendarSection.kt # Calendar screen (month header, canvas grid, day list)
│ ├── CalendarWidget.kt # Calendar home-screen widget
│ ├── EventStore.kt # TSV storage for day events (notes.tsv)
│ ├── MainActivity.kt # App shell, tab navigation, edge-to-edge
│ ├── MonthView.kt # Custom Canvas view for month grid
│ ├── Ui.kt # Section interface and shared UI helpers
│ ├── notes/
│ │ ├── EditActivity.kt # Dedicated note editor activity
│ │ ├── Insets.kt # Window insets utility for notes
│ │ ├── Note.kt # Note data model
│ │ ├── NotesSection.kt # Notes list section view
│ │ ├── NoteStore.kt # JSON storage for notes (notes.json)
│ │ ├── NoteWidget.kt # Note app widget provider
│ │ ├── NoteWidgetService.kt # RemoteViewsService for note widget
│ │ └── WidgetConfigActivity.kt # Note selection screen for widget
│ └── todo/
│ ├── Todo.kt # Task model and TodoDates civil date helpers
│ ├── TodoEditor.kt # Dialog task editor with DatePickerDialog
│ ├── TodoSection.kt # ToDo section view with task list & clear action
│ └── TodoStore.kt # JSON storage for tasks (todos.json)
└── res/
├── drawable/ # Widget cell styles, icons, backgrounds
├── drawable-v23/ # Layer-list drawables for API 23+
├── layout/ # Layouts for Note section and both widgets
├── values/ # colors.xml, strings.xml, themes.xml
├── values-night/ # Dark theme overrides (colors.xml, themes.xml)
└── xml/ # widget_info.xml, note_widget_info.xml
Build
# Debug APK: app/build/outputs/apk/debug/app-debug.apk
./gradlew assembleDebug
# Release APK (minified + shrunk): app/build/outputs/apk/release/app-release-unsigned.apk
./gradlew assembleRelease
# Lint verification:
./gradlew lintDebug
Requirements:
- Android SDK Platform 36 (compileSdk 36, minSdk 21)
- JDK 17 or higher