-
-
Notifications
You must be signed in to change notification settings - Fork 221
Feature/about compose finalized #2740
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
Feature/about compose finalized #2740
Conversation
|
Before I review this, just one question: where did my and realjoni's code in #2576 go? I'm not seeing my WIP commit in there, nor their commit, so it's very hard for me to know which code is new and which are your fixes, which will make review a lot harder and more time consuming 😅 Are you asking for a full review? Because I don't think this is ready to merge, the second I start scrolling I see some pretty weird unrelated changes like the build config being removed, which is needed for Google Play policy compliance 😅 |
|
I’ve separated the AboutActivity tests into unit and instrumented tests, migrated them to be Compose-compatible, and covered all scenarios from component visibility to functionality. Regarding the build features, I removed them from the default config since they were defined there instead of being separated for debug and release builds. Keeping them in the default config would require manually toggling values between builds. Instead, I’m now relying on BuildConfig.DEBUG, which automatically resolves to false in release builds. This ensures both the Donate and Rate the app buttons remain visible to users in the release version. |
The donate and rate app button is not shown on release and hidden on debug though. The donate button is shown only on the foss flavour, because Google bans apps from having donate buttons. The rate is only shown in the Google Play version because it's silly to ask people to rate on Google Play if that's not where they got the app from. I'm going to have to find some time soon to manually review and compare things (after the BuildConfig thing is fixed again) because everything moved to different files, so the git diff view is basically useless :) |
TheLastProject
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a very quick scroll a lot of this looks fine I think, will have to test and look more closely later. But I'm seeing some things that seem off from a quick look
|
|
||
| <!-- | ||
| In Android 11 (API level 30) and higher, package visibility restrictions apply. | ||
| Without declaring this <queries> element, calls like | ||
| intent.resolveActivity(activity.packageManager) will return null, | ||
| because the system hides apps that can handle the intent. | ||
| --> | ||
| <queries> | ||
| <intent> | ||
| <action android:name="android.intent.action.VIEW" /> | ||
| <category android:name="android.intent.category.BROWSABLE" /> | ||
| <data android:scheme="https" /> | ||
| </intent> | ||
| </queries> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for? Catima has been running on Android 11 and up for ages and has never needed this before.
|
|
||
| buildConfigField("boolean", "showDonate", "true") | ||
| buildConfigField("boolean", "showRateOnGooglePlay", "false") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained, this change is wrong.
| androidTestImplementation("androidx.test:core:$androidXTestVersion") | ||
| androidTestImplementation("junit:junit:$junitVersion") | ||
| androidTestImplementation("androidx.test.ext:junit:1.2.1") | ||
| // androidTestImplementation("androidx.test.ext:junit:1.3.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why commented out code?
|
|
||
| // Test rules and transitive dependencies: | ||
| implementation("androidx.compose.ui:ui-test-junit4:1.9.2") | ||
| // Needed for createComposeRule(), but not for createAndroidComposeRule<YourActivity>(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Needed for createComposeRule(), but not for createAndroidComposeRule<YourActivity>(): | |
| // Needed for createComposeRule(), but not for createAndroidComposeRule<YourActivity>(): |
| // Use reflection to test private methods | ||
| with(composableTestRule) { | ||
| onNodeWithTag(context.getString(R.string.license)) | ||
| .performClick() | ||
|
|
||
| onNodeWithText(context.getString(R.string.ok)) | ||
| .assertIsDisplayed() | ||
| .performClick() | ||
|
|
||
| onNodeWithText(context.getString(R.string.ok)) | ||
| .assertIsNotDisplayed() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this reflection? Are these private methods?
| showDonate = !BuildConfig.DEBUG, // show donate button only in release builds | ||
| showRateOnGooglePlay = !BuildConfig.DEBUG, // show rate button only in release builds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect logic
| usedLibraries.add( | ||
| ThirdPartyInfo( | ||
| "NumberPickerPreference", | ||
| "https://github.com/invissvenska/NumberPickerPreference", | ||
| "GNU LGPL 3.0" | ||
| ) | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for self: this needs updating, see #2712
| // Ensure it opens in browser, not your own app | ||
| addCategory(Intent.CATEGORY_BROWSABLE) | ||
| flags = Intent.FLAG_ACTIVITY_NEW_TASK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we never need to do this before? Bit confused by this change. I'm not sure why Catima would ever handle these URLs?
|
Hi @TheLastProject , I've closed my previous pull request for this issue as it had a number of mistakes and was becoming difficult to follow. My apologies for any confusion. I'm happy to start over with a fresh branch and a clean implementation to get this done correctly. Before I begin, could you please let me know if help is still needed on this? If so, I'll get started right away. Thanks! |
Resolves #2489
refactor(about): Modernize AboutActivity architecture and expand test coverage
This commit overhauls the About screen and its associated tests to align with modern Android development best practices, improving maintainability, performance, and reliability.
AboutActivity Refactor
compose/AboutScreen.kt). This improves maintainability and separates UI rendering from the Activity's lifecycle logic.Test Suite Improvements
Kotlin Conversion