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


Java CardScrollView类代码示例

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


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

示例1: createView

import com.google.android.glass.widget.CardScrollView; //导入依赖的package包/类
private void createView() {
    CardScrollView mCardScrollView = new CardScrollView(this);
    MyCardScrollAdapter mAdapter = new MyCardScrollAdapter();
    mCardScrollView.setAdapter(mAdapter);
    mCardScrollView.activate();

    mCardScrollView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            AudioManager audio = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
            audio.playSoundEffect(Sounds.TAP);
            if (invalid)
                finish();
            else
                openOptionsMenu();
        }
    });
    setContentView(mCardScrollView);
}
 
开发者ID:chenkel,项目名称:Lokalisierung-mit-Wearables,代码行数:20,代码来源:MainActivity.java

示例2: onCreate

import com.google.android.glass.widget.CardScrollView; //导入依赖的package包/类
@Override
public void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    mCardScroller = new CardScrollView(this);
    mCardScroller.setAdapter(new CardAdapter(createCards(this)));
    setContentView(mCardScroller);
    setCardScrollerListener();
    /**
     * The Measure Class gets instantiated and the
     * UI interface {@link MeasureClass#updateMeasurementsCount()}
     * gets ignored, since it is not relevant for Google Glass
     */
    mMeasureClass = new MeasureClass(this){
        @Override
        public void updateMeasurementsCount() {}
    };

    mAverageMeasuresClass = new AverageMeasuresClass(this);
}
 
开发者ID:chenkel,项目名称:Lokalisierung-mit-Wearables,代码行数:21,代码来源:WiFiBleActivity.java

示例3: onCreate

import com.google.android.glass.widget.CardScrollView; //导入依赖的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

示例4: onCreate

import com.google.android.glass.widget.CardScrollView; //导入依赖的package包/类
@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), getBaseContext()));
    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);
}
 
开发者ID:scheah,项目名称:eulexia,代码行数:22,代码来源:SliderActivity.java

示例5: onCreate

import com.google.android.glass.widget.CardScrollView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    // get data from OCRActivity
    Bundle b = getIntent().getExtras();

    allWords = b.getStringArrayList("ocrResults");

    mAdapter = new CardAdapter(createCards(this), getBaseContext(), allWords);
    mCardScroller = new CardScrollView(this);
    mCardScroller.setAdapter(mAdapter);
    setContentView(mCardScroller);
    setCardScrollerListener();
    mSpellChecker = SpellCheck.getInstance(getApplicationContext());
    Log.d(TAG, "Done loading Jazzy");
}
 
开发者ID:scheah,项目名称:eulexia,代码行数:18,代码来源:SpellcheckActivity.java

示例6: onCreate

import com.google.android.glass.widget.CardScrollView; //导入依赖的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

示例7: onCreate

import com.google.android.glass.widget.CardScrollView; //导入依赖的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

示例8: createView

import com.google.android.glass.widget.CardScrollView; //导入依赖的package包/类
void createView() {
    mCardScrollView = new CardScrollView(this);
    mAdapter = new MyCardScrollAdapter();
    mCardScrollView.setAdapter(mAdapter);
    mCardScrollView.activate();

    mCardScrollView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            AudioManager audio = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
            audio.playSoundEffect(Sounds.TAP);
            if (invalid)
                finish();
            else
                openOptionsMenu();
        }
    });
    setContentView(mCardScrollView);
}
 
开发者ID:jaxbot,项目名称:glass-qrlens,代码行数:20,代码来源:MainActivity.java

示例9: onCreate

import com.google.android.glass.widget.CardScrollView; //导入依赖的package包/类
@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);
}
 
开发者ID:googleglass,项目名称:gdk-apidemo-sample,代码行数:22,代码来源:SliderActivity.java

示例10: displayNotes

import com.google.android.glass.widget.CardScrollView; //导入依赖的package包/类
private void displayNotes(String notes){
	mScrollView = new CardScrollView(this);
	
	// Create the adapter and set it, allow interaction
	mAdapter = new NoteAdapter(this, notes);
	mScrollView.setAdapter(mAdapter);

	// Set the OnClickListener
	mScrollView.setOnItemClickListener(this);

	// Show the CardScrollView
	mScrollView.activate();
	setContentView(mScrollView);

	mNotesShown = true;
}
 
开发者ID:victorkp,项目名称:GlassWebNotes,代码行数:17,代码来源:MainActivity.java

示例11: onCreate

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

    mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

    mView = new CardScrollView(this) {
        @Override
        public final boolean dispatchGenericFocusedEvent(MotionEvent event) {
            if (mDetector.onMotionEvent(event)) {
                return true;
            }
            return super.dispatchGenericFocusedEvent(event);
        }
    };
    mView.setHorizontalScrollBarEnabled(true);
    setAdapter(mView);
    setContentView(mView);

    mDetector = new GestureDetector(this).setBaseListener(this);
}
 
开发者ID:longzheng,项目名称:PTVGlass,代码行数:22,代码来源:BaseScrollActivity.java

示例12: onCreate

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

    mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

    mAdapter = new SelectValueScrollAdapter(
            this, getIntent().getIntExtra(EXTRA_COUNT, DEFAULT_COUNT));

    mView = new CardScrollView(this) {
        @Override
        public final boolean dispatchGenericFocusedEvent(MotionEvent event) {
            if (mDetector.onMotionEvent(event)) {
                return true;
            }
            return super.dispatchGenericFocusedEvent(event);
        }
    };
    mView.setAdapter(mAdapter);
    setContentView(mView);

    mDetector = new GestureDetector(this).setBaseListener(this);
}
 
开发者ID:longzheng,项目名称:PTVGlass,代码行数:24,代码来源:SelectValueActivity.java

示例13: onCreate

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

    mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);

    mAdapter = new SetTimerScrollAdapter(this);
    mAdapter.setDurationMillis(getIntent().getLongExtra(EXTRA_DURATION_MILLIS, 0));

    mView = new CardScrollView(this) {
        @Override
        public final boolean dispatchGenericFocusedEvent(MotionEvent event) {
            if (mDetector.onMotionEvent(event)) {
                return true;
            }
            return super.dispatchGenericFocusedEvent(event);
        }
    };
    mView.setAdapter(mAdapter);
    setContentView(mView);

    mDetector = new GestureDetector(this).setBaseListener(this);
}
 
开发者ID:longzheng,项目名称:PTVGlass,代码行数:24,代码来源:SetTimerActivity.java

示例14: onCreate

import com.google.android.glass.widget.CardScrollView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mMapImageManager = MapImageManager.getInstance();

    mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
    mDetector = new GestureDetector(SetMapZoomActivity.this).setBaseListener(mBaseListener);

    mCardScrollView = new CardScrollView(SetMapZoomActivity.this) {
        @Override
        public final boolean dispatchGenericFocusedEvent(MotionEvent event) {
            return mDetector.onMotionEvent(event) ||
                    super.dispatchGenericFocusedEvent(event);
        }
    };

    SetMapZoomScrollAdapter adapter = new SetMapZoomScrollAdapter();
    mCardScrollView.setAdapter(adapter);
}
 
开发者ID:mimming,项目名称:gdk-sugar-glider,代码行数:20,代码来源:SetMapZoomActivity.java

示例15: onCreate

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

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

    mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

    IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);
    registerReceiver(mReceiver, filter);
    Log.d("onCreate", "Got default BT adapter and registered receiver.");

    mBluetoothAdapter.startDiscovery();
    Log.d("onCreate", "Started BT discovery...");

    mCardScrollView = new CardScrollView(this);
    mCardScrollView.activate();
    mCardScrollView.setOnItemClickListener(this);
    setContentView(mCardScrollView);

    mDevices = new ArrayList<>();
}
 
开发者ID:DDRBoxman,项目名称:Bluetooth-Manager-for-Glass,代码行数:23,代码来源:PairDevicesActivity.java


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