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
Conversation
Fixes #1195 |
There was a problem hiding this 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?
There was a problem hiding this 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.
- open the Settings.
- try to click on the URL bar.
- notice the Tray goes missing.
- none of the UI becomes responsive anymore.
@@ -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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
f236b24
to
b40bac0
Compare
@@ -23,7 +23,7 @@ | |||
|
|||
import java.net.URI; | |||
|
|||
public class PermissionWidget extends UIWidget implements WidgetManagerDelegate.FocusChangeListener { | |||
public class PermissionWidget extends UIDialog implements WidgetManagerDelegate.FocusChangeListener { |
There was a problem hiding this comment.
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?
There was a problem hiding this 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:
- 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).
- pressing on the Tray no longer dismisses the Settings UI.
- 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 👍).
- 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!
b40bac0
to
88b9589
Compare
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. |
There was a problem hiding this 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.
I'm merging this so we can generate another release candidate today, @cvan if you find something else create a follow-up issue |
No description provided.