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


Java CardScrollView.setAdapter方法代码示例

本文整理汇总了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);
}
 
开发者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: 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

示例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);
}
 
开发者ID:longzheng,项目名称:PTVGlass,代码行数:24,代码来源:SetTimerActivity.java

示例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);
}
 
开发者ID:googleglass,项目名称:gdk-apidemo-sample,代码行数:22,代码来源:SliderActivity.java

示例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;
}
 
开发者ID:victorkp,项目名称:GlassWebNotes,代码行数:17,代码来源:MainActivity.java

示例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);
}
 
开发者ID:mimming,项目名称:gdk-sugar-glider,代码行数:20,代码来源:SetMapZoomActivity.java

示例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);
}
 
开发者ID:AlephNull0,项目名称:glass-movie-player,代码行数:21,代码来源:MovieBucketBrowserActivity.java

示例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);
}
 
开发者ID:jaredsburrows,项目名称:open-quartz,代码行数:17,代码来源:MemoScrollActivity.java

示例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);
}
 
开发者ID:gsi-upm,项目名称:Financial-Twitter-Tracker-Demo,代码行数:15,代码来源:MainActivity.java

示例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();
}
 
开发者ID:chenkel,项目名称:Lokalisierung-mit-Wearables,代码行数:37,代码来源:GlassLocalizationActivity.java

示例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();
}
 
开发者ID:chenkel,项目名称:Lokalisierung-mit-Wearables,代码行数:13,代码来源:MainGlassActivity.java


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