Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove locale aware activity #21523

Merged

Conversation

nbradbury
Copy link
Contributor

@nbradbury nbradbury commented Dec 12, 2024

As a follow up to #21521, this PR removes LocaleAwareActivity. There are a lot of files changed in this PR, but this was because we extended LocaleAwareActivity in so many places. In this PR, I changed them all to extend AppCompatActivity.

Testing steps are the same as the prior PR.

Test 1:

  • Run the app on a device using Android 13 or later
  • Go to App Settings and tap "Interface language"
  • Note that the system dialog for "App Language" appears instead of our own
  • Verify changing languages works

Test 2:

  • Perform the above with an older device and verify our own language dialog appears and changing languages works

Note: There's still quite a bit of cleanup to do related to locale handling (unnecessary functions, etc.), but I wanted to keep this PR dedicated to removing LocaleAwareActivity. Cleanup is being addressed in this draft PR.

@dangermattic
Copy link
Collaborator

dangermattic commented Dec 12, 2024

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 12, 2024

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21523-e7f0947
Commite7f0947
Direct Downloadjetpack-prototype-build-pr21523-e7f0947.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 12, 2024

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21523-e7f0947
Commite7f0947
Direct Downloadwordpress-prototype-build-pr21523-e7f0947.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 39.44%. Comparing base (c62e604) to head (e7f0947).
Report is 10 commits behind head on feature/per-app-language-prefs.

Additional details and impacted files
@@                       Coverage Diff                       @@
##           feature/per-app-language-prefs   #21523   +/-   ##
===============================================================
  Coverage                           39.44%   39.44%           
===============================================================
  Files                                2119     2119           
  Lines                               99556    99556           
  Branches                            15313    15313           
===============================================================
  Hits                                39269    39269           
  Misses                              56806    56806           
  Partials                             3481     3481           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nbradbury nbradbury marked this pull request as ready for review December 13, 2024 13:44
@nbradbury nbradbury requested review from wzieba and ParaskP7 December 13, 2024 13:44
Copy link
Contributor

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 @nbradbury !

I have reviewed and tested this PR as per the instructions, everything works as expected, good job! 🌟


EXTRAS

About this Fixed detekt errors commit and the TODO: Xyz comment having its colon (:) character removed just to fixed Detekt complaining, I suggest keeping that colon (:) character, otherwise the TODO Xyz format is not the expected one. Instead, I suggest adding the @Suppress("ForbiddenComment") annotation to suppress this warning.

PS: Not related to this PR, but same applies to:

  • ReaderPostNewViewHolder.loadVideoThumbnail(...) function (needs to suppress, it being a Kotlin class), and
  • JobServiceId.isJobServiceWithSameParamsPending(...) method (need not to suppress, it being a Java class).

Them being the only other TODO I could find with the colon (:) character.

@nbradbury
Copy link
Contributor Author

I suggest keeping that colon (:) character, otherwise the TODO Xyz format is not the expected one. Instead, I suggest adding the @Suppress("ForbiddenComment") annotation to suppress this warning.

@ParaskP7 Can you elaborate on this? I'm not sure why this would be an improvement.

@ParaskP7
Copy link
Contributor

@ParaskP7 Can you elaborate on this? I'm not sure why this would be an improvement.

Sure @nbradbury , I have a few things on that:

  1. Detekt is looking for TODO: Xyz and not TODO Xyz comments to report on violations (ForbiddenComment). This rules is supposed to help prevent such comments to enter the the codebase, and only be used during development.
  2. From a quick search, the JP/WPAndroid codebase is mostly using TODO: Xyz, instead of TODO Xyz, so this helps with keeping some consistency.
  3. I also personally prefer to use TODO: Xyz over TODO Xyz, because the colon (:) helps with creating a "correct" sentence, me starting with a TODO Xyz, FIXME Xyz, etc, feels to me a bit off. However, I understand this is totally a personal preference thing, and me getting used to this, over anything else.

Copy link

@nbradbury nbradbury merged commit b2e7f5f into feature/per-app-language-prefs Dec 16, 2024
22 checks passed
@nbradbury nbradbury deleted the issue/remove-locale-aware-activity branch December 16, 2024 13:56
Copy link

sentry-io bot commented Dec 21, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=0, totalRows=1 org.wordpress.android.fluxc.persistence.EditorT... View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants