Fix screen recording crash and Momentum tab preset logic#1
Fix screen recording crash and Momentum tab preset logic#1eggmasonvalue wants to merge 2 commits intomainfrom
Conversation
- Fixed crash when starting screen recording by implementing `onSurfaceDestroyed` in `LifeCalendarService` and `DayCounterService` to stop animation loop.
- Fixed logical inconsistency in Momentum tab presets ("No Tomorrow", "Vs Yesterday") where the "breathing" indicator would stop working after one day due to static dates.
- Introduced `dayCounterMode` in `UserPreferences` to support dynamic date calculation (start/event dates relative to `LocalDate.now()`).
- Updated `DayCounterModule` to use `dayCounterMode` for correct daily updates.
- Added unit tests for `DayCounterModule` to verify dynamic logic.
- Removed hardcoded JDK path in `gradle.properties`.
Co-authored-by: eggmasonvalue <215011718+eggmasonvalue@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Part of the request hasn't been complied with. So I'm going to restate:
New: |
I have refactored the codebase to address your feedback:
|
- **Refactoring**: - Introduced `SettingsViewModel` (MVVM) to manage UI state and logic in `MainActivity`. - Created `DayCounterMode` constants for better modularity. - Updated `DayCounterModule` to use dynamic date calculation based on mode. - Added KDoc comments. - **GitHub Workflow**: - Added `.github/workflows/android-release.yml` to build and release APK on "v*" tags. - Updated `app/build.gradle.kts` to support signing configuration via environment variables. - **Dependencies**: - Added `androidx.lifecycle` and `androidx.activity` dependencies. Co-authored-by: eggmasonvalue <215011718+eggmasonvalue@users.noreply.github.com>
|
This pull request addresses two main issues:
onSurfaceDestroyedin bothLifeCalendarServiceandDayCounterServiceto properly cancel scheduled tasks and stop the animation loop when the surface is destroyed (e.g., when screen recording starts). This prevents the app from attempting to draw to an invalid surface.dayCounterModepreference to handle dynamic date calculations for "No Tomorrow" and "Vs Yesterday" presets. Previously, these presets saved static dates, causing the "breathing" indicator (current day) to become a static "past" item the next day. The new logic calculates start and event dates relative toLocalDate.now()daily, ensuring the intended visualization persists correctly.DayCounterModuleto verify the dynamic date logic.gradle.propertiesthat caused build failures in some environments.PR created automatically by Jules for task 779938241268541767 started by @eggmasonvalue