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

Rework quit dialog #5614

Merged
merged 28 commits into from
Jun 22, 2023
Merged

Rework quit dialog #5614

merged 28 commits into from
Jun 22, 2023

Conversation

seadowg
Copy link
Member

@seadowg seadowg commented May 29, 2023

Closes #5490

There's a few differences in the implemented dialog and the mock-ups referenced in the issue (dialog title font weight, button text size etc). I've discussed this with @alyblenkin and as these should all be resolved by #5607 and #5567, we'll wait to do those next release rather than trying to poly fill solutions here.

What has been done to verify that this works as intended?

New (and existing) tests.

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

Not a lot to discuss here. The code mostly follows the structure we already had in place. I'll highlight anything of interest with inline comments.

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?

Quitting new and draft forms is the key thing to look at here. It's also important to check these flows with different access control settings (especially the "Save as draft" setting) enabled and disabled. As with the old quit dialog, this one will not remain on screen during configuration changes (like rotations or unfolds for example).

Before submitting this PR, please make sure you have:

  • run ./gradlew checkAll and confirmed all checks still pass OR confirm CircleCI build passes and run ./gradlew connectedDebugAndroidTest locally.
  • 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

android:text="@string/discard_changes"
app:icon="@drawable/ic_delete"
app:iconGravity="textStart"
app:iconSize="18dp"
Copy link
Member Author

Choose a reason for hiding this comment

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

We shouldn't need to set this. I've filed an issue over at the Material Components repo.

app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/discard_changes" />

<com.google.android.material.button.MaterialButton
Copy link
Member Author

Choose a reason for hiding this comment

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

I was surprised I'd never run into this before, but it's currently not possible to change the style of a view programmatically (or after it's inflated more accurately). This means having duplicated views for the "Keep editing" button.

@seadowg seadowg marked this pull request as ready for review May 30, 2023 12:37
@seadowg seadowg requested a review from grzesiek2010 May 31, 2023 13:29
@grzesiek2010
Copy link
Member

@seadowg Please fix conflicts and rebase onto master.

@srujner
Copy link

srujner commented Jun 21, 2023

I found one issue with rotating the screen

Steps to reproduce:

  1. Click back button to Open Quit Dialog;
  2. Rotate the screen;
  3. Click back button to open Quit Dialog once again.
XRecorder_21062023_152335.mp4

@srujner
Copy link

srujner commented Jun 21, 2023

Should this be Save Form or Save Changes when Quitting from Previously saved changes?

Screenshot_20230621-152444

@seadowg
Copy link
Member Author

seadowg commented Jun 21, 2023

Should this be Save Form or Save Changes when Quitting from Previously saved changes?

We only talked about it being "Save form", but it would be nice for it to switch to "Save changes" like you described. We can maybe add that another time.

@seadowg
Copy link
Member Author

seadowg commented Jun 21, 2023

I found one issue with rotating the screen

I can't reproduce this. Are you seeing it every time on multiple devices?

@srujner
Copy link

srujner commented Jun 21, 2023

I found one issue with rotating the screen

I can't reproduce this. Are you seeing it every time on multiple devices?

Yes, on Pixel 3a and Pixel 6a, but you need to have both Save as draft option turned on in the Access control -> Form Entry Setting, otherwise the buttons works correctly

@srujner
Copy link

srujner commented Jun 21, 2023

Also there is something wrong with Save as Draft in Access control -> Form Entry Setting.

  1. When I Uncheck the Save as draft in Form Entry and Check Save as draft in Form End then I'll still see Save as draft button in Quit Dialog and At the end of the form
  2. When I check the Save as draft in Form Entry and Unheck Save as draft in Form End then I won't see Save as draft button in Quit Dialog and At the end of the form
XRecorder_21062023_155311.mp4

@seadowg
Copy link
Member Author

seadowg commented Jun 21, 2023

Yes, on Pixel 3a and Pixel 6a, but you need to have both Save as draft option turned on in the Access control -> Form Entry Setting, otherwise the buttons works correctly

Is just the default setup?

Also there is something wrong with Save as Draft in Access control -> Form Entry Setting.

Ah! Looks like I've used the wrong setting. Will fix.

@srujner
Copy link

srujner commented Jun 21, 2023

Is just the default setup?

yep

@seadowg
Copy link
Member Author

seadowg commented Jun 21, 2023

@srujner I'm using those settings (demo project and All Widgets form), and I'm not able to reproduce. Could you try an emulator for me? What Android version are those phones using?

@srujner
Copy link

srujner commented Jun 21, 2023

@seadowg Android 12 and 13 I tried on Emulator on Pixel 5 device with Android 12 and I was also able to reproduce it there.

Update
But it is not reproducing on emulator on Android 7.0

@seadowg
Copy link
Member Author

seadowg commented Jun 21, 2023

Managed to reproduce on a Pixel 5 Android 13 emulator. No idea what's going on here, but will look into it.

@seadowg
Copy link
Member Author

seadowg commented Jun 21, 2023

@srujner that's fixed now. I've just made the dialog scrollable so that the layout won't fall apart in landscape on thinner phones.

@dbemke
Copy link

dbemke commented Jun 22, 2023

Tested with Success!

Verified on device with Android 8.1, 10

Verified cases:

  • the quit dialog according to Rework form exit modal to provide last saved date/time and to use new draft language #5490 design
  • issues mentioned in the PR are not reproducable
  • scrolling the quit dialog in landscape view
  • the quit dialog new forms and drafts
  • checking the time of last saved form in drafts in the quit dialog
  • save as draft in Form Entry and Form End enabled and disabled
  • moving backwards enabled and disabled
  • quick checks in audit logs in Track Changes Reason, Audit Test form
  • tapping back button while on Identify User form first dialog
  • different font sizes
  • RTL, Spanish language
  • dark and light mode
  • rotating, minimizing, locking the screen
  • quick checks on emulated device with Android 6.0

@srujner
Copy link

srujner commented Jun 22, 2023

Tested with Success!

Verified on device with Android 12, 13

@grzesiek2010 grzesiek2010 merged commit fd65e7a into getodk:master Jun 22, 2023
6 checks passed
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.

Rework form exit modal to provide last saved date/time and to use new draft language
4 participants