-
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
Add @username suggestions to notification and reader full comment view. #10781
Add @username suggestions to notification and reader full comment view. #10781
Conversation
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.
Thank you, @hafizrahman for working on this.
It looks like there is a bug in the suggestions view. To reproduce:
- Show the full-screen comment view
- Add a few lines
- Add
@
to show the suggestions list
The suggestions list is always shown at the top:
I'm not quite sure what's causing it but I think it should be fixed.
WordPress/src/main/java/org/wordpress/android/ui/CommentFullScreenDialogFragment.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/CommentFullScreenDialogFragment.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/CommentFullScreenDialogFragment.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/CommentFullScreenDialogFragment.kt
Outdated
Show resolved
Hide resolved
@shiki Thanks for reviewing things! As for this part, it seems like the dropdown generated by Here's the Stack Overflow link that was my starting point for the research. In this case I think the current positioning at the top is already the ideal compromise, it will remain viewable and selectable regardless of the current text cursor position. |
Howdy folks! I'm freezing |
Design Review RequestHi Design Team! 👋 I was wondering you could give some inputs on this. Currently, the dropdown will always be shown at the top even if the cursor is somewhere in the bottom (#10781 (review)). Is there an existing design within the app that we can follow? I spent some time to look at whether we can follow the cursor position. It seems quite challenging. 🤔 |
@shiki Hey thanks for the ping. Strange, I was thinking I would really like to have it next to the cursor. However I think if its fixed to something, I think fixed to the keyboard can work really well. In the left of this sketch, the suggestion box appears above the keyboard. There is an item cut off to indicate its scrollable. On the right: I know that we can't make it dynamic depending on cursor position. But can we make it dynamic depending on the total amount of content? So that more of the list is visible when the space is available and its always close to what you're writing? Last note - in the sketch I have drawn this full width as I think it can work nicely with the keyboard and feel more natural to scroll within. Not sure if that is easy or problematic with this component. Keep me in the loop! |
Thank you, @osullivanchris! Making it full width and fixing it to the keyboard sounds doable. I've seen other apps doing something similar. Making the height dynamic could be a nice-to-have but we can attempt it. |
We're freezing |
This uses a thin dummy view that sticks to the bottom of the screen, to which the suggestion dropdown can be anchored to.
@shiki I added some layout fixes to make the suggestion drop down stick to the bottom. This also fixed the bug I mentioned above as far as I can check. Some screenshots: |
Thanks @hafizrahman looks much better! Nice job |
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.
Great work, @hafizrahman!
I just wanted to note that the dropdown can cover the whole text view if there are so many suggestions.
We could use android:dropDownHeight="SOMETHING_DP"
for this but I think it doesn't matter because if the cursor is at the bottom of the text field, it will still get covered.
That said, we're limited to the current architecture for this. To fully achieve the suggestion in #10781 (comment), we would probably need to concoct our own custom views. I believe what we have here is already great enough.
app:layout_constraintTop_toTopOf="parent" | ||
android:dropDownAnchor="@+id/dummy_hidden_view" /> | ||
|
||
<View |
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.
That's really smart. 👍
Fixes #10328
To test:
On notification area
On reader area
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.@shiki Question about that last checkbox above, is this change something that warrants being added to RELEASE-NOTES.txt?