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

Undo snackbar #55

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Undo snackbar #55

wants to merge 5 commits into from

Conversation

Nuntius0
Copy link
Contributor

@Nuntius0 Nuntius0 commented Jul 6, 2019

Fixes #29.

The FAB needs to be wrapped in a parent CoordinatorLayout and the snackbar needs to be called on this parent instead of the bigger content_frame, otherwise the snackbar will overlay the FAB.
With the CoordinatorLayout, the FAB moves up as you expect it.
However if you use layout_height=wrap_content for the fabParent, then the FAB's top half will disappear when the snackbar comes in. Thus as a workaround I fixed the height manually.

Strings for French, Italian and Russian are not yet translated.

Also, I took the liberty to add myself to the list of contributors :)

@Nuntius0
Copy link
Contributor Author

I resolved the conflict manually on Github, and won't have a phone around to test it until tonight (so if you merge it before, make sure to test it).

@woefe
Copy link
Owner

woefe commented Jul 14, 2019

I built your patch and found the following issue: The Snackbar does not show up, if the Editbar is active. The Editbar is shown above the fab_add_parent CoordinatorLayout. And since the snackbar is bound to fab_add_parent, which is not visible because it is below layout_add_item the snackbar is not visible.

And where would we even show the snackbar, when the Editbar is active?

  • Above the Editbar? (Probably not enough space on small screens)
  • On top of the editbar? (Would overlay the "add" button)

Any ideas?

And thanks for all your PRs ❤️

@Nuntius0
Copy link
Contributor Author

Nuntius0 commented Jul 14, 2019

Good point, I totally missed that.

I think displaying it above the editbar makes the most sense.

The snackbar is supposed to be accessible, but shouldn't interfere with any other actions the user might want to perform. Having it overlay or move up the editbar (like the fab does) would interfere with the editing.

Height should not be too much of a concern, even if the keyboard is open, given todays screen sizes. I'll give it a try later and let's see what it looks like.

My pleasure :)

@Nuntius0
Copy link
Contributor Author

Here's an attempt at this. I'm not 100% satisfied with it, my first instict was that the snackbar should not overlay the editbar, but I couldn't get it to work (for now). On the other hand it's more consistent (in terms of Material Design) if it's always at the bottom.

I don't know if the editbar should then move up or not. I feel like if it moved up and down for this short period of time would add a lot of movement to the UI ("es wirkt unruhiger", can't find a good English word for that). And given the user just deleted an item, their focus is not on the editbar itself anyway for a few seconds? What do you think?

@Nuntius0 Nuntius0 mentioned this pull request Oct 28, 2020
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.

Add undo button for last deleted item
2 participants