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