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

refactor: mount receivers #16714

Merged
merged 1 commit into from
Sep 28, 2024
Merged

Conversation

Arthur-Milchior
Copy link
Member

@Arthur-Milchior Arthur-Milchior commented Jul 10, 2024

This ensure there is no change in behaviour.

I checked whether we could try to not export the download of decks, but it does not works.
The app does not crash on api 24 on simulator.

There was a slight problem, with variables that could potentially be null. To ensure the type checker agreed with the code, without using !!, I had to rewrite some of the logic.

I also ensured that some of the code that was copy/pasted in various activity now entirely belong to AnkiActivity. As a side effect, all activities that used to listen to the "unmount" notification and finished, will now also show a toast when the card gets unmounted. Currently it was only the deck picker.

david-allison

This comment was marked as resolved.

@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author Review High Priority Request for high priority review labels Jul 10, 2024
@Arthur-Milchior

This comment was marked as resolved.

@david-allison

This comment was marked as resolved.

Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

this works locally on an API23 emulator even (have to do some manual clicking because of the outdated-webview-check popup, during test)

this picks cleanly to release-2.18 in case we need it

@mikehardy
Copy link
Member

@david-allison with limited time and having already reviewed it I'm not sure on the value of splitting the refactor to a commit. It appears to work in local testing, I'd merge as is but you've got a pending reject, so back to you

@mikehardy mikehardy 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 Needs Review labels Jul 10, 2024
mikehardy

This comment was marked as resolved.

@mikehardy mikehardy added Needs Author Reply Waiting for a reply from the original author Needs Review and removed Needs Second Approval Has one approval, one more approval to merge labels Jul 10, 2024
@david-allison
Copy link
Member

Agreed - refactor would be better as a PR

@david-allison

This comment was marked as resolved.

@Arthur-Milchior

This comment was marked as resolved.

@Arthur-Milchior

This comment was marked as outdated.

@david-allison
Copy link
Member

For posterity: d90bdc8

This comment was marked as outdated.

@github-actions github-actions bot removed the Stale label Sep 7, 2024

This comment was marked as outdated.

Copy link
Member

@lukstbit lukstbit left a comment

Choose a reason for hiding this comment

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

Ok!

@lukstbit lukstbit added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Sep 24, 2024
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.

NoteEditor confuses me. The rest are nitpicks

AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt Outdated Show resolved Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AnkiActivity.kt Outdated Show resolved Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/AnkiActivity.kt Outdated Show resolved Hide resolved
@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Sep 24, 2024
@david-allison david-allison dismissed mikehardy’s stale review September 24, 2024 11:11

Reviewed changes were split out into 16717

This ensure that the same receiver appears in all activities and not
just the few one where the code was essentially copy pasted.

The Deck Picker also listen for mounting, so I renamed its receiver as
a `mountReceiver` instead
@david-allison david-allison added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Author Reply Waiting for a reply from the original author Needs Second Approval Has one approval, one more approval to merge labels Sep 28, 2024
@david-allison david-allison added this pull request to the merge queue Sep 28, 2024
Merged via the queue into ankidroid:main with commit fd461f2 Sep 28, 2024
9 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 Sep 28, 2024
@github-actions github-actions bot added this to the 2.19 release milestone Sep 28, 2024
@Arthur-Milchior Arthur-Milchior deleted the receiver branch September 28, 2024 14:17
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.

State whether register are registered
4 participants