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

Block background UI interaction for dialogs #1211

Merged
merged 1 commit into from May 17, 2019
Merged

Conversation

MortimerGoro
Copy link
Contributor

No description provided.

@MortimerGoro
Copy link
Contributor Author

Fixes #1195

Copy link
Contributor

@bluemarvin bluemarvin left a comment

Choose a reason for hiding this comment

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

I wonder if having a UIDialog class derived from UIWidget would be cleaner? That way dialogs are explicitly derived from a Dialog type instead of having to set a flag to true? I think it would make adding any new dialog feature easier?

Copy link
Contributor

@cvan cvan left a comment

Choose a reason for hiding this comment

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

👍 thanks for working on this. besides the DRY code comments, I noticed some issues with the UI elements when trying to click outside the active widget's clickable regions.

while the Settings was opened, by clicking on the URL bar, I was able to get the Tray to disappear and unable to come back. and the UI became responsive until it resulted in a crash (see logcat), which I was not prompted for upon relaunching FxR.

  1. open the Settings.
  2. try to click on the URL bar.
  3. notice the Tray goes missing.
  4. none of the UI becomes responsive anymore.

image

@@ -55,6 +55,7 @@ public CrashDialogWidget(Context aContext, AttributeSet aAttrs, int aDefStyle) {
private void initialize(Context aContext) {
inflate(aContext, R.layout.crash_dialog, this);

mIsDialog = true;
Copy link
Contributor

@cvan cvan May 13, 2019

Choose a reason for hiding this comment

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

instead, in UIWidget's parent initialize method can we set mIsDialog = true; (or setIsDialog(true);)?

}

private boolean isWidgetInputEnabled(Widget aWidget) {
return mActiveDialog == null || (mActiveDialog == aWidget);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can remove the parens: (, )


if (aWidget.isVisible()) {
mActiveDialog = aWidget;
} else if (aWidget == mActiveDialog) {
Copy link
Contributor

Choose a reason for hiding this comment

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

could combine this to be a single if statement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I was missing a condition in the else branch

@MortimerGoro MortimerGoro force-pushed the modal_dialog branch 2 times, most recently from f236b24 to b40bac0 Compare May 14, 2019 16:56
@MortimerGoro
Copy link
Contributor Author

MortimerGoro commented May 14, 2019

UIWidget base class is a good idea. I updated the PR adding it.

This new PR includes a commit from #1218. Pleas merge the #1218 before

@@ -23,7 +23,7 @@

import java.net.URI;

public class PermissionWidget extends UIWidget implements WidgetManagerDelegate.FocusChangeListener {
public class PermissionWidget extends UIDialog implements WidgetManagerDelegate.FocusChangeListener {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a typo? Since UIDialog is derived from FocusChangeListener, does PermissionWidget need to be as well?

Copy link
Contributor

@cvan cvan left a comment

Choose a reason for hiding this comment

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

👍 thanks for working on this. it looks like you did a significant amount of work to address the original issue: #1195.

I noticed a few regressions:

  1. keyboard input no longer works when attempting to edit values in the input fields in the Settings sub-menus (e.g., Display and Developer Options).
  2. pressing on the Tray no longer dismisses the Settings UI.
  3. pressing on the Navigation Bar no longer dismisses the Settings UI (but, per fixing issue Settings UI dims background but background UI can still be interacted with #1195, the presses are not propagated; nice work 👍).
  4. the hover state of the Settings button lingers, unlike it did before.

I've captured videos of after vs. before. see my annotations in the videos.

see this branch modal_dialog, modal_dialog rebased against release-1.2:
https://vimeo.com/user41954276/review/336277352/594b11e75c

vs.

master, release-1.2:
https://vimeo.com/user41954276/review/336277083/1f95da588d


I think given the issues mentioned above (sorted by severity IMO), we should wait before these items can be properly addressed before landing.

thanks again. much appreciated!

@MortimerGoro
Copy link
Contributor Author

MortimerGoro commented May 16, 2019

Ready for review again. Now it makes it possible to click on the keyboard or click on any disabled widget to trigger the same dismiss action as clicking in the empty space of the world.

@philip-lamb philip-lamb self-requested a review May 17, 2019 04:17
Copy link
Contributor

@philip-lamb philip-lamb left a comment

Choose a reason for hiding this comment

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

Tested against the regressions noted by @cvan and looks good to land in 1.2.

@MortimerGoro
Copy link
Contributor Author

I'm merging this so we can generate another release candidate today, @cvan if you find something else create a follow-up issue

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.

None yet

4 participants