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

Prevent double taps on multi select actions #6186

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

seadowg
Copy link
Member

@seadowg seadowg commented Jun 12, 2024

Closes #6159

Why is this the best possible solution? Were any other approaches considered?

I've just used our standard MultiClickGuard approach to blocking double taps here. I didn't add it to the Select All/Clear all button as it felt like that should be toggle-able, and I couldn't find a problem with it.

Do we need any specific form for testing your changes? If so, please attach one.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@seadowg seadowg marked this pull request as ready for review June 13, 2024 10:57
@seadowg seadowg requested a review from grzesiek2010 June 13, 2024 10:57
@@ -19,7 +19,7 @@
android:layout_weight="1"
android:text="@string/select_all" />

<com.google.android.material.button.MaterialButton
<org.odk.collect.androidshared.ui.multiclicksafe.MultiClickSafeMaterialButton
Copy link
Member

Choose a reason for hiding this comment

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

Ahh I'm not a fan of this solution. Not a long time ago we converted this button from MultiClickSafeMaterialButton to MaterialButton #6098 and now we convert it back to MultiClickSafeMaterialButton. I won't be surprised if in a month or two we find something else in the same area that will force us to change this part of the code again.
Maybe a good solution would be to have two types of MultiClickSafeMaterialButton... one that would work exactly like the existing one and another one that would only block multiple clicks on exactly the same button but not other instances of it.
I'm ok with merging this temporarily if you want to fix it for v2024.2 but please file a separate issue to rework it later.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, great point! I'd forgotten that it was one of the ones we had switched over. I'll have another go.

@seadowg seadowg requested a review from lognaturel June 17, 2024 12:12
@seadowg seadowg merged commit f7eb09b into getodk:master Jun 18, 2024
6 checks passed
@seadowg seadowg deleted the multi-select-double-tap branch June 18, 2024 15:09
@srujner
Copy link

srujner commented Jun 20, 2024

Tested with Success!
Verified on device with Android 13

Verified cases:

@WKobus
Copy link

WKobus commented Jun 20, 2024

Tested with Success!
Verified on device with Android 14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash after multiclicking "delete selected" in "Delete form- blank forms"
5 participants