本文整理汇总了Java中com.google.android.glass.view.WindowUtils类的典型用法代码示例。如果您正苦于以下问题:Java WindowUtils类的具体用法?Java WindowUtils怎么用?Java WindowUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WindowUtils类属于com.google.android.glass.view包,在下文中一共展示了WindowUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreatePanelMenu
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS) {
if (_mode == OPERATION_MODE.MODE_PREVIEW) {
// the preview menu
getMenuInflater().inflate(R.menu.cam_menu, menu);
initializeOptionsMenu(menu);
} else {
// the post-preview menu
getMenuInflater().inflate(R.menu.taken_menu, menu);
}
// save for later usage
_menu = menu;
return true;
}
return super.onCreatePanelMenu(featureId, menu);
}
开发者ID:valerino,项目名称:VGCamera,代码行数:19,代码来源:MainActivity.java
示例2: onCreate
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
// ask for 'ok glass' prompt to accept commands
getWindow().requestFeature(WindowUtils.FEATURE_VOICE_COMMANDS);
_mode = OPERATION_MODE.MODE_PREVIEW;
// setup the layout
setupLayout();
// set the overlay labels if we're in overlay mode
setupOverlay();
// set touch/gestures detector, will be catched in onGenericMotionEvent() which, in turn,
// will use the gesture detector's listener logic to react.
_gestureDetector = new GestureDetector(this);
_gestureDetector.setBaseListener(this);
}
开发者ID:valerino,项目名称:VGCamera,代码行数:20,代码来源:MainActivity.java
示例3: onMenuItemSelected
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS) {
switch (item.getItemId()) {
case R.id.shareBluetooth:
CardPresenter cardPresenter = mCardPresenters
.get(mCardScrollView.getSelectedItemPosition());
if (cardPresenter != null) {
sendData(cardPresenter.getFooter());
}
return true;
case R.id.moreDetails:
sendItemPendingIntent(mCardScrollView.getSelectedItemPosition());
return true;
}
}
return super.onMenuItemSelected(featureId, item);
}
开发者ID:corneliudascalu,项目名称:google-glass-share-barcode-bluetooth,代码行数:19,代码来源:ResultsActivity.java
示例4: onMenuItemSelected
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS
|| featureId == Window.FEATURE_OPTIONS_PANEL) {
switch (item.getItemId()) {
case R.id.add_to_cart:
CardPresenter cardPresenter = mCardPresenters
.get(mCardScrollView.getSelectedItemPosition());
if (cardPresenter != null) {
sendData(cardPresenter.getFooter());
}
return true;
case R.id.try_again:
finish();
return true;
}
}
return super.onMenuItemSelected(featureId, item);
}
开发者ID:corneliudascalu,项目名称:google-glass-share-barcode-bluetooth,代码行数:20,代码来源:ResultsActivity.java
示例5: onCreate
import com.google.android.glass.view.WindowUtils; //导入依赖的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 );
}
开发者ID:coderoshi,项目名称:glass,代码行数:27,代码来源:MainActivity.java
示例6: onCreate
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
getWindow().requestFeature(WindowUtils.FEATURE_VOICE_COMMANDS);
setContentView(R.layout.activity_capture);
mImageManager = new ImageManager(this);
mHasSurface = false;
mInactivityTimer = new InactivityTimer(this);
mBeepManager = new BeepManager(this);
mAmbientLightManager = new AmbientLightManager(this);
mViewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
}
开发者ID:pt2121,项目名称:NYC-Glass-Challenge-Oct2014,代码行数:18,代码来源:CaptureActivity.java
示例7: onCreate
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
mView = buildView();
mTuggableView = new TuggableView(this, mView);
getWindow().requestFeature(WindowUtils.FEATURE_VOICE_COMMANDS);
setContentView(mTuggableView);
// TODO
DataEvent dataEvent = EventBus.getDefault().removeStickyEvent(DataEvent.class);
if (dataEvent != null && dataEvent.locs != null) {
for (Loc l : dataEvent.locs) {
Log.d(TAG, l.name);
}
}
ImageEvent imageEvent = EventBus.getDefault().removeStickyEvent(ImageEvent.class);
if (!TextUtils.isEmpty(imageEvent.filePath)) {
Log.d(TAG, imageEvent.filePath);
}
}
开发者ID:pt2121,项目名称:NYC-Glass-Challenge-Oct2014,代码行数:25,代码来源:MenuActivity.java
示例8: onMenuItemSelected
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS) {
switch (item.getItemId()) {
case R.id.menu_designer: mPicture = 0; break;
case R.id.menu_coder1: mPicture = 1; break;
case R.id.menu_coder2: mPicture = 2; break;
case R.id.menu_coder3: mPicture = 3; break;
case R.id.menu_coder4: mPicture = 4; break;
case R.id.menu_coder5: mPicture = 5; break;
case R.id.menu_product: mPicture = 6; break;
default: return true; // No change.
}
mCardScroller.setAdapter(new CardAdapter(createCards(this)));
return true;
}
return super.onMenuItemSelected(featureId, item);
}
开发者ID:googleglass,项目名称:gdk-apidemo-sample,代码行数:19,代码来源:VoiceMenuActivity.java
示例9: onPreparePanel
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS) {
MenuItem status = menu.findItem(R.id.status_view_option);
status.setVisible(currentSubview != NausicaaSubview.STATUS);
status.setEnabled(currentSubview != NausicaaSubview.STATUS);
MenuItem docking = menu.findItem(R.id.docking_view_option);
docking.setVisible(currentSubview != NausicaaSubview.DOCKING);
docking.setEnabled(currentSubview != NausicaaSubview.DOCKING);
return true;
}
return super.onPreparePanel(featureId, view, menu);
}
开发者ID:fixermark,项目名称:Nausicaa,代码行数:17,代码来源:MainActivity.java
示例10: onMenuItemSelected
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS) {
if (item.getItemId() == R.id.set_telemetry_source_option) {
Intent intent = new Intent(getBaseContext(), DataSourceActivity.class);
intent.putExtra(DATASOURCE_INTENT, telemachusAddress.getPath());
startActivityForResult(intent, 0);
}
if (item.getItemId() == R.id.toggle_time_scale_option) {
toggleStopTimeScalePreference();
}
if (item.getItemId() == R.id.docking_view_option) {
showSubview(NausicaaSubview.DOCKING);
}
if (item.getItemId() == R.id.status_view_option) {
showSubview(NausicaaSubview.STATUS);
}
}
return true;
}
开发者ID:fixermark,项目名称:Nausicaa,代码行数:22,代码来源:MainActivity.java
示例11: onCreate
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mFromLiveCardVoice = getIntent().getBooleanExtra(LiveCard.EXTRA_FROM_LIVECARD_VOICE, false);
if (mFromLiveCardVoice) {
// When activated by voice from a live card, enable voice commands. The menu
// will automatically "jump" ahead to the items (skipping the guard phrase
// that was already said at the live card).
getWindow().requestFeature(WindowUtils.FEATURE_VOICE_COMMANDS);
}
// Bind to the Timer service to retrive the current timer's data.
Intent serviceIntent = new Intent(this, TimerService.class);
serviceIntent.putExtra(
TimerService.EXTRA_TIMER_HASH_CODE,
getIntent().getIntExtra(TimerService.EXTRA_TIMER_HASH_CODE, 0));
serviceIntent.setData(getIntent().getData());
bindService(serviceIntent, mConnection, 0);
}
开发者ID:googleglass,项目名称:gdk-timer-sample,代码行数:21,代码来源:MenuActivity.java
示例12: onMenuItemSelected
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
/**
* here we react to specific voice commands to control the camera
*/
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS) {
if (_mode == OPERATION_MODE.MODE_PREVIEW) {
// handle the options menu
handleOptionsMenu(item.getItemId());
} else {
// handle the taken menu
handleTakenMenu(item.getItemId());
}
return true;
}
return super.onMenuItemSelected(featureId, item);
}
开发者ID:valerino,项目名称:VGCamera,代码行数:18,代码来源:MainActivity.java
示例13: onCreate
import com.google.android.glass.view.WindowUtils; //导入依赖的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);
}
开发者ID:corneliudascalu,项目名称:google-glass-share-barcode-bluetooth,代码行数:31,代码来源:ResultsActivity.java
示例14: onCreatePanelMenu
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS) {
getMenuInflater().inflate(R.menu.share_bt_menu, menu);
return true;
}
return super.onCreatePanelMenu(featureId, menu);
}
开发者ID:corneliudascalu,项目名称:google-glass-share-barcode-bluetooth,代码行数:9,代码来源:ResultsActivity.java
示例15: onCreatePanelMenu
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS) {
getMenuInflater().inflate(R.menu.share_menu, menu);
return true;
}
return super.onCreatePanelMenu(featureId, menu);
}
开发者ID:corneliudascalu,项目名称:google-glass-share-barcode-bluetooth,代码行数:9,代码来源:ResultsActivity.java
示例16: onCreatePanelMenu
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
// START:onCreatePanelMenu
public boolean onCreatePanelMenu(int featureId, Menu menu) {
if( featureId == WindowUtils.FEATURE_VOICE_COMMANDS ||
featureId == Window.FEATURE_OPTIONS_PANEL ) {
getMenuInflater().inflate( R.menu.main, menu );
return true;
}
return false;
}
开发者ID:coderoshi,项目名称:glass,代码行数:11,代码来源:MainActivity.java
示例17: onCreatePanelMenu
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS ||
featureId == Window.FEATURE_OPTIONS_PANEL) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
return super.onCreatePanelMenu(featureId, menu);
}
开发者ID:pt2121,项目名称:NYC-Glass-Challenge-Oct2014,代码行数:10,代码来源:CaptureActivity.java
示例18: onMenuItemSelected
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS ||
featureId == Window.FEATURE_OPTIONS_PANEL) {
switch (item.getItemId()) {
case R.id.plastic_menu_item:
startResultActivity(ITEM_METAL_GLASS_PLASTIC);
break;
case R.id.metal_menu_item:
startResultActivity(ITEM_METAL_GLASS_PLASTIC);
break;
case R.id.glass_menu_item:
startResultActivity(ITEM_METAL_GLASS_PLASTIC);
break;
case R.id.paper_menu_item:
startResultActivity(ITEM_PAPER);
break;
case R.id.special_waste_menu_item:
startResultActivity(ITEM_SPECIAL_WASTE);
break;
default:
return true;
}
return true;
}
return super.onMenuItemSelected(featureId, item);
}
开发者ID:pt2121,项目名称:NYC-Glass-Challenge-Oct2014,代码行数:28,代码来源:CaptureActivity.java
示例19: onMenuItemSelected
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS ||
featureId == Window.FEATURE_OPTIONS_PANEL) {
switch (item.getItemId()) {
case R.id.special_waste_menu_item:
break;
default:
return true;
}
return true;
}
return super.onMenuItemSelected(featureId, item);
}
开发者ID:pt2121,项目名称:NYC-Glass-Challenge-Oct2014,代码行数:15,代码来源:MenuActivity.java
示例20: onCreate
import com.google.android.glass.view.WindowUtils; //导入依赖的package包/类
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
// Requests a voice menu on this activity. As for any other window feature,
// be sure to request this before setContentView() is called
getWindow().requestFeature(WindowUtils.FEATURE_VOICE_COMMANDS);
// Ensure screen stays on during demo.
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
// Sets up a singleton card scroller as content of this activity. Clicking
// on the card toggles the voice menu on and off.
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);
// Toggles voice menu. Invalidates menu to flag change.
mVoiceMenuEnabled = !mVoiceMenuEnabled;
getWindow().invalidatePanelMenu(WindowUtils.FEATURE_VOICE_COMMANDS);
}
});
setContentView(mCardScroller);
}
开发者ID:googleglass,项目名称:gdk-apidemo-sample,代码行数:29,代码来源:VoiceMenuActivity.java
注:本文中的com.google.android.glass.view.WindowUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论