Android的 - 小吃吧VS吐司 - 使用和差异 [英] Android - Snackbar vs Toast - usage and difference

查看:270
本文介绍了Android的 - 小吃吧VS吐司 - 使用和差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经在我们的应用使用了祝酒词只是到目前为止,和我们计划采取从支持设计库我想知道一些新的特点有什么推荐的用法与小吃吧吐司。

我一直在阅读上谷歌的博客。


  

小吃店提供关于操作轻便反馈在一个小
  在屏幕上移动的底座,并在左下角上弹出
  桌面。他们首先在元素在屏幕上,包括
  FAB。


和祝酒词。


  

的Andr​​oid还提供了一种胶囊型面包,主要用于
  系统短信。吐司类似于小吃店但不包含
  行动,不能刷卡关闭屏幕。


我明白他们做了什么,但我有点迷茫的时候使用什么。这是否意味着:


  • 如果我不要求用户交互我会用一个面包?

  • 什么是系统消息是什么意思?这是否适用于显示信息时,一些重要的东西我的应用程序和Android系统之间发生了什么?

  • 我喜欢的是刷卡关闭屏幕的功能 - 那会是一个理由,开始小吃店更换敬酒? (这是一个基于有点意见的问题虽然)


解决方案

  

如果我不要求用户交互我会用一个面包?


您仍然可以使用小吃店。这不是强制性的,以与小吃店的动作。


  

什么是系统消息是什么意思?这是否适用于显示
  当一些重要的事情发生在我的应用程序和信息之间
  Android系统?


我相信这意味着祝酒词将被使用,如果有关于该系统的一些messags。使用Android作为一个整体,或者你可能在运行一些后台服务。例如。 文本到语音未安装。未发现的电子邮件客户端。


  

我喜欢的是刷卡关闭屏幕的功能 - 会是这样一个道理
  先从小吃店更换敬酒? (这有点意见的基础
  但问题)


这是一个原因。但是还有其他一些加点。举一个例子:您敬酒保持在屏幕上,即使活动结束。小吃店没有。有减少混乱,如果敬酒不弹出(或保留在序列多吐司创作的情况下弹出)应用程序退出后不久。这不会发生小吃店

更多的则一切:我建议如果你所想,你应该切换。小吃店看起来远比祝酒词更好。

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 usage for Snackbar vs. Toast.

I have been reading on the google blog.

Snackbars provide lightweight feedback about an operation in a small popup at the base of the screen on mobile and at the lower left on desktop. They are above all over elements on screen, including the FAB.

and toasts.

Android also provides a capsule-shaped toast, primarily used for system messaging. Toasts are similar to snackbars but do not contain actions and cannot be swiped off screen.

I understand what they do but I am a bit confused when to use what. Does it mean that:

  • If I don't require user interaction I would use a toast?
  • What is meant by "system messaging"? Does that apply to displaying information when something important happened between my app and the Android system?
  • What I like is the swipe off screen feature - would that be a reason to start replacing toasts with snackbars? (this is a bit opinion based question though)

解决方案

If I don't require user interaction I would use a toast?

You can still use snackbar. It is not mandatory to have an action with snackbar.

What is meant by "system messaging"? Does that apply to displaying information when something important happened between my app and the Android system?

I believe this means Toasts are to be used if there are some messags pertaining to the system. Either android as a whole or some background service you may be running. E.g. Text-To-Speech is not installed. OR No Email client found.

What I like is the swipe off screen feature - would that be a reason to start replacing toasts with snackbars? (this is a bit opinion based question though)

That is one reason. But there are several other plus points. For an example: Your toast remains on screen even when the activity is finished. Snackbar doesn't. There is less confusion if the toast does not popup (or keep popping up in case of multiple Toast creation in sequence) long after the app is exited. This will not happen with snackbar.

More then everything: I suggest if you are thinking, you should switch. SnackBars look far better than Toasts.

这篇关于Android的 - 小吃吧VS吐司 - 使用和差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆