woefe / ShoppingList

A simple shopping list for Android
https://woefe.github.io/ShoppingList/
GNU General Public License v3.0
73 stars 23 forks source link

Undo snackbar #55

Open Nuntius0 opened 5 years ago

Nuntius0 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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?

Any ideas?

And thanks for all your PRs :heart:

Nuntius0 commented 5 years ago

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 commented 5 years ago

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?