Search in sources :

Example 1 with CardScrollView

use of com.google.android.glass.widget.CardScrollView in project gdk-apidemo-sample by googleglass.

the class SliderActivity method onCreate.

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    // Ensure screen stays on during demo.
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    mCardScroller = new CardScrollView(this);
    mCardScroller.setAdapter(new CardAdapter(createCards(this)));
    mCardScroller.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            // Plays sound.
            AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
            am.playSoundEffect(Sounds.TAP);
            processSliderRequest(position);
        }
    });
    setContentView(mCardScroller);
    mSlider = Slider.from(mCardScroller);
}
Also used : AudioManager(android.media.AudioManager) CardScrollView(com.google.android.glass.widget.CardScrollView) AdapterView(android.widget.AdapterView) CardAdapter(com.google.android.glass.sample.apidemo.card.CardAdapter) CardScrollView(com.google.android.glass.widget.CardScrollView) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 2 with CardScrollView

use of com.google.android.glass.widget.CardScrollView in project gdk-apidemo-sample by googleglass.

the class TextAppearanceActivity method onCreate.

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    mCardScroller = new CardScrollView(this);
    mCardScroller.setAdapter(new TextAppearanceAdapter(this));
    setContentView(mCardScroller);
}
Also used : CardScrollView(com.google.android.glass.widget.CardScrollView)

Example 3 with CardScrollView

use of com.google.android.glass.widget.CardScrollView in project gdk-apidemo-sample by googleglass.

the class ApiDemoActivity method onCreate.

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    mAdapter = new CardAdapter(createCards(this));
    mCardScroller = new CardScrollView(this);
    mCardScroller.setAdapter(mAdapter);
    setContentView(mCardScroller);
    setCardScrollerListener();
}
Also used : CardScrollView(com.google.android.glass.widget.CardScrollView) CardAdapter(com.google.android.glass.sample.apidemo.card.CardAdapter)

Example 4 with CardScrollView

use of com.google.android.glass.widget.CardScrollView in project gdk-apidemo-sample by googleglass.

the class CardBuilderActivity method onCreate.

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    mCardScroller = new CardScrollView(this);
    mCardScroller.setAdapter(new CardAdapter(createCards(this)));
    setContentView(mCardScroller);
}
Also used : CardScrollView(com.google.android.glass.widget.CardScrollView)

Example 5 with CardScrollView

use of com.google.android.glass.widget.CardScrollView in project gdk-apidemo-sample by googleglass.

the class CardScrollViewActivity method onCreate.

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    mCardScroller = new CardScrollView(this);
    setupAdapter();
    setupClickListener();
    setContentView(mCardScroller);
}
Also used : CardScrollView(com.google.android.glass.widget.CardScrollView)

Aggregations

CardScrollView (com.google.android.glass.widget.CardScrollView)9 CardAdapter (com.google.android.glass.sample.apidemo.card.CardAdapter)4 AudioManager (android.media.AudioManager)2 View (android.view.View)2 AdapterView (android.widget.AdapterView)2 PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1