谷歌眼镜 - “跳”到CardScrollView卡? [英] Google Glass - 'Jump' to a card in CardScrollView?
问题描述
我有一个使用 CardScrollView
来显示一系列卡片的谷歌应用程序的玻璃。
I have a Google Glass app that uses a CardScrollView
to display a series of Cards.
触摸手势工作卡之间移动,但我需要能够通过他们的指数跳转到特定的卡。我想用上下文语音命令(忽略其局限性现在)要做到这一点,例如:OK玻璃,去卡25
Touch gestures work to move between cards, but I need to be able to jump to specific cards by their index. I want to use contextual voice commands (ignore its limitations for now) to do this, for example: "ok glass, go to card 25".
我希望能够做这样的事......
I was hoping to be able to do something like this...
CardScrollView mCardScrollView = new CardScrollView(this);
// ...
// "ok glass, go to card 25"
// ...
mCardScrollView.setFocus(25);
...但我似乎无法找到一个函数来做到这一点。
...But I can't seem to find a function to do that.
我没有找到谷歌的参考页面上的任何内容:<一href=\"https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/widget/CardScrollView\" rel=\"nofollow\">https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/widget/CardScrollView
I didn't find anything on Google's reference page: https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/widget/CardScrollView
和其样本code不包括此两种:结果
的https://developers.google.com/glass/develop/gdk/ui-widgets#scrolling_cards_in_activities
And their sample code doesn't cover this either:
https://developers.google.com/glass/develop/gdk/ui-widgets#scrolling_cards_in_activities
我想使用,以保持 CardScrollView
如果可能的话,因为我喜欢比它动画的方式,滚动 ViewFlipper
或 ViewPager
。它是这样一个简单的功能,我认为应该有。也许我失去了一些东西?
I'd like to keep using CardScrollView
if possible because I like the way it animates and scrolls compared to ViewFlipper
or ViewPager
. It's such a simple functionality that I believe should be there. Perhaps I'm missing something?
推荐答案
我只是有一个类似的问题。我能够使用mCardScrollView.setSelection(cardPosition)和它的工作对M
I was just having a similar issue. I was able to use mCardScrollView.setSelection(cardPosition) and it worked for m
这篇关于谷歌眼镜 - “跳”到CardScrollView卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!