当前位置: 首页>>代码示例>>Java>>正文


Java CardBuilder.getView方法代码示例

本文整理汇总了Java中com.google.android.glass.widget.CardBuilder.getView方法的典型用法代码示例。如果您正苦于以下问题:Java CardBuilder.getView方法的具体用法?Java CardBuilder.getView怎么用?Java CardBuilder.getView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.glass.widget.CardBuilder的用法示例。


在下文中一共展示了CardBuilder.getView方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getView

import com.google.android.glass.widget.CardBuilder; //导入方法依赖的package包/类
/**
 * Returns the view for the relevant position
 * If it is 0 then it is the title card
 * Otherwise it is one of the results
 * If the string for the results is our constant BEGIN_REVIEWS
 * then display the REVIEWS title card
 *
 * @param position position of the View to return in the CardScrollView
 * @param convertView
 * @param parent
 * @return the View to display
 */
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    CardBuilder card;
    if (position == 0) {
        card = new CardBuilder(mContext, CardBuilder.Layout.MENU)
                .setText(mTitle)
                .setFootnote("by " + mAuthor);
    } else if (mItems.get(position - 1).equals("BEGIN_REVIEWS")) {
        card = new CardBuilder(mContext, CardBuilder.Layout.MENU)
                .setText("REVIEWS");
    } else {
        card = new CardBuilder(mContext, CardBuilder.Layout.TEXT)
                .setText(mItems.get(position - 1))
                .setFootnote(mTitle)
                .setTimestamp(mAuthor);
    }
    View view = card.getView(convertView, parent);

    return view;
}
 
开发者ID:raahilshah,项目名称:ProjectKilo,代码行数:33,代码来源:ResultsCardScrollAdapter.java

示例2: buildView

import com.google.android.glass.widget.CardBuilder; //导入方法依赖的package包/类
/**
 * Builds a Glass styled "Hello World!" view using the {@link CardBuilder} class.
 */
private View buildView() {
    CardBuilder card = new CardBuilder(this, CardBuilder.Layout.TEXT);

    card.setText(R.string.hello_world);
    return card.getView();
}
 
开发者ID:xingrz,项目名称:prox,代码行数:10,代码来源:MainActivity.java

示例3: onCreate

import com.google.android.glass.widget.CardBuilder; //导入方法依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    CardBuilder card = new CardBuilder(this, CardBuilder.Layout.TEXT)
            .setText("Hello World")
            .setFootnote("This is from an Activity");
    cardView = card.getView();
    setContentView(cardView);
}
 
开发者ID:coderoshi,项目名称:glass,代码行数:9,代码来源:SimpleActivity.java

示例4: getView

import com.google.android.glass.widget.CardBuilder; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    CardBuilder card = new CardBuilder(mContext, CardBuilder.Layout.EMBED_INSIDE)
        .setEmbeddedLayout(R.layout.simple_table)
        .setFootnote(R.string.text_card_embedded_footnote)
        .setTimestamp(R.string.text_card_embedded_timestamp);
    View view = card.getView(convertView, parent);

    // Get a reference to an embedded view from the custom layout and then manipulate it.
    ViewGroup tableView = (ViewGroup) view.findViewById(R.id.simple_table);
    populateTableRows(position, tableView);

    return view;
}
 
开发者ID:googleglass,项目名称:gdk-apidemo-sample,代码行数:15,代码来源:EmbeddedCardLayoutAdapter.java

示例5: buildView

import com.google.android.glass.widget.CardBuilder; //导入方法依赖的package包/类
/**
 * Builds a Glass styled "Hello World!" view using the {@link CardBuilder} class
 */
private View buildView(String text) {
    CardBuilder card = new CardBuilder(this, CardBuilder.Layout.TEXT);
    card.setText(text);
    return card.getView();
}
 
开发者ID:akashlevy,项目名称:WhoDatFace,代码行数:9,代码来源:WhoDat.java

示例6: buildView

import com.google.android.glass.widget.CardBuilder; //导入方法依赖的package包/类
private View buildView() {
    CardBuilder card = new CardBuilder(this, CardBuilder.Layout.TEXT);

    card.setText(R.string.instructions);
    return card.getView();
}
 
开发者ID:xasos,项目名称:ScandIn-Glass,代码行数:7,代码来源:MainActivity.java

示例7: buildThirdView

import com.google.android.glass.widget.CardBuilder; //导入方法依赖的package包/类
private View buildThirdView(String textToDisplay) {
    CardBuilder card = new CardBuilder(this, CardBuilder.Layout.TEXT);

    card.setText(textToDisplay);
    return card.getView();
}
 
开发者ID:xasos,项目名称:ScandIn-Glass,代码行数:7,代码来源:MainActivity.java

示例8: buildView

import com.google.android.glass.widget.CardBuilder; //导入方法依赖的package包/类
private View buildView() {
    CardBuilder card = new CardBuilder(this, CardBuilder.Layout.TEXT);

    card.setText("Whatever");
    return card.getView();
}
 
开发者ID:pt2121,项目名称:NYC-Glass-Challenge-Oct2014,代码行数:7,代码来源:MenuActivity.java


注:本文中的com.google.android.glass.widget.CardBuilder.getView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。