Skip to content

Comments

Cleaning PermissionItem#19033

Merged
BrayanDSO merged 3 commits intoankidroid:mainfrom
Arthur-Milchior:item
Aug 23, 2025
Merged

Cleaning PermissionItem#19033
BrayanDSO merged 3 commits intoankidroid:mainfrom
Arthur-Milchior:item

Conversation

@Arthur-Milchior
Copy link
Member

While reviewing @ericli3690 PR, I found many things that I thought could be cleaned in the PermissionItem. Strating with the fact that, as there may be multiple permissions, it should use plural. And that the listener code was tool complex for what it actually does.

I hesitated to create a PermissionsItem.Delegate interface, and replace the listener variable by a delegate variable. I decided against it, I don't think it would have added a lot of clarity

@david-allison david-allison added the Needs reviewer reply Waiting for a reply from another reviewer label Aug 3, 2025
@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author and removed Needs reviewer reply Waiting for a reply from another reviewer labels Aug 3, 2025
@david-allison
Copy link
Member

Build fails

@github-actions
Copy link
Contributor

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

Arthur-Milchior and others added 3 commits August 23, 2025 04:53
There are multiple permission potentially
There was no reason to reset it each time a new listener is
set. Admittedly it's only once in practice. I still think this make
the code easier to read, and allows for more simplification.
It was only a setter, which can be public in Kotlin.
Also, the `listener` is renamed to indicate exactly what is occurring.

Co-authored-by: David Allison <62114487+david-allison@users.noreply.github.com>
@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Author Reply Waiting for a reply from the original author Has Conflicts labels Aug 23, 2025
Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

Rebased & applied change requests

@BrayanDSO BrayanDSO added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Aug 23, 2025
@BrayanDSO BrayanDSO added this pull request to the merge queue Aug 23, 2025
Merged via the queue into ankidroid:main with commit efc2ec9 Aug 23, 2025
10 checks passed
@github-actions github-actions bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Aug 23, 2025
@github-actions github-actions bot added this to the 2.23 release milestone Aug 23, 2025
ericli3690 added a commit to ericli3690/Anki-Android-ericli3690 that referenced this pull request Aug 27, 2025
GSoC 2025: Review Reminders

Arthur pluralized most of the terms relating to permissionsItems at ankidroid#19033, but `permissionRequested` should become `permissionsRequested` in keeping with his changes.

Additionally, the permissions explanation page which is coming in a later commit needs to provide the ability to ungrant permissions, which means it needs to know, when permissionsRequested is called, if the permissions are already granted or not. Hence, here I make permissionsRequested take a boolean argument, providing whether the permissions are already granted.
ericli3690 added a commit to ericli3690/Anki-Android-ericli3690 that referenced this pull request Aug 27, 2025
GSoC 2025: Review Reminders

Arthur pluralized most of the terms relating to permissionsItems at ankidroid#19033, but `permissionRequested` should become `permissionsRequested` in keeping with his changes.

Additionally, the permissions explanation page which is coming in a later commit needs to provide the ability to ungrant permissions, which means it needs to know, when permissionsRequested is called, if the permissions are already granted or not. Hence, here I make permissionsRequested take a boolean argument, providing whether the permissions are already granted.
github-merge-queue bot pushed a commit that referenced this pull request Aug 28, 2025
GSoC 2025: Review Reminders

Arthur pluralized most of the terms relating to permissionsItems at #19033, but `permissionRequested` should become `permissionsRequested` in keeping with his changes.

Additionally, the permissions explanation page which is coming in a later commit needs to provide the ability to ungrant permissions, which means it needs to know, when permissionsRequested is called, if the permissions are already granted or not. Hence, here I make permissionsRequested take a boolean argument, providing whether the permissions are already granted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants