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


Java Card类代码示例

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


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

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

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

示例7: onCreate

import com.google.android.glass.app.Card; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);

    for (int i = 0; i < mlsText.size(); i++)
    {
        Card newCard = new Card(this);
        newCard.setImageLayout(Card.ImageLayout.FULL);
        newCard.setText(mlsText.get(i));
        mlcCards.add(newCard);
    }

    CardScrollView csvCardsView = new CardScrollView(this);
    csaAdapter cvAdapter = new csaAdapter();
    csvCardsView.setAdapter(cvAdapter);
    csvCardsView.activate();
    setContentView(csvCardsView);
}
 
开发者ID:dariol,项目名称:AndroidWearBLE,代码行数:20,代码来源:CardScrollActivity.java

示例8: buildCards

import com.google.android.glass.app.Card; //导入依赖的package包/类
private void buildCards(String notes) {
	String[] noteArray = notes.split("\\|");

	mNotes = new ArrayList<String>(noteArray.length);
	mCards = new ArrayList<Card>(mNotes.size());

	for (String note : noteArray) {
		Log.d(TAG, "Adding note \"" + note + "\"");
		mNotes.add(note);

		Card card = new Card(mContext);
		card.setText(note);
		card.setFootnote(mContext.getString(R.string.text_tap_for_options));

		mCards.add(card);
	}

}
 
开发者ID:victorkp,项目名称:GlassWebNotes,代码行数:19,代码来源:NoteAdapter.java

示例9: onResume

import com.google.android.glass.app.Card; //导入依赖的package包/类
@Override
protected void onResume(){
	super.onResume();
	
	//Get the voice results and send them to the server.
	String command = "";
	ArrayList<String> voiceResults = getIntent().getExtras()
	        .getStringArrayList(RecognizerIntent.EXTRA_RESULTS);
	
	for(int i=0;i< voiceResults.size(); i++){
		Log.d("Voice Results", voiceResults.get(i));
		command = voiceResults.get(i);
	}
	Card card1 = new Card(getBaseContext());
	card1.setText("Sending Command:\n" + command);
	// Don't call this if you're using TimelineManager
	View card1View = card1.toView();
	sendMessage(command);
	setContentView(card1View);
}
 
开发者ID:unl-nimbus-lab,项目名称:ros_glass_tools,代码行数:21,代码来源:VoiceControlActivity.java

示例10: onCreate

import com.google.android.glass.app.Card; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	Log.d("Startup", "STARTING");
	Intent intt = new Intent(this, ROSMonitorService.class);		
	//kill the service if it is already running because we want to subscrive to a new topic.  
	stopService(intt);

	Card card1 = new Card(this);
	card1.setText("Robot Warning Monitor");

	View card1View = card1.toView();

	// Display the card we just created
	setContentView(card1View);
	intt = new Intent(this, ROSMonitorService.class);	
	startService(intt);

}
 
开发者ID:unl-nimbus-lab,项目名称:ros_glass_tools,代码行数:20,代码来源:StartServiceActivity.java

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

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

示例13: DeviceCardScrollAdapter

import com.google.android.glass.app.Card; //导入依赖的package包/类
public DeviceCardScrollAdapter(Context context, ArrayList<BluetoothDevice> devices) {
    super();
    this.devices = devices;
    cards = new ArrayList<Card>(devices.size());
    for (BluetoothDevice device : devices) {
        Card card = new Card(context);
        card.setText(device.getName());
        card.setFootnote(device.getAddress());
        cards.add(card);
    }
}
 
开发者ID:corneliudascalu,项目名称:google-glass-share-barcode-bluetooth,代码行数:12,代码来源:DeviceCardScrollAdapter.java

示例14: setDevices

import com.google.android.glass.app.Card; //导入依赖的package包/类
public void setDevices(Context context, List<Device> devices) {
    this.devices = devices;
    cards.clear();
    for (Device device : devices) {
        Card card = new Card(context);
        card.setText(device.getName());
        card.setFootnote(device.getToken());
        cards.add(card);
    }
    notifyDataSetChanged();
}
 
开发者ID:corneliudascalu,项目名称:google-glass-share-barcode-bluetooth,代码行数:12,代码来源:DeviceCardAdapter.java

示例15: RootCardScrollAdapter

import com.google.android.glass.app.Card; //导入依赖的package包/类
public RootCardScrollAdapter(Context context, List<StoryModel> storyModels) {
	this.items = storyModels;
	
	cards = new ArrayList<Card>();
	for (StoryModel sm : storyModels) {
		Card card = new Card(context);
		card.setText(MessageFormat.format("{0} ({1}/{2})", sm.getTitle(), sm.getIndex()+1, storyModels.size()));
		card.setFootnote(R.string.select_story);
		card.setImageLayout(ImageLayout.FULL);
		cards.add(card);
	}
}
 
开发者ID:tomoto,项目名称:GlassNjslyr,代码行数:13,代码来源:RootActivity.java


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