本文整理汇总了Java中com.google.android.glass.widget.CardScrollView.setAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java CardScrollView.setAdapter方法的具体用法?Java CardScrollView.setAdapter怎么用?Java CardScrollView.setAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.glass.widget.CardScrollView
的用法示例。
在下文中一共展示了CardScrollView.setAdapter方法的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
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);
}
示例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();
}
示例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);
}
示例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");
}
示例6: 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);
}
示例7: 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);
}
示例8: 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);
}
示例9: 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;
}
示例10: 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);
}
示例11: 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);
}
示例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);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
mCardScroller = new CardScrollView(this);
mCards = new ArrayList<>();
getData();
mCardScroller.setAdapter(new CardAdapter(mCards));
setContentView(mCardScroller);
}
示例14: 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);
mAdapter = new CardAdapter(createCards(this));
mCardScroller = new CardScrollView(this);
mCardScroller.setAdapter(mAdapter);
setContentView(mCardScroller);
setCardScrollerListener();
initializeBeaconManager();
/* Instantiate a LocalizationClass and override necessary UI interfaces */
mLocalizationClass = new LocalizationClass(this) {
@Override
protected void updateLocalizationProgressUI(String foundPlaceId, String placeDescription) {
Log.i(TAG, "foundPlaceId: " + foundPlaceId);
mScanCard.setText(placeDescription);
mScanCard.setFootnote("Ort: " + foundPlaceId);
mAdapter.notifyDataSetChanged();
}
@Override
protected void notifyLocationChange(String priorPlaceId, String foundPlaceId) {
AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
am.playSoundEffect(Sounds.SUCCESS);
}
@Override
protected void showLocalizationProgressOutput() {
}
};
/* Localization starts right from start */
mLocalizationClass.startLocalization();
}
示例15: onCreate
import com.google.android.glass.widget.CardScrollView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
super.onCreate(bundle);
CardScrollAdapter mAdapter = new CardAdapter(createCards(this));
mCardScroller = new CardScrollView(this);
mCardScroller.setAdapter(mAdapter);
setContentView(mCardScroller);
setCardScrollerListener();
}