本文整理汇总了Java中com.google.android.glass.widget.CardScrollAdapter类的典型用法代码示例。如果您正苦于以下问题:Java CardScrollAdapter类的具体用法?Java CardScrollAdapter怎么用?Java CardScrollAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CardScrollAdapter类属于com.google.android.glass.widget包,在下文中一共展示了CardScrollAdapter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.google.android.glass.widget.CardScrollAdapter; //导入依赖的package包/类
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
super.onCreate(bundle);
CardScrollAdapter mAdapter = new CardAdapter(createCards(this));
mCardScroller = new CardScrollView(this);
mCardScroller.setAdapter(mAdapter);
setContentView(mCardScroller);
setCardScrollerListener();
}
示例2: showContent
import com.google.android.glass.widget.CardScrollAdapter; //导入依赖的package包/类
public void showContent(final CardScrollAdapter adapter, final CardSelectedListener listener) {
vCardScroll.setAdapter(adapter);
vCardScroll.activate();
if (listener != null) {
vCardScroll.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
listener.onCardSelected(adapter.getItem(position));
}
});
}
hideProgress();
}