Android-自定义快速搜索框
如果您使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于没有屏幕截图,我帮不上什么忙,因为我不使用官方 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. Returntrue
to say you're handling the search yourself. Along the way, pop up whatever you like to allow the user to do a search.