Fix progress dialog outside touch #20210
Conversation
|
First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible. |
david-allison
left a comment
There was a problem hiding this comment.
The backend offers cancellation, but as far as I understand it, this PR removes the only way to access it (maybe the back button?)
You haven't shown evidence of testing for this change.
The other syncing dialogs have a 'cancel' button [sorry for the bad screensnip], is there a reason you didn't add this in?
|
This change only disables cancellation via outside-touch. It does not change The backend cancellation path is unchanged and no code regarding this has been touched; only accidental dismissal via background taps is prevented.
Reference: https://developer.android.com/reference/android/app/Dialog#setCanceledOnTouchOutside(boolean)
I intentionally avoided adding new UI here to keep the change minimal. Other sync dialogs do include a Cancel button, but the forced full-sync dialog currently relies on the Back button for cancellation, and this PR preserves that existing behavior rather than introducing a new interaction. If adding an explicit Cancel button here would be preferable for consistency, I will do the needful accordingly. |
I have updated the PR to include the evidence of testing (i.e., screen recording).
Backend cancellation can still be done via the back button, as shown in the video below: Cancellation.via.back.working.evidence.mp4 |
david-allison
left a comment
There was a problem hiding this comment.
The dialog must have an explicit cancel button if you're going to remove the 'cancel on touch outside' functionality
There's a lot of code changes here, and a lot of parameters, an additional refactor to define 'options' for withProgress may be useful
Yes, code changes are there. But as far as the parameter is concerned, I have added only one parameter per function to disable outside touch. For the changes, these are small recurring additions only. Nothing significant has been changed. |
Yes, it may be useful if
But for only one parameter, I will prefer to keep it as a direct argument to keep the modification minimal @david-allison How shall I go about it? |
Done! Added.CANCEL.button.while.full.sync.mp4 |
|
optional: This will be easier to merge if you
|
|
Yes! I am doing that only... |
9f417c1 to
216101a
Compare
|
I earlier (maybe a month ago), by mistake ran While trying to do
Either way, with those commits this would have not been possible. |
|
@david-allison I have created #20420 PR that do the same cleanly with the aforementioned feedback and same logic. |

Purpose / Description
During a forced one-way / full sync, the progress dialog can currently be dismissed by tapping on the dimmed background (i.e. Outside the box).
Fixes
Approach
Cancelbutton to manually abort the full sync.How Has This Been Tested?
Tested on my phone (Android 14, Xiaomi / HyperOS) using a debug build.
Outside touch no longer cancels syncing.
Videos attached as evidence.
Checklist
Before this change:
Outside_Touch_BEFORE.mp4
After this change:
Outside_Touch_AFTER.mp4