kiwix-android
kiwix-android copied to clipboard
Added support for Android's per-app language setting.
Fixes #4222
- Introduced the per-app language feature in application.
- Added
androidx.appcompat:appcompat-resourcesdependency. - Setting the chosen language in AppCompatDelegate to update the selected language globally so that it is displayed in the system settings.
- Migrated the previously chosen language in AppCompatDelegate so that the previously selected language will remain active.
- Added support for pre Android 13 devices since this API is introduced in Android 13 so we have added the backward compatibility for this API.
- Since now,
AppCompatDelegateis handling our locales and we don't need to handle it by ourself so we have removed the unused code from our application. - Refactored the test cases to use this new API for handling the locales.
- Fixed: The message was showing in the previously chosen language when saving the file, and showing the downloading estimate time in the previously chosen language.
- Fixed: Some unnecessary memory leaks were reported in Android 14 and above devices due to https://github.com/square/leakcanary/issues/2559.
Below Android 13 devices
https://github.com/user-attachments/assets/4368b10b-bfe4-4aca-a178-ae37139084ef
Above Android 15 devices
https://github.com/user-attachments/assets/13e5fbef-9c54-495a-b76a-effc1c32facb
Codecov Report
Attention: Patch coverage is 66.66667% with 6 lines in your changes missing coverage. Please review.
Project coverage is 57.62%. Comparing base (
102162f) to head (2b007c5).
:x: Your patch check has failed because the patch coverage (66.66%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files
@@ Coverage Diff @@
## main #4228 +/- ##
============================================
+ Coverage 57.49% 57.62% +0.13%
- Complexity 1582 1601 +19
============================================
Files 316 316
Lines 13786 13755 -31
Branches 1729 1728 -1
============================================
+ Hits 7926 7927 +1
+ Misses 4669 4650 -19
+ Partials 1191 1178 -13
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.