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