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


Java CardBuilder类代码示例

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


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

示例1: createCards

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
/**
 * Creates list of cards serving as the menu for the user.
 <p>
 * First, the card for the QR code method.
 * Second, the card for the combined localization method (WiFi + BLE Beacons).
 *
 * @param context The application context
 * @return list with Cards
 */
private List<CardBuilder> createCards(Context context) {
    ArrayList<CardBuilder> cards = new ArrayList<>();

    cards.add(new CardBuilder(context, CardBuilder.Layout.COLUMNS)
            .setText(getString(R.string.qr_code_localization))
            .setIcon(R.drawable.ic_qr_code)
            .setFootnote(R.string.qr_code_footnote));

    cards.add(new CardBuilder(context, CardBuilder.Layout.COLUMNS)
            .setText(getString(R.string.wifi_ble_localization))
            .setIcon(R.drawable.ic_wifi_ble)
            .setFootnote(R.string.wifi_ble_footnote));

    return cards;
}
 
开发者ID:chenkel,项目名称:Lokalisierung-mit-Wearables,代码行数:25,代码来源:MainGlassActivity.java

示例2: onCreate

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

    // create the adapter
    ScrollerAdapter adapter = new ScrollerAdapter();

    // create each card
    adapter.cards().add(new CardBuilder(this, CardBuilder.Layout.MENU).setText("Save").setFootnote("Save taken photo/video"));
    adapter.cards().add(new CardBuilder(this, CardBuilder.Layout.MENU).setText("Discard").setFootnote("Discard taken photo/video"));
    adapter.cards().add(new CardBuilder(this, CardBuilder.Layout.MENU).setText("Share").setFootnote("Share taken photo/video"));

    // setup the view
    _view  = new CardScrollView(this);
    _view.setAdapter(adapter);
    _view.activate();
    setContentView(_view);
    setOnClickListener();
}
 
开发者ID:valerino,项目名称:VGCamera,代码行数:20,代码来源:TakenScroller.java

示例3: getView

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
/**
 * Returns the view for the relevant position
 * If it is 0 then it is the title card
 * Otherwise it is one of the results
 * If the string for the results is our constant BEGIN_REVIEWS
 * then display the REVIEWS title card
 *
 * @param position position of the View to return in the CardScrollView
 * @param convertView
 * @param parent
 * @return the View to display
 */
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    CardBuilder card;
    if (position == 0) {
        card = new CardBuilder(mContext, CardBuilder.Layout.MENU)
                .setText(mTitle)
                .setFootnote("by " + mAuthor);
    } else if (mItems.get(position - 1).equals("BEGIN_REVIEWS")) {
        card = new CardBuilder(mContext, CardBuilder.Layout.MENU)
                .setText("REVIEWS");
    } else {
        card = new CardBuilder(mContext, CardBuilder.Layout.TEXT)
                .setText(mItems.get(position - 1))
                .setFootnote(mTitle)
                .setTimestamp(mAuthor);
    }
    View view = card.getView(convertView, parent);

    return view;
}
 
开发者ID:raahilshah,项目名称:ProjectKilo,代码行数:33,代码来源:ResultsCardScrollAdapter.java

示例4: createCards

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
/**
 * Create list of misspelled words.
 */
private List<CardBuilder> createCards(Context context) {
    ArrayList<CardBuilder> cards = new ArrayList<CardBuilder>();
    int i = 0;
    mSpellChecker = SpellCheck.getInstance(context);
    for(String word : allWords) {
        if (mSpellChecker.wordMisspelled(word)) {
            msWords.add(word);
            Log.d(TAG, "Misspelled word is " + word);
            cards.add(i, new CardBuilder(context, CardBuilder.Layout.MENU)
                    //  .setEmbeddedLayout(R.layout.main_view)
                    .setText(word)
                    .setFootnote(R.string.misspelled_card_menu_description));
            i++;
        }
    }
    return cards;
}
 
开发者ID:scheah,项目名称:eulexia,代码行数:21,代码来源:SpellcheckActivity.java

示例5: buildView

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
/**
 * Builds a Glass styled "Hello World!" view using the {@link CardBuilder} class.
 */
private View buildView() {
 //   Drawable mtitle = getResources().getDrawable(R.drawable.titlemoon);
    View view = new CardBuilder(getApplicationContext(), CardBuilder.Layout.MENU)
   //         .addImage(mtitle)
            .setIcon(R.drawable.ic_spellcheck)
            .setText(R.string.title_activity_ocr)
            .setFootnote(R.string.ocr_menu_description)
            .getView();

    return view;

    /*View view = new CardBuilder(this, CardBuilder.Layout.EMBED_INSIDE)
            .setEmbeddedLayout(R.layout.main_view)
            .getView();

    TextView textView1 = (TextView) view.findViewById(R.id.textView);
    Typeface tf = Typeface.createFromAsset(getAssets(),
            "fonts/Calibri.ttf");
    textView1.setTypeface(tf);
    textView1.setText("Swipe forward to take a picture");

    return view;*/
}
 
开发者ID:scheah,项目名称:eulexia,代码行数:27,代码来源:OCRActivity.java

示例6: onCreate

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
@Override
// START:onCreate
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // END:onCreate
    getWindow().requestFeature( WindowUtils.FEATURE_VOICE_COMMANDS );
    // START:onCreate
    setupManagers();
    mNotes = new NoteList( this );
    mCards = new ArrayList<>();
    for( Note note : mNotes ) {
        addNoteCardToAdapter( note );
    }
    // END:onCreate
    if( mEmptyCardsList ) {
        mCards.add( new CardBuilder(this, Layout.TEXT).setText("[tap to add a note]") );
    }
    // START:onCreate
    mAdapter = new NotesScrollAdapter();
    mAdapter.notifyDataSetChanged();
    mScrollView = new CardScrollView( this );
    mScrollView.setAdapter( mAdapter );
    mScrollView.setHorizontalScrollBarEnabled( true );
    mScrollView.activate();
    setContentView( mScrollView );
}
 
开发者ID:coderoshi,项目名称:glass,代码行数:27,代码来源:MainActivity.java

示例7: AlertDialog

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
public AlertDialog(Context context, int iconResId,
                   int textResId, int footnoteResId,
                   DialogInterface.OnClickListener onClickListener) {
    super(context);

    mOnClickListener = onClickListener;
    mAudioManager =
            (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    mGestureDetector =
            new GestureDetector(context).setBaseListener(mBaseListener);

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setContentView(new CardBuilder(context, CardBuilder.Layout.ALERT)
            .setIcon(iconResId)
            .setText(textResId)
            .setFootnote(footnoteResId)
            .getView());
}
 
开发者ID:GlassTune,项目名称:GlassTune,代码行数:20,代码来源:AlertDialog.java

示例8: createCards

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
private void createCards(List<Loc> locs) {
    for (Loc loc : locs) {
        String path = (TextUtils.isEmpty(loc.image)) ?
                "" :
                FileUtil.getCacheFilePath(this, loc.image);
        CardBuilder builder = new CardBuilder(this, CardBuilder.Layout.COLUMNS)
                .setText(loc.name)
                .setFootnote(loc.address);
        if (TextUtils.isEmpty(path)) {
            builder.addImage(mDrawable);
        } else {
            builder.addImage(Drawable.createFromPath(path));
        }
        mCards.add(builder);
    }
}
 
开发者ID:pt2121,项目名称:NYC-Glass-Challenge-Oct2014,代码行数:17,代码来源:ResultActivity.java

示例9: setupAdapter

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
/**
 * Sets up adapter.
 */
private void setupAdapter() {
    mAdapter = new CardAdapterWithMutations();

    // Insert initial cards, one of each kind.
    for (int i = 0; i < 8; i++) {
        int position = i;
        Action action = Action.values()[i];
        CardBuilder card = new CardBuilder(this, CardBuilder.Layout.COLUMNS);
        card.setText(action.textId).addImage(action.imageId);
        mAdapter.insertCardWithoutNotification(position, card, action);
    }

    // Setting adapter notifies the card scroller of new content.
    mCardScroller.setAdapter(mAdapter);
}
 
开发者ID:googleglass,项目名称:gdk-apidemo-sample,代码行数:19,代码来源:CardScrollViewActivity.java

示例10: createCards

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
/**
 * Create list of API demo cards.
 */
private List<CardBuilder> createCards(Context context) {
    ArrayList<CardBuilder> cards = new ArrayList<CardBuilder>();
    cards.add(CARD_BUILDER, new CardBuilder(context, CardBuilder.Layout.TEXT)
            .setText(R.string.text_card_builder));
    cards.add(CARD_BUILDER_EMBEDDED_LAYOUT, new CardBuilder(context, CardBuilder.Layout.TEXT)
            .setText(R.string.text_card_builder_embedded_layout));
    cards.add(CARD_SCROLL_VIEW, new CardBuilder(context, CardBuilder.Layout.TEXT)
            .setText(R.string.text_card_scroll_view));
    cards.add(GESTURE_DETECTOR, new CardBuilder(context, CardBuilder.Layout.TEXT)
            .setText(R.string.text_gesture_detector));
    cards.add(TEXT_APPEARANCE, new CardBuilder(context, CardBuilder.Layout.TEXT)
            .setText(R.string.text_text_appearance));
    cards.add(OPENGL, new CardBuilder(context, CardBuilder.Layout.TEXT)
            .setText(R.string.text_opengl));
    cards.add(VOICE_MENU, new CardBuilder(context, CardBuilder.Layout.TEXT)
            .setText(R.string.text_voice_menu));
    cards.add(SLIDER, new CardBuilder(context, CardBuilder.Layout.TEXT)
            .setText(R.string.text_slider));
    return cards;
}
 
开发者ID:googleglass,项目名称:gdk-apidemo-sample,代码行数:24,代码来源:ApiDemoActivity.java

示例11: showError

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
private void showError(String error) {
    mCards = new ArrayList<>();
    mCards.add(new CardBuilder(this, CardBuilder.Layout.ALERT)
                    .setIcon(R.drawable.ic_alert)
                    .setText(error)
                    .setFootnote(R.string.tap_to_try_again)
    );
    invalid = true;

    AudioManager audio = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    audio.playSoundEffect(Sounds.ERROR);
}
 
开发者ID:chenkel,项目名称:Lokalisierung-mit-Wearables,代码行数:13,代码来源:MainActivity.java

示例12: createCards

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
private void createCards(String data) {
    mCardData = data;
    mCards = new ArrayList<>();

    if (data.length() > 200 || data.split("\n").length > 7)
        mNeedsReadMore = true;

    String FOOTER = "QR text content";
    mCards.add(new CardBuilder(this, CardBuilder.Layout.TEXT)
        .setText(data)
        .setFootnote(FOOTER)
    );

}
 
开发者ID:chenkel,项目名称:Lokalisierung-mit-Wearables,代码行数:15,代码来源:MainActivity.java

示例13: createCards

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
/**
 * Create Localization progress card.
 * @param context The application context
 * @return list with Cards
 */
private List<CardBuilder> createCards(Context context) {
    ArrayList<CardBuilder> cards = new ArrayList<>();
    mScanCard = new CardBuilder(context, CardBuilder.Layout.TEXT)
            .setText("Scanne die Umgebung")
            .setFootnote("einen Moment noch...");
    cards.add(CARD_STATUS, mScanCard);
    return cards;
}
 
开发者ID:chenkel,项目名称:Lokalisierung-mit-Wearables,代码行数:14,代码来源:GlassLocalizationActivity.java

示例14: onCreate

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

    // create the adapter
    ScrollerAdapter adapter = new ScrollerAdapter();

    // create each card
    final String on = " ON";
    final String off = " OFF";
    String s = "Overlay" + (AppConfiguration.instance(this).overlayMode() == AppConfiguration.OVERLAY_MODE.SHOW_OVERLAY ? off : on);
    adapter.cards().add(new CardBuilder(this, CardBuilder.Layout.MENU).setText(s).setFootnote("Toggle overlay on/off"));
    s = "Quality" + (AppConfiguration.instance(this).quality() == AppConfiguration.QUALITY.HIGH ? " LOW" : " HIGH");
    adapter.cards().add(new CardBuilder(this, CardBuilder.Layout.MENU).setText(s).setFootnote("Toggle capture lo/hi quality"));
    s = "Geotagging" + (AppConfiguration.instance(this).geoTagging() ? off : on);
    adapter.cards().add(new CardBuilder(this, CardBuilder.Layout.MENU).setText(s).setFootnote("Toggle geotagging on/off"));
    s = "Autosave" + (AppConfiguration.instance(this).autoSave() ? off : on);
    adapter.cards().add(new CardBuilder(this, CardBuilder.Layout.MENU).setText(s).setFootnote("Toggle autosave on/off"));
    s = "Max-Zoom" + (AppConfiguration.instance(this).maxZoomMode() ? off : on);
    adapter.cards().add(new CardBuilder(this, CardBuilder.Layout.MENU).setText(s).setFootnote("Toggle max zoom on/off"));
    s = "Smooth-Zoom" + (AppConfiguration.instance(this).smoothZoom() ? off : on);
    adapter.cards().add(new CardBuilder(this, CardBuilder.Layout.MENU).setText(s).setFootnote("Toggle smooth zoom on/off"));
    s = "Reset zoom";
    adapter.cards().add(new CardBuilder(this, CardBuilder.Layout.MENU).setText(s).setFootnote("Reset zoom level"));

    // setup the view
    _view = new CardScrollView(this);
    _view.setAdapter(adapter);
    _view.activate();
    setContentView(_view);
    setOnClickListener();
}
 
开发者ID:valerino,项目名称:VGCamera,代码行数:33,代码来源:OptionsScroller.java

示例15: onCreate

import com.google.android.glass.widget.CardBuilder; //导入依赖的package包/类
/**
 * Sets up the View and initialises the Slider
 *
 * @param bundle
 */
@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);

    // Create the cards for the view
    mScanFailed = new CardBuilder(this, CardBuilder.Layout.MENU).setText("Scan Failed").setFootnote("Returning to Scanner").getView();
    mSlider = Slider.from(mScanFailed);

    setContentView(mScanFailed);
}
 
开发者ID:raahilshah,项目名称:ProjectKilo,代码行数:16,代码来源:ScanFailureActivity.java


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