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


Java CardScrollView.setOnItemClickListener方法代码示例

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


在下文中一共展示了CardScrollView.setOnItemClickListener方法的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
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

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

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

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

示例6: 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<>();
}
 
开发者ID:DDRBoxman,项目名称:Bluetooth-Manager-for-Glass,代码行数:23,代码来源:PairDevicesActivity.java

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

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

    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

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

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

示例11: 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);
    }
 
开发者ID:foxlee25,项目名称:Google-glass-Custom-layout,代码行数:33,代码来源:MainActivity.java

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

示例13: onCreate

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

	mGestureDetector = createGestureDetector(this);
	mCardScrollView = new CardScrollView(this);
	mCardScrollView.activate();
	mCardScrollView.setOnItemClickListener(this);
	setContentView(mCardScrollView);
}
 
开发者ID:RIVeR-Lab,项目名称:google_glass_driver,代码行数:11,代码来源:ViewRobotListActivity.java

示例14: onCreate

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

	mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

	mCardScrollView = new CardScrollView(this);
	mCardScrollView.activate();
	mCardScrollView.setOnItemClickListener(this);
	mApplication = ((RobotManagerApplication) this.getApplication());
	setContentView(mCardScrollView);
}
 
开发者ID:RIVeR-Lab,项目名称:google_glass_driver,代码行数:13,代码来源:BluetoothDevicesListActivity.java

示例15: onCreate

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

	mCardScrollView = new CardScrollView(this);
	mCardScrollView.activate();
	mCardScrollView.setOnItemClickListener(this);
	mApplication = ((RobotManagerApplication) this.getApplication());
	setContentView(mCardScrollView);
}
 
开发者ID:RIVeR-Lab,项目名称:google_glass_driver,代码行数:11,代码来源:MessageListActivity.java


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