Add Test a link, Portuguese localization, and update APK cleanup - #23
Merged
Conversation
- Settings: new "Test a link" field (shown once the Gemini API key is saved) runs a pasted Instagram/TikTok link through the share pipeline without needing a real OS share. Bridged via MainActivity into ShareRoute's existing sharedText mechanism, since feature modules never depend on each other directly. Fixed a latent gap where submitting the same URL twice wouldn't retrigger ShareRoute's LaunchedEffect, via a new sharedTextRequestId nonce. - Settings: new "Language" section, placed first on the screen (ahead of the API key field), deep-linking into the system per-app language screen (Settings.ACTION_APP_LOCALE_SETTINGS, API 33+ only). - Added Portuguese translations (values-pt/strings.xml) across every module with user-facing strings, plus android:localeConfig + locales_config.xml (en, pt) so Android 13+ shows "App language" in system Settings with no extra runtime code. - core:update: added ClearDownloadedUpdateUseCase + UpdateApkCleanupReceiver, listening for ACTION_MY_PACKAGE_REPLACED, to delete the downloaded update APK from the cache dir once install finishes, so it doesn't sit there wasting space. - Updated agents.md and README.md to document all of the above. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Description
Three related Settings/UX improvements:
feature:settings,feature:share,app): a new field in Settings, shownright after the Gemini API key is saved, lets you paste an Instagram/TikTok link and run it
through the exact same pipeline as a real OS share - no need to switch back to Instagram/TikTok
first. Since feature modules never depend on each other directly, this is wired through
MainActivity(the composition root) intoShareRoute's existingsharedTextmechanism. Thatsurfaced a latent bug:
LaunchedEffectdoesn't restart when the same URL is submitted twice in arow (Compose skips recomposition on structurally-equal state), fixed with a
sharedTextRequestIdnonce bumped alongside
sharedTexton every submission.app+ all feature modules,corelocale config): fullvalues-pt/strings.xmltranslations across every module with user-facing strings, verifiedkey-for-key/array-count/format-specifier parity against the English source. Added
android:localeConfig+locales_config.xml(en, pt) so Android 13+ automatically exposes an"App language" entry in system Settings - no extra runtime code needed given
targetSdk=36. Anew Language section sits at the top of Settings (ahead of the API key field, per explicit
request) with a button deep-linking to
Settings.ACTION_APP_LOCALE_SETTINGS, hidden below API 33.core:update): afterfeature:settings's "Update to latest" installs anewer build, the downloaded APK was left behind in
context.cacheDir/updates/. AddedClearDownloadedUpdateUseCase+ a manifest-registeredUpdateApkCleanupReceiverlistening forACTION_MY_PACKAGE_REPLACED(a documented exception to Android 8+ implicit-broadcastrestrictions, delivered only to the just-updated app and survives process death during install)
to delete it once install finishes.
agents.mdandREADME.mdare updated to document all three.How to Test
./gradlew ktlintCheck./gradlew test(covers the 3 newClearDownloadedUpdateUseCaseTestcases)./gradlew compileDebugKotlin compileDebugUnitTestKotlinInstagram/TikTok link, tap Test, and confirm it runs through the share pipeline. Confirm the new
Language section is at the top of Settings and deep-links correctly on API 33+. Install an update
via "Update to latest" and confirm the downloaded APK is gone from the cache afterward.
Checklist
./gradlew ktlintCheckpasses (orktlintFormatwas run to fix style)./gradlew testpasses for all affected modulesagents.md/README.mdupdated if this changes architecture, setup, or dev workflow