Android 快速操作 UI 模式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3059155/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:32:06  来源:igfitidea点击:

Android Quick Actions UI Pattern

android

提问by Jeremy Edwards

I'm interested in incorporating the Android UI pattern called "Quick Action". Basically, it's a context menu that doesn't cover up the data that is being acted on. I'd like to implement this but I cannot find some sample code or an API to help me out.

我对合并名为“Quick Action”的 Android UI 模式很感兴趣。基本上,它是一个上下文菜单,不会覆盖正在处理的数据。我想实现这个,但我找不到一些示例代码或 API 来帮助我。

Note this UI pattern is discussed in the YouTube video, http://www.youtube.com/watch?v=M1ZBjlCRfz0#t=15m20s.

请注意,YouTube 视频http://www.youtube.com/watch?v=M1ZBjlCRfz0#t=15m20s 中讨论了此 UI 模式。

Does anyone have an implementation of this or know what Google's standard is for adding this to an application?

有没有人有这个实现或知道谷歌将它添加到应用程序的标准是什么?

采纳答案by Juri

Till the official Twitter app is open sourced by Google, you may want to take a look at this implementation: http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/

直到官方 Twitter 应用程序被谷歌开源,你可能想看看这个实现:http: //www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/

Really easy to use and works great.

真的很容易使用并且效果很好。

回答by Josh Clemm

This open source project has the same look and feel for the quick actions popup as the twitter app:

这个开源项目的快速操作弹出窗口与 twitter 应用程序具有相同的外观和感觉:

http://github.com/ruqqq/WorldHeritageSite/tree/master/src/sg/ruqqq/WHSFinder

http://github.com/ruqqq/WorldHeritageSite/tree/master/src/sg/ruqqq/WHSFinder

It helps to download the whole project because you need a number of drawables, images, and other resources from that project.

它有助于下载整个项目,因为您需要该项目中的大量可绘制对象、图像和其他资源。

The main demo class is called WHSListActivity.java. The other classes you need is QuickActionWindow.java, and QuickActionItem.java.

主要演示类称为 WHSListActivity.java。您需要的其他类是 QuickActionWindow.java 和 QuickActionItem.java。

After that, it's really easy and works great. I use it for my apps.

之后,它真的很容易并且效果很好。我将它用于我的应用程序。

回答by pableu

Interesting Question. Android uses this pattern in their Contacts-App. You can get the source using git:

有趣的问题。Android 在他们的 Contacts-App 中使用这种模式。您可以使用 git 获取源代码:

git clone git://android.git.kernel.org/platform/packages/apps/Contacts.git

I did this and quickly grepped it, but I didn't get a conclusive result. I thinkthat's done in "Contacts/src/com/android/contacts/ui/QuickContactWindow.java", but I am not completely sure.

我这样做了并很快得到了它,但我没有得到结论性的结果。我认为这是在“Contacts/src/com/android/contacts/ui/QuickContactWindow.java”中完成的,但我不完全确定。

I you google for QuickContact android, there are a lot of images that show exactly the kind of menu that you want, so it seems likely that it is indeed called QuickContact in that context.

我在谷歌上搜索QuickContact android,有很多图像可以准确显示您想要的菜单类型,因此在这种情况下它似乎确实被称为 QuickContact。

Looking at the Documentation, I don't see any inherited classes that you could use to do this for something other than contacts.

查看文档,我没有看到任何可用于为联系人以外的其他对象执行此操作的继承类。

So, a few starting points, but no solution from me ;-)

所以,一些起点,但我没有解决方案;-)

回答by ccpizza

The Android UI Patterns app includes demos and links to repos for several Quick Action implementations:

Android UI Patterns 应用程序包括几个 Quick Action 实现的演示和存储库链接:

https://play.google.com/store/apps/details?id=com.groidify.uipatterns

https://play.google.com/store/apps/details?id=com.groidify.uipatterns

(I have nothing to do with the app apart from finding it useful.)

(除了觉得它有用之外,我与该应用程序无关。)