本文整理汇总了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;
}
示例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();
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}