/** Used to control the user settings shown when registered. */ private void updateUserControlMenuItems() { if (mService == null || mService.getCurrentUser() == null || userRegisterItem == null || userCommentItem == null || userInformationItem == null) return; boolean userRegistered = mService.getCurrentUser().isRegistered; userRegisterItem.setEnabled(!userRegistered); userCommentItem.setEnabled(userRegistered); userInformationItem.setEnabled(userRegistered); }
@TargetApi(Build.VERSION_CODES.FROYO) @Override public boolean onCreateOptionsMenu(Menu menu) { getSupportMenuInflater().inflate(R.menu.activity_channel, menu); searchItem = menu.findItem(R.id.menu_search); if (mViewPager == null) fullscreenButton = menu.findItem(R.id.menu_fullscreen); if (VERSION.SDK_INT >= 8) { // SearchManager supported by Froyo+. SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView(); searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); } else { searchItem.setVisible(false); } mutedButton = menu.findItem(R.id.menu_mute_button); deafenedButton = menu.findItem(R.id.menu_deafen_button); if (mService != null && mService.getCurrentUser() != null) { updateMuteDeafenMenuItems(mService.isMuted(), mService.isDeafened()); } return true; }
@Override protected void onResume() { super.onResume(); if (settings.getCallMode().equals(Settings.ARRAY_CALL_MODE_VOICE)) setProximityEnabled(true); if (mService != null && mService.getCurrentUser() != null) updateMuteDeafenMenuItems(mService.isMuted(), mService.isDeafened()); // Clear chat notifications when activity is re-opened if (mService != null && settings.isChatNotifyEnabled()) { mService.setActivityVisible(true); mService.clearChatNotification(); } }