简体   繁体   English

Android-自定义快速搜索框

[英]Android - custom quick search box

If you using Twitter for Android you can see that clicking on phone's hard search button brings fully customized quick search-like control. 如果您使用的是适用于Android的Twitter,则可以看到单击电话的硬搜索按钮会带来完全自定义的类似于快速搜索的控件。 Now I'm not saying that it IS stock Android customized quick search but how would one build something like that? 现在,我并不是说这是股票Android定制的快速搜索,但是如何构建这样的东西呢? 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. 我想要快速的搜索框行为,但我还想添加一些其他选择器(例如Firefox搜索,在左侧的下拉列表中可以选择搜索引擎),我怀疑单击搜索会带来另一种看起来像快速搜索的活动。 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 任何提示和指针将不胜感激

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. 没有屏幕截图,我无法提供太多帮助,因为我没有使用官方的Twitter应用程序(我是Seesmic家伙),所以我不太了解您在说什么。

You can override onSearchRequested() to get control when the user requests a search in your activity. 当用户在您的活动中请求搜索时,您可以覆盖onSearchRequested()以获取控制权。 Return true to say you're handling the search yourself. 返回true表示您正在自行处理搜索。 Along the way, pop up whatever you like to allow the user to do a search. 在此过程中,弹出您想要允许用户进行搜索的任何内容。

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

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