本文整理汇总了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 );
}
示例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);
}
示例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<>();
}
示例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<>();
}
示例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);
}
示例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);
}
示例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);
}