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


Java Card.getView方法代码示例

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


在下文中一共展示了Card.getView方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: onActivityResult

import com.google.android.glass.app.Card; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode,
                                Intent data) {
  // When the voice input intent returns and is ok
  if (requestCode == SPEECH_REQUEST && resultCode == RESULT_OK) {
    // Get the text spoken
    List<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
    String spokenText = results.get(0);
    android.util.Log.d("VoiceInputActivity", "customization text: " + spokenText);

    // Add the text to the view so the user knows we retrieved it correctly
    Card card = new Card(this);
    card.setText(spokenText);
    View cardView = card.getView();
    setContentView(cardView);
  }

  super.onActivityResult(requestCode, resultCode, data);
}
 
开发者ID:Mobilevangelist,项目名称:google-glass-kitchen-sink,代码行数:20,代码来源:VoiceInputActivity.java

示例4: onCreate

import com.google.android.glass.app.Card; //导入方法依赖的package包/类
protected void onCreate(Bundle savedInstanceState){	
		super.onCreate(savedInstanceState);
		//keeps the camera on 
	    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
	    
		
		Card card1 = new Card(this);
		card1.setText("Nice Picture!");
		card1.setFootnote("Cool! ...");
		View card1View = card1.getView();
	    //Calling the intent
		setContentView(card1View);
		takePicture();
//	    Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); 
//	    cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, false);       
//	    startActivityForResult(cameraIntent, 1);
		setContentView(card1View);
		takePicture();
		
	}
 
开发者ID:stanzheng,项目名称:Google-Glass-Camera,代码行数:21,代码来源:MainActivity.java

示例5: onCreate

import com.google.android.glass.app.Card; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	
	Bundle extras= getIntent().getExtras();
	ArrayList<CraftARItem> results= extras.getParcelableArrayList("results");
	
	//In this example we just consider the best match.
	//Note that the API can return more than one match, and they are sorted by the confidence score.
	CraftARItem bestMatch= results.get(0);
	
	//Create a card with the content of the matched image.
	Card card = new Card(this);
	card.setText(bestMatch.getItemName());
	card.setFootnote(bestMatch.getItemId());

	View cardView = card.getView();
	setContentView(cardView);
	
}
 
开发者ID:Catchoom,项目名称:craftar-example-glass,代码行数:21,代码来源:ResultActivity.java

示例6: 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

示例7: buildView

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

    card.setText(R.string.preparing_message);
    cardView = card.getView();

    return cardView;
}
 
开发者ID:corneliudascalu,项目名称:google-glass-share-barcode-bluetooth,代码行数:12,代码来源:MainActivity.java

示例8: onCreate

import com.google.android.glass.app.Card; //导入方法依赖的package包/类
protected void onCreate(Bundle savedInstanceState){	
	super.onCreate(savedInstanceState);
       mGestureDetector = createGestureDetector(this);		
       Card card1 = new Card(this);
	
	card1.setText("Visual Gestures!");
	card1.setImageLayout(Card.ImageLayout.FULL);
	card1.setFootnote("Gestures's in Glass");
	View card1View = card1.getView();
	setContentView(card1View);
	card = card1;
}
 
开发者ID:stanzheng,项目名称:Google-Glass-Gestures,代码行数:13,代码来源:MainActivity.java

示例9: 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

示例10: 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

示例11: buildView

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

    card.setText("Launching capture...");
    return card.getView();

}
 
开发者ID:corneliudascalu,项目名称:google-glass-share-barcode-bluetooth,代码行数:8,代码来源:LaunchCaptureActivity.java


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