-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix Navigation Bar Buttons Not Visible with Signup Sheet #11051
Fix Navigation Bar Buttons Not Visible with Signup Sheet #11051
Conversation
Generated by 🚫 dangerJS |
You can test the changes on this Pull Request by downloading the APK here. |
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.
The navigation bar looks good in the screenshots for this pull request in portrait orientation, but the landscape orientation looks odd since only part of the navigation bar background is unshadowed.
We should be able to fix this without hacks. We updated the navigation bar background color including bottom sheets in Simplenote in Automattic/simplenote-android#792. The changes included updating the base class from BottomSheetDialog
to BottomSheetDialogFragment
as well as updating styles.xml
files. See the screenshots in the pull request for illustration.
Thank you for the directions @theck13 🙇♀️. I'll take a look and update it. |
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.
Note: @theck13 I hope you don't mind me jumping in. Riccardo would like to merge a feature which is blocked by this bug into the next release so I wanted to speed thing up. Since the changes are touching the Login flow I think it's good to have it reviewed by at least two developers anyway.
Thanks @ashiagr! I've reviewed most of the code and tested the changes. I've left some in-code comments and I found a bug during the tests. Let me know what you think ;)
Emulator, Nexus 9, API 28
- the buttons are white on light background
- the width of the view seems a bit weird
- I'm not sure we want to change the width of the bottom navigation bar
Don't worry if we don't merge the changes before the code freeze - we can create a hotfix if it's necessary to include the fix in the next release.
WordPress/src/main/java/org/wordpress/android/ui/accounts/LoginActivity.java
Show resolved
Hide resolved
...ressLoginFlow/src/main/java/org/wordpress/android/login/SignupBottomSheetDialogFragment.java
Outdated
Show resolved
Hide resolved
...ressLoginFlow/src/main/java/org/wordpress/android/login/SignupBottomSheetDialogFragment.java
Show resolved
Hide resolved
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() { | ||
@Override | ||
public void onDismiss(DialogInterface dialog) { | ||
mSignupSheetListener.onSignupSheetCanceled(); |
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.
It seems this call is duplicated - we invoke the same callback in public void onDismiss(DialogInterface dialog)
. Is this intentional?
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.
dialog.setOnDismissListener
was initially added referring to SimpleNote dialog code. It didn't seem to cover a scenario when dialog fragment was dismissed by touching on the screen and screen was rotated (dialog fragment reappeared even though it was dismissed) which is why I added public void onDismiss(DialogInterface dialog)
callback. I'll test it further and see if we can eliminate one of them.
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.
Fixed here d15dd92
...LoginFlow/src/main/java/org/wordpress/android/login/widgets/WPBottomSheetDialogFragment.java
Outdated
Show resolved
Hide resolved
If Android decides to recreate a Fragment later, it's going to call the no-argument constructor of the fragment.
...ressLoginFlow/src/main/java/org/wordpress/android/login/SignupBottomSheetDialogFragment.java
Show resolved
Hide resolved
Thank you for reviewing the changes @malinajirka 🙏! Fixed issues related to dialog to fragment conversion. However this design issue still remains,
Noticed it appears in SimpleNote android app as well As we're using a light themed bottom sheet style, ideally navigation bar icons should have been darker in color. But it isn't the case here, Android platform provides little support in customising navigation bar icons color. @theck13 are you aware of the issue in SimpleNote app? Do you have any suggestions? |
No, I wasn't aware of it. No, I don't have any suggestions. |
Thanks @ashiagr! I've looked into this and I found what is causing the issue. It's the hack we use in |
Good catch @malinajirka ! Thanks for looking into it.
Right, it is the default OS behavior. I agree we should keep it fullwidth. Screenshots for the fullwidth layout (for design review):
Tried setting it on the fragment's view, it doesn't seem to be covering full width It could be because full width setting for dialog window
|
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.
@ashiagr Hey this looks like a great starting point, good job!
If we find a scenario where this isn't working for us later I think we can add more breakpoints or definitions at that point. Would you agree?
Also do you think we should extend this to landscape on phones in any cases or keep it just for tablet? cc @theck13 as well on that point.
I agree.
I would want it to be consistent with our other apps like SimpleNote, and like to know @theck13's inputs. |
Simplenote is different since it uses the Personally, I think the bottom sheet looks a little stretched on phones in landscape orientation. To adjust that and since the horizontal button layout only occurs in landscape orientation, we could add |
Thanks @theck13 ! I tested |
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.
LGTM @ashiagr !
cc @develric as we are trying to solve some landscape issues with sheets that are related.
@develric and I are also making some stylistic changes to bottom sheets for the iA project - I think the style changes should probably apply across the board as part of a bottom sheet component. But not sure which task that would be a part of - its probably separate to this.
…sible-with-signup-sheet # Conflicts: # libs/login/WordPressLoginFlow/src/main/java/org/wordpress/android/login/SignupBottomSheetDialog.java
Now that we have |
Thanks for the suggestion @theck13 . I removed the value from According to Android's best-matching resource guide , it seems we have this order of precedence:
If we remove |
@theck13 do you find the solution good enough to be merged? If yes, can you approve these changes? |
I haven't found a better solution, but I haven't been researching this either. Therefore, we're going to use this is Simplenote (Automattic/simplenote-android#933). I haven't reviewed the code as extensively as @malinajirka and he had requested changes in his review. So I'll leave the final approval to him. |
Thanks @ashiagr for all the improvements!! ;) The final solution is great. I've been testing the sign-up flow and I noticed two bugs.
|
We're freezing |
Thanks for catching the bug @malinajirka ! Fixed here f963bc2 |
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 @ashiagr! It all looks good now.
I think we might want to keep an eye on Sign-Up/Login tracks after 14.3 gets released. Just to make sure we didn't introduce any crashes. Could you please add a reminder and check it when the time comes. Thanks!
P.S. We should also push the changes to the login lib repo.
@theck13 It seems, I can't merge the PR, since you requested some changes. Could you please either dismiss the review or approve it and merge the PR. Thanks! |
This PR tries to fix #10908
It is an existing Android issue which has become obsolete because of lower priority. Seems like we need to go for a hack to fix it. Tried different solutions, this one seems to be working well in both portrait and landscape mode.
To test:
PR submission checklist:
I have considered adding unit tests where possible.
I have considered if this change warrants user-facing release notes and have added them to
RELEASE-NOTES.txt
if necessary.