Skip to content

Showcase repository for FaceDown: A sensor-based focus timer. Demonstrating Jetpack Compose, Material 3 Expressive, Room, and raw SensorManager integration.

Notifications You must be signed in to change notification settings

arekbauer/FaceDown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FaceDown Logo

FaceDown

Current Status: Closed Testing > FaceDown is currently in the Google Play Closed Testing phase.

I am actively looking for testers to help bring this app to production! If you would like to provide feedback, please reach out to me.
For now, you can download the APK here.

Note: This repository is a technical showcase for a private productivity application called "FaceDown". It contains sanitized snippets of the core engineering challenges to demonstrate architectural and technical capabilities.

FaceDown featured on HowToMen
Featured in HowToMen's "Top 15 Best Android Apps" - "Honestly a really great app to help you stay more productive."


FaceDown is a minimal timer that enforces focus by requiring the user to place their phone face down on a table. If the phone is picked up or flipped over, the timer pauses, ensuring a distraction-free environment.

Timer Face Up Weekly Stats Dial Setup

Engineering Highlights

1. Sensor Fusion & Coroutines

The core mechanic relies on the device's accelerometer. I implemented a clean Flow-based repository that bridges the legacy SensorManager callback API with modern Kotlin Coroutines.

  • Debouncing: Logic ensures minor vibrations don't trigger state changes.
  • Battery Efficiency: The listener is automatically unregistered when the UI lifecycle stops collecting the Flow (via awaitClose).

(See SensorLogic.kt for the full implementation)

2. Custom Canvas Drawing

Instead of using a heavy charting library for the simple weekly statistics, I built a custom Jetpack Compose Canvas component.

  • Performance: Draws the entire chart in a single pass.
  • Animation: Uses independent Animatable states for each bar to create a staggered "wave" entrance effect.
  • Responsiveness: Calculates geometry dynamically based on available width.

(See WeeklyStatsChart.kt for the drawing logic)

3. Reactive Foreground Service

The core timer loop runs within a robust Android Foreground Service to guarantee execution even when the device is dozing.

  • State Machine: This reactive stream powers the "Grace Period" logic, automatically triggering the 10-second recovery window when the OrientationState shifts to FaceUp.
  • Haptics & Audio: interacting with Vibrator and AudioPlayer for completion alarms and success feedback, respecting user preferences via SettingsRepository.

4. System Integration (Do Not Disturb)

The app interacts directly with the Android System Services to mute notifications during deep focus. This requires handling runtime permissions (ACCESS_NOTIFICATION_POLICY) and managing the Interruption Filter state safely.

Architecture

The app follows the recommended Clean Architecture guidelines, separating concerns into Data, Domain, and UI layers.

com.arekb.facedown
├── data                 # Data Layer (Repositories, Sources)
│   ├── database         # Room Entities & DAOs
│   ├── sensor           # Accelerometer Implementation
│   └── timer            # System Service Wrappers
├── domain               # Domain Layer (Pure Kotlin)
│   └── model            # Core Business Models (FocusSession, etc)
├── ui                   # UI Layer (Jetpack Compose)
│   ├── home             # Timer & Canvas Charts
│   ├── stats            # Statistics & History
│   └── settings         # Statistics & History
└── di                   # Hilt Dependency Injection Modules

Tech Stack

  • Languages: Kotlin
  • UI: Jetpack Compose (Material 3 Expressive)
  • Architecture: MVVM, Clean Architecture, Single Activity
  • DI: Hilt
  • Async: Coroutines & Flow
  • Local Data: Room Database
  • Hardware: Android SensorManager (Accelerometer)

App Showcase

View Full Screenshot Gallery

Credits & Inspiration

Contact

LinkedIn Profile | Portfolio Website

About

Showcase repository for FaceDown: A sensor-based focus timer. Demonstrating Jetpack Compose, Material 3 Expressive, Room, and raw SensorManager integration.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages