谷歌眼镜 - “跳”到CardScrollView卡? [英] Google Glass - 'Jump' to a card in CardScrollView?

查看:184
本文介绍了谷歌眼镜 - “跳”到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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆