本文整理汇总了Java中com.google.android.glass.app.Card.addImage方法的典型用法代码示例。如果您正苦于以下问题:Java Card.addImage方法的具体用法?Java Card.addImage怎么用?Java Card.addImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.glass.app.Card
的用法示例。
在下文中一共展示了Card.addImage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCardView
import com.google.android.glass.app.Card; //导入方法依赖的package包/类
public View getCardView(Context context) {
Card card = new Card(context);
card.setText(mText);
card.setFootnote(mFooter);
for (Uri uri : mImages) {
if (uri != null) {
Log.w(TAG, "ImageUri: " + uri.toString());
try {
card.addImage(MediaStore.Images.Media.getBitmap(
context.getContentResolver(), uri));
} catch (IOException e) {
Log.e(TAG, "Failed to load: " + e);
}
} else {
Log.w(TAG, "We got a null imageUri!");
}
}
return card.getView();
}
示例2: getCardView
import com.google.android.glass.app.Card; //导入方法依赖的package包/类
public View getCardView(Context context) {
Card card = new Card(context);
card.setText(mText);
card.setImageLayout(Card.ImageLayout.FULL);
// card.setFootnote(mFooter);
for (Uri uri : mImages) {
if (uri != null) {
Log.w(TAG, "ImageUri: " + uri.toString());
try {
card.addImage(MediaStore.Images.Media.getBitmap(
context.getContentResolver(), uri));
} catch (IOException e) {
Log.e(TAG, "Failed to load: " + e);
}
} else {
Log.w(TAG, "We got a null imageUri!");
}
}
return card.getView();
}
示例3: createCards
import com.google.android.glass.app.Card; //导入方法依赖的package包/类
public void createCards() {
cards = new ArrayList<Card>(1);
Card card = new Card(this);
card.addImage(R.drawable.upload);
long timestamp = getPrefTimestamp() * 1000;
if (timestamp == -1) {
card.setText("Data\nNone");
} else {
int interval = (int) (getPrefDuration());
int minute = interval / 60;
int second = interval % 60;
SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy\nHH:mm");
card.setText("DATA\n" +
"DeviceId: " + getPrefDeviceId() + "\n" +
format.format(new Date(timestamp)) + " MT\n" +
String.format("%02dm%02ds", minute, second));
}
cards.add(card);
}
示例4: buildView
import com.google.android.glass.app.Card; //导入方法依赖的package包/类
private View buildView() {
Card card = new Card(this);
card.setText(R.string.app_name);
card.setImageLayout(Card.ImageLayout.LEFT);
card.addImage(R.drawable.logo_bbva);
return card.getView();
}
示例5: loadingCardView
import com.google.android.glass.app.Card; //导入方法依赖的package包/类
private View loadingCardView() {
Card loadingCard = new Card( this );
loadingCard.setImageLayout( ImageLayout.FULL );
loadingCard.addImage( R.drawable.loading );
loadingCard.setText(
getResources().getString(R.string.high_score) + getSavedScores() );
View cardView = loadingCard.getView();
cardView.setKeepScreenOn( true );
return cardView;
}
示例6: buildView
import com.google.android.glass.app.Card; //导入方法依赖的package包/类
/**
* Builds a Glass styled "Hello World!" view using the {@link Card} class.
*/
private View buildView(String fruitType) {
Card card = new Card(this);
card.setText(fruitType);
if(fruitType.equals("orange")) {
card.addImage(R.drawable.orange);
} else if(fruitType.equals("apple")) {
card.addImage(R.drawable.apple);
} else {
card.addImage(R.drawable.ic_stop);
}
return card.getView();
}
示例7: getImagesCard
import com.google.android.glass.app.Card; //导入方法依赖的package包/类
private Card getImagesCard(Context context) {
Card card = new Card(context);
card.addImage(R.drawable.codemonkey1);
card.addImage(R.drawable.codemonkey2);
card.addImage(R.drawable.codemonkey3);
card.addImage(R.drawable.codemonkey4);
card.addImage(R.drawable.codemonkey5);
return card;
}