Add profile pictures from files#3086
Conversation
fire-light42
left a comment
There was a problem hiding this comment.
Thank you for you contribution! Great job on the new feature!
Overall good code, but there are some minor nitpicks.
|
Addressed the requested Activity Result API, image/* MIME, string alias, and toast placement changes in f59858c. I kept internal file copying out of scope as noted optional; persisted document permissions and the existing fallback remain in place. Ready for re-review when convenient. |
There was a problem hiding this comment.
Great job!
Unfortunately passing around a variable to 100 subclasses is a bit too messy, but I realize you did it for a lack of a better solution, there is no good solution after all.
I would really want you to register one global variable in CommonActivity like this: https://github.com/recloudstream/cloudstream/blob/master/app/src/main/java/com/lagradost/cloudstream3/CommonActivity.kt#L254-L266
This is how we solved a similar problem previously, I failed to send it though :(
It should be a pretty easy change thankfully. This way we do not have to pass around the variable everywhere. After these changes it should be fully done and ready to merge. Sorry for the added difficulties 😢
What does this change?
Adds a file option to the profile image editor while preserving the existing URL flow.
Selected image documents must decode successfully before preview. Read access is persisted only when the edit is applied, and an inaccessible document falls back to the account's default avatar. Replaced and deleted document grants are released only after no account still references them.
This review revision follows the requested architecture by exposing the profile-image picker through
CommonActivity. Each initialized activity owns its lifecycle-safe launcher, while stale picker results and superseded validation requests are ignored. Account UI call sites no longer thread picker callbacks through adapters and dialogs.The edit icon also has a content description and explicit D-pad focus navigation while retaining its existing touch background.
Closes #3079
Testing
:app:compileStableDebugKotlin:app:testStableDebugUnitTest(8 tests, 0 failures):app:lintStableDebug(0 errors)git diff --checkLimitations
AI disclosure
AI-assisted: implementation and review used OpenAI Codex; the listed checks were run on the submitted code.