简体   繁体   English

Android Material Design-等待用户输入

[英]Android Material Design - Waiting for user input

I know we can produce very powerful animation effects in Android using AnimationUtil and xml animation files but would this be considered a good practice for Material Design, specifically for a case when we wait for user do do something. 我知道我们可以使用AnimationUtil和xml动画文件在Android中产生非常强大的动画效果,但是这对于Material Design是一种好的做法,特别是在我们等待用户做某事的情况下。

For example, I have activity with single image or image button on it. 例如,我有一个带有单个图像或图像按钮的活动。 User lands on this activity and is expected to tap on that image. 用户登陆此活动,并有望点击该图像。 I want to give some feedback to user rather than having just a label like "Click here". 我想向用户提供一些反馈,而不是仅仅带有“单击此处”之类的标签。

I could make a nice animation using AnimationUtil class and xml file in res/anim folder. 我可以使用res / anim文件夹中的AnimationUtil类和xml文件制作漂亮的动画。 But would that be how material design recommends it doing? 但这是材料设计推荐它的方式吗? I looked through Material Design guidelines and could not find anything specific to "animation effect waiting for user input" but the screenshot below makes me believe using animation does not violate Material Design guidelines. 我浏览了Material Design指南,找不到“等待用户输入的动画效果”特有的内容,但是下面的屏幕截图使我相信使用动画不会违反Material Design指南。

Any suggestions? 有什么建议么?

I am talking about something like this example 我说的是这个例子

在此处输入图片说明

There are no specific guidelines against animating buttons while waiting for user input. 在等待用户输入时,没有针对动画按钮的特定准则。 But you would want to make sure that the animation makes sense in the context of your application. 但是,您需要确保动画在您的应用程序上下文中有意义。 For instance, if you are designing a game, then it would be great to have a button with a little game character on it jumping up and down trying to get the user to start the tutorial for their first time. 例如,如果您正在设计游戏,那么最好在其上具有一个带有游戏角色的按钮来回跳动,以尝试使用户首次启动该教程。 But if you are designing an email app or a feedreader or something, it would obviously be pretty distracting to have icons and buttons flashing, wiggling, and spinning all over the place. 但是,如果您正在设计电子邮件应用程序或供稿阅读器之类的东西,那么让图标和按钮到处闪烁,摆动和旋转显然会分散注意力。 So with that in mind, you would want to make sure the animation is 1) needed, 2) not distracting, 3) fits with the design of the rest of your app. 因此,考虑到这一点,您需要确保动画是1)所需的,2)不分散注意力的,3)符合应用程序其余部分的设计的。

There are plenty of Stackoverflow questions that show how to do various animations on buttons, so just search for the one you want to do. 有很多Stackoverflow问题,它们显示如何在按钮上进行各种动画处理,因此只需搜索要执行的动画即可。 For instance, if you just wanted to do a simple pulsing alpha transition, this question shows how to do that perfectly: android - How can I make a button flash? 例如,如果您只想做一个简单的脉冲alpha过渡,则此问题说明了如何完美地做到这一点: android-如何使按钮闪烁?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM