Android-自定义快速搜索框

发布于 2024-10-02 04:51:32 字数 255 浏览 0 评论 0原文

如果您使用 Android 版 Twitter,您会发现单击手机的硬搜索按钮会带来完全定制的类似快速搜索的控制。现在我并不是说它是 Android 定制的快速搜索,但如何构建这样的东西呢? 我想要快速的搜索框行为,但我也想添加一些额外的选择器(想想 Firefox 搜索,左侧有一个下拉菜单可以选择搜索引擎) 我怀疑单击搜索会带来另一种看起来像快速搜索的活动。现在我知道如何从快速搜索中触发搜索活动,但如何拦截快速框调用并显示您的活动? 我应该从哪里开始做这样的事情呢?任何提示和指示将不胜感激

If you using Twitter for Android you can see that clicking on phone's hard search button brings fully customized quick search-like control. Now I'm not saying that it IS stock Android customized quick search but how would one build something like that?
I want quick search box behavior but I also want add some additional selectors (think Firefox search where on the left there's a dropdown to select search engine)
I suspect that clicking search brings another activity that just looks like a quick search. Now I know how to trigger search activity from the quick search but how to intercept quick box call and display your activity instead?
Where would I start with something like that? Any hints and pointers will be greatly appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红尘作伴 2024-10-09 04:51:32

由于没有屏幕截图,我帮不上什么忙,因为我不使用官方 Twitter 应用程序(我是 Seesmic 人),所以我不太知道你在说什么。

您可以重写 onSearchRequested() 以在用户请求在您的 Activity 中进行搜索时获得控制权。返回 true 表示您正在自行处理搜索。在此过程中,弹出您喜欢的任何内容以允许用户进行搜索。

With no screenshot, I can't help terribly much, since I don't use the official Twitter app (I'm a Seesmic guy), so I don't quite know what you are talking about.

You can override onSearchRequested() to get control when the user requests a search in your activity. Return true to say you're handling the search yourself. Along the way, pop up whatever you like to allow the user to do a search.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文