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


Java Card.addImage方法代码示例

本文整理汇总了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();
}
 
开发者ID:raahilshah,项目名称:ProjectKilo,代码行数:21,代码来源:CardPresenter.java

示例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();
    }
 
开发者ID:corneliudascalu,项目名称:google-glass-share-barcode-bluetooth,代码行数:23,代码来源:CardPresenter.java

示例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);
}
 
开发者ID:a-paxton,项目名称:PsyGlass,代码行数:21,代码来源:SettingsActivity.java

示例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();
}
 
开发者ID:gsi-upm,项目名称:Financial-Twitter-Tracker-Demo,代码行数:8,代码来源:MainActivity.java

示例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;
}
 
开发者ID:coderoshi,项目名称:glass,代码行数:11,代码来源:GameActivity.java

示例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();
}
 
开发者ID:mimming,项目名称:firebase-fruit-detector,代码行数:18,代码来源:DetectFruitActivity.java

示例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;
}
 
开发者ID:longzheng,项目名称:PTVGlass,代码行数:10,代码来源:CardsActivity.java


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