Android - Snackbar vs Toast - usage and difference

前端 未结 9 1948
温柔的废话
温柔的废话 2020-12-08 03:28

We have been using just Toasts in our application so far and as we are planning to adopt some new features from Support Design Library I am wondering what\'s the recommended

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-08 04:02

    The short answer is that those are 2 ways to communicate things to the user that happen in the background, and you can peak one of them, they both fine. Just make sure you're using the same one and not switching between them back and forth.

    The long answer:

    • No, that's mean that if you need some action you must use Snackbar. You can still use Snackbar only for messages (like "Uploading finished").
    • By "system" it doesn't mean just Android system. For example- if there was a json parsing problem while getting info from your server you can still use toast to let the user there was a problem while communicate with the server.
    • If you really need to swipe this off, that absultly be a reason to pick Snackbar

提交回复
热议问题