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

Fixed buttons that are blocked too long #6098

Merged
merged 6 commits into from
Apr 24, 2024

Conversation

grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Apr 18, 2024

Closes #6061

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

As discussed in the issue there are two approaches we can use depending on our needs:

  1. We can stop using the MultiClickSafeMaterialButton if we have multiple buttons on one screen and we don't want to block them. Here a good example is the navigation buttons or the control buttons that we use to select/unselect/delete forms.
  2. If we still want to block multi-clicking inside a particular screen but not if a user navigates from another screen then we need to make such buttons screen-aware: a4e84e4

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

This should fix the problem with the navigation buttons and the buttons that control lists of forms (select/unselect/delete). Nothing else should be affected. It's possible that other places in the app might need similar changes but we can identify them later and file separate issues.

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

No.

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

No.

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
  • 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

@grzesiek2010 grzesiek2010 marked this pull request as ready for review April 18, 2024 21:40
@grzesiek2010 grzesiek2010 requested a review from seadowg April 18, 2024 21:40
@grzesiek2010 grzesiek2010 changed the title Fixed buttons that are block too long Fixed buttons that are blocked too long Apr 23, 2024
Copy link
Member

@seadowg seadowg left a comment

Choose a reason for hiding this comment

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

Really like the way this is done. I'll mark this as "needs testing" now as I've only requested a couple of tweaks that won't change behaviour.

defStyleAttr
)
init {
context.theme.obtainStyledAttributes(
Copy link
Member

Choose a reason for hiding this comment

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

Could we add a helper to ContextUtils for grabbing theme string theme attributes like this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, kotlin offers an extension function called withStyledAttributes so we can use it ffa8c79

androidshared/src/main/res/values/screen_names.xml Outdated Show resolved Hide resolved
@seadowg seadowg merged commit ac5d061 into getodk:master Apr 24, 2024
6 checks passed
@srujner
Copy link

srujner commented May 6, 2024

Tested with Success!

Verified on device with Android 12,13

Verified cases:

@dbemke
Copy link

dbemke commented May 6, 2024

Tested with Success!

Verified on device with Android 10

@WKobus
Copy link

WKobus commented May 6, 2024

Tested with Success!

Verified on device with Android 11

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.

Buttons are blocked a bit too long after e.g. going to the end page
5 participants