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


Java CardScrollView.setHorizontalScrollBarEnabled方法代码示例

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


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

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

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

示例3: 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();
    Log.d("onCreate", "Got default BT adapter.");

    mBluetoothAdapter.startLeScan(this);
    Log.d("onCreate", "Started BTLE discovery...");

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

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

示例4: 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);

    mBluetoothManager = (BluetoothManager)getSystemService(BLUETOOTH_SERVICE);
    mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

    mBleDeviceAddress = getIntent().getStringExtra(EXTRA_DEVICE_ADDRESS);
    connect(mBleDeviceAddress, mBroadcastGattCallback);

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

    mServices = new ArrayList<>();
}
 
开发者ID:DDRBoxman,项目名称:Bluetooth-Manager-for-Glass,代码行数:21,代码来源:BleServicesActivity.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);

    createCards();

    scrollView = new CardScrollView(this);
    scrollView.setAdapter(new SettingsAdapter());
    scrollView.setHorizontalScrollBarEnabled(true);
    scrollView.setOnItemClickListener(this);
    setContentView(scrollView);
}
 
开发者ID:a-paxton,项目名称:PsyGlass,代码行数:14,代码来源:SettingsActivity.java

示例6: onCreate

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

    mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
    CharadesModel model = (CharadesModel) getIntent().getSerializableExtra(EXTRA_MODEL);

    mCardMargin = (int) getResources().getDimension(R.dimen.card_margin);

    mCardScroller = new CardScrollView(this);
    mCardScroller.setHorizontalScrollBarEnabled(true);
    mCardScroller.setAdapter(
            new CharadesResultsAdapter(getLayoutInflater(), getResources(), model));
    mCardScroller.setOnItemClickListener(mOnClickListener);
    mCardScroller.activate();
    setContentView(mCardScroller);

    // Initialize the sound pool and play the losing or winning sound immediately once it has
    // been loaded.
    mSoundPool = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
    mSoundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
        @Override
        public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
            soundPool.play(sampleId, 1.0f, 1.0f, 0, 0, 1.0f);
        }
    });
    int soundResId = model.areAllPhrasesGuessedCorrectly() ?
            R.raw.triumph : R.raw.sad_trombone;
    mSoundPool.load(this, soundResId, 0);
}
 
开发者ID:locateflow,项目名称:gdk-charades-sample-master,代码行数:31,代码来源:GameResultsActivity.java

示例7: onCreate

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

    Intent intent = getIntent();

    if (intent != null && intent.getExtras() != null) {

        results = (Summary) intent.getExtras().getSerializable(EXTRA_RESULT_SERIAL);

    } else results = null;

    mCardScroller = new CardScrollView(this);
    mCardScroller.setAdapter(new ResultsCardScrollAdapter(
            this, results.getText(), results.getTitle(), results.getAuthors().get(0)));

    mCardScroller.setHorizontalScrollBarEnabled(false);

    MAX_SLIDER_VALUE = mCardScroller.getAdapter().getCount() - 1;

    mSlider = Slider.from(mCardScroller);

    startAnimation();

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


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