Stats calculation fixes, accessibility blockerService fix and spanish internationalization#35
Merged
PranavPurwar merged 15 commits intoaload0:mainfrom Jan 18, 2026
Merged
Conversation
Reworks the logic for calculating app foreground time using UsageEvents, improving accuracy and compatibility with newer Android versions. Introduces separate event queries for lookback and main intervals, and simplifies event handling for ACTIVITY_RESUMED and ACTIVITY_PAUSED.
Introduces a new strings.xml file with Spanish translations for all user-facing text in the application, supporting localization for Spanish-speaking users.
Added kotlin-android plugin and set JVM target in Reef and appintro build scripts. Updated gradle.properties with new Android build options. Refreshed library versions in libs.versions.toml, including AGP, Compose BOM, Material3, and others.
Remove `android:process=":blocker_process` since it makes the blockservice fail
Added androidx.startup.InitializationProvider to the manifest to support initialization of WorkManager. The provider is set as non-exported and includes meta-data for WorkManagerInitializer, with node removal specified for merging.
Updated MainActivity to use string resources for navigation bar labels and time suffixes instead of hardcoded strings. This improves localization and consistency across the app.
Introduced a 5-minute selection to the time options in AppSelectorDialog for improved granularity when setting durations.
Corrects the calculation of days for week offset and day iteration in AppUsageViewModel. Updates logic to properly add/subtract days and checks for usage data more accurately, ensuring correct navigation and data retrieval for previous weeks.
Introduces new string resources for focus session states, slide actions, sample routines, and bottom navigation in both English and Spanish. Also updates several existing strings for consistency and clarity.
Extracted event querying into a helper function for cleaner code. Improved logic for tracking package foreground times by handling noisy packages and ensuring accurate duration calculation. This refactor enhances maintainability and correctness of screen usage tracking.
Removed several deprecated Android Gradle properties.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and fixes across the codebase, focusing on internationalization (i18n), UI text consistency, build configuration, and logic corrections for app usage statistics. The main highlights are enhanced support for string resources, pluralization, and proper date calculations, leading to a more robust and user-friendly experience.
Internationalization and UI Text Consistency
MainActivity.ktandMainScreen.ktwith string resources usingstringResource()and plural resources, improving localization and consistency throughout the app. This includes navigation labels, card titles, button texts, and timer descriptions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Build Configuration Updates
kotlin.androidplugin to the Gradle build file and made minor adjustments to the Android build configuration for better compatibility and future-proofing. [1] [2] [3]App Usage Statistics Logic Fixes
AppUsageViewModel.ktfor weekly statistics, ensuring accurate week offsets and proper handling of previous week data checks. This fixes issues with how days and weeks are computed and iterated. [1] [2] [3]Manifest and Code Cleanup
AndroidManifest.xmlfor clarity and maintainability. [1] [2] [3]Minor UI Enhancements
Contextto components where needed to support quantity strings and localization features, such as in theTimeLimitsCard. [1] [2]Let me know if you want to dive deeper into any of these areas or see the specific code changes!