本文整理汇总了Java中com.google.android.glass.widget.CardScrollView.activate方法的典型用法代码示例。如果您正苦于以下问题:Java CardScrollView.activate方法的具体用法?Java CardScrollView.activate怎么用?Java CardScrollView.activate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.glass.widget.CardScrollView
的用法示例。
在下文中一共展示了CardScrollView.activate方法的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);
}
示例2: 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();
}
示例3: 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);
}
示例4: 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 );
}
示例5: 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);
}
示例6: 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;
}
示例7: 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<>();
}
示例8: 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<>();
}
示例9: 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<>();
}
示例10: onCreate
import com.google.android.glass.widget.CardScrollView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_movie_picker);
mLength = -1;
mCardScrollView = (CardScrollView)findViewById(R.id.list);
mEmptyMessage = findViewById(R.id.empty);
mCardScrollView.setOnItemClickListener(mItemClickListener);
getLoaderManager().initLoader(URL_LOADER, null, this);
mCardScrollView.activate();
mMovieBuckets = new ArrayList<MovieBucket>();
mAdapter = new MovieBucketAdapter(this, mMovieBuckets);
mCardScrollView.setAdapter(mAdapter);
}
示例11: onCreate
import com.google.android.glass.widget.CardScrollView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_movie_picker);
mLength = -1;
mList = (CardScrollView)findViewById(R.id.list);
mEmptyMessage = findViewById(R.id.empty);
mDeleteProgress = (ProgressBar)findViewById(R.id.progress);
mList.setOnItemClickListener(mItemClickListener);
getLoaderManager().initLoader(URL_LOADER, null, this);
mList.activate();
}
示例12: onCreate
import com.google.android.glass.widget.CardScrollView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//Create the cards to be used in the CardScrollView
createCards();
//Set up the gesture recognizer
openMenuGesture = createGestureDetector(this);
//Create the the CardScrollView
mCardScrollView = new CardScrollView(this);
//Create the adapter for the cardscoll
adapter = new MemoScrollAdapter(mCards);
mCardScrollView.setAdapter(adapter);
mCardScrollView.activate();
setContentView(mCardScrollView);
}
示例13: 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
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();
}
示例14: onCreate
import com.google.android.glass.widget.CardScrollView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
//init custom view
mView1 = new MyView(this,R.layout.firstlayout);
// mView2 = new MySecondView(this);
mView2 = new MyView(this,R.layout.secondlayout);
//add views to arraylist
arrayList = new ArrayList<View>();
arrayList.add(mView1);
arrayList.add(mView2);
//set my custom adapter
myAdapter = new MyAdapter(arrayList);
mCardScroller = new CardScrollView(this);
mCardScroller.setAdapter(myAdapter);
mCardScroller.activate();
// Handle the TAP event.
mCardScroller.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// Plays disallowed sound to indicate that TAP actions are not supported.
AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
am.playSoundEffect(Sounds.DISALLOWED);
}
});
setContentView(mCardScroller);
}
示例15: onCreate
import com.google.android.glass.widget.CardScrollView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(WindowUtils.FEATURE_VOICE_COMMANDS);
Intent intent = getIntent();
if (savedInstanceState != null) {
readExtras(intent.getExtras());
} else if (intent != null && intent.getExtras() != null) {
readExtras(intent.getExtras());
} else {
Log.e(TAG, "No extras were present");
finish();
return;
}
if (mCardPresenters.size() == 0) {
Log.w(TAG, "There were no cards to display");
finish();
return;
}
mCardScrollView = new CardScrollView(this);
mCardScrollView.setAdapter(new CardScrollViewAdapter(this,
mCardPresenters));
mCardScrollView.activate();
setContentView(mCardScrollView);
}