public override bool OnOptionsItemSelected (IMenuItem item)
		{
			if (item.ItemId == Resource.Id.sample_action) {
				ToggleHideyBar ();
			}
			return true;
		}
Example #2
0
        /// <param name="item">The menu item that was selected.</param>
		/// <summary>
		/// This hook is called whenever an item in your options menu is selected.
		/// </summary>
		/// <returns>To be added.</returns>
		public override bool OnOptionsItemSelected(IMenuItem item)
        {
            base.OnOptionsItemSelected(item);

            switch (item.ItemId)
            {
                case Resource.Id.btnYoum7:
                    {
                        Finish();
                        StartActivity(new Intent(this, typeof(FeedYoum7)));
                        break;
                    }

                case Resource.Id.btnFilGoal:
                    {
                        Finish();
                        StartActivity(new Intent(this, typeof(FeedFilGoal)));
                        break;
                    }

                case Resource.Id.btnWPcentral:
                    {
                        Finish();
                        StartActivity(new Intent(this, typeof(FeedWPcentral)));
                        break;
                    }
            }

            return true;
        }
		public override bool OnOptionsItemSelected (IMenuItem item)
		{
			if (item.ItemId == Android.Resource.Id.Home)
				Finish ();

			return base.OnOptionsItemSelected (item);
		}
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (item.ItemId == Resource.Id.mnuAddIncidentTakePhoto)
            {
                ViewModel.TakeNewPhotoCommand.Execute(null);
                return true;
            }
            else if (item.ItemId == Resource.Id.mnuAddIncidentAttachImage)
            {
                ViewModel.SelectPhotoCommand.Execute(null);
                return true;
            }
            else if (item.ItemId == Resource.Id.mnuAddIncidentRecordAudio)
            {
                ViewModel.RecordAudioCommand.Execute(null);
                return true;
            }
            else if (item.ItemId == Android.Resource.Id.Home)
            {
                Finish();
                return true;
            }
            else if (item.ItemId == Resource.Id.mnuAddIncidentContinue)
            {
                ViewModel.SaveNewIncidentCommand.Execute(null);
                return true;
            }
            else
            {
                throw new NotImplementedException();
            }

            return base.OnOptionsItemSelected(item);
        }
Example #5
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (mDrawerToggle.OnOptionsItemSelected(item))
            {
                if (mDrawerLayout.IsDrawerOpen(mRightDrawer))
                {
                    mDrawerLayout.CloseDrawer(mRightDrawer);
                }

                return true;
            }


            switch (item.ItemId)
            {
                case Resource.Id.menu:
                    if (mDrawerLayout.IsDrawerOpen(mRightDrawer))
                    {
                        mDrawerLayout.CloseDrawer(mRightDrawer);
                    }

                    else
                    {
                        mDrawerLayout.CloseDrawer(mLeftDrawer);
                        mDrawerLayout.OpenDrawer(mRightDrawer);
                    }

                    return true;

                default:
                    return base.OnOptionsItemSelected(item);
            }

        }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
                case 0:
                    photo.SetRotationBy(10);
                    return true;
                case 1:
                    photo.SetRotationBy(-10);
                    return true;
                case 2:
                    ToggleRotation();
                    return true;
                case 3:
                    photo.SetRotationTo(0);
                    return true;
                case 4:
                    photo.SetRotationTo(90);
                    return true;
                case 5:
                    photo.SetRotationTo(180);
                    return true;
                case 6:
                    photo.SetRotationTo(270);
                    return true;
            }

            return base.OnOptionsItemSelected(item);
        }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
                case Resource.Id.refresh:
                    _browser.Reload();
                    break;
                case Resource.Id.stop:
                    _browser.StopLoading();
                    break;
                case Resource.Id.settings:
                    StartActivity(typeof(SettingsActivity));
                    break;
                case Resource.Id.home:
                    goToHomePageIfSet();
                    break;
                case Resource.Id.history:
                    var intent = new Intent(this, typeof(HistoryActivity));
                    StartActivityForResult(intent, HISTORY_REQUEST_CODE);
                    break;
                default:
                    return base.OnOptionsItemSelected(item);
            }

            return true;
        }
        //@Override
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            
            switch (item.ItemId) {
                case R.Id.random:
                    int page = 0;
                    page = RANDOM.Next(mAdapter.Count);
                    Toast.MakeText(this, "Changing to page " + Convert.ToString(page), ToastLength.Short);
                    mPager.SetCurrentItem(page,true);
                    return true;

                case R.Id.add_page:
                    if (mAdapter.Count < 10) {
                        mAdapter.setCount(mAdapter.getCount() + 1);
                        mIndicator.notifyDataSetChanged();
                    }
                    return true;

                case R.Id.remove_page:
                    if (mAdapter.getCount() > 1) {
                        mAdapter.setCount(mAdapter.getCount() - 1);
                        mIndicator.notifyDataSetChanged();
                    }
                    return true;
            }
            return base.OnOptionsItemSelected(item);
        }
Example #9
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch(item.ItemId)
            {
                case Resource.Id.menuSettings:
                    Intent setIntent = new Intent(this, typeof(Settings));
                    StartActivityForResult(setIntent, 0);
                    break;

                case Resource.Id.menuGetDataNow:
                    new FeedHelper().UpdateBGFeeds(this);
                    break;

                case Resource.Id.menuShowReadNews:
                    showOnlyUnreadNews = !showOnlyUnreadNews;

                    LoadNews();

                    if (!showOnlyUnreadNews)
                        item.SetTitle("Ungelesene News");
                    else
                        item.SetTitle("Alle News");
                    break;

                case Resource.Id.menuMarkAllRead:
                    new de.dhoffmann.mono.adfcnewsapp.buslog.database.Rss().MarkItemsAsRead(null, true);
                    LoadNews();
                    break;
            }

            return true;
        }
Example #10
0
        public override bool OnMenuItemSelected(int featureID, IMenuItem item)
        {
            base.OnMenuItemSelected(featureID, item);

            // Een menuItem selecteren en naar de toegewenste activity gaan
            switch (item.ItemId)
            {
                case (1):
                    {
                        // Intent maken en doorgaan naar Home
                        var MenuIntent = new Intent(this, typeof(MainActivity));
                        StartActivity(MenuIntent);
                        return (true);
                    }
                case (2):
                    {
                        // Intent maken en doorgaan naar Formulier
                        var MenuIntent = new Intent(this, typeof(Formulier));
                        StartActivity(MenuIntent);
                        return (true);
                    }
                case (3):
                    {
                        // Intent maken en doorgaan naar Formulier
                        var MenuIntent = new Intent(this, typeof(Overzicht));
                        StartActivity(MenuIntent);
                        return (true);
                    }
            }
            return (false);
        }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
                case Resource.Id.random:
                    var page = _random.Next(_adapter.Count);
                    Toast.MakeText(this, "Changing to page " + page, ToastLength.Short).Show();
                    _pager.CurrentItem = page;
                    return true;

                case Resource.Id.add_page:
                    if (_adapter.Count < 10)
                    {
                        _adapter.SetCount(_adapter.Count + 1);
                        _indicator.NotifyDataSetChanged();
                    }
                    return true;

                case Resource.Id.remove_page:
                    if (_adapter.Count > 1)
                    {
                        _adapter.SetCount(_adapter.Count - 1);
                        _indicator.NotifyDataSetChanged();
                    }
                    return true;
            }

            return base.OnOptionsItemSelected(item);
        }
Example #12
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            var id = item.ItemId;

            // refresh
            if (id == Resource.Id.refresh_weather)
            {
                SetForecastInfo();
                
                return true;
            }

            // settings
            if (id == Resource.Id.action_settings)
            {
                StartActivity(new Intent(Activity, typeof(SettingsActivity)));
                return true;
            }

            // view location on the map
            if (id == Resource.Id.action_location)
            {
                Intents.StartMap(Activity);
                return true;
            }

            return base.OnOptionsItemSelected(item);
        }
Example #13
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
                case Android.Resource.Id.Home:
                    //Wrong:
                    //var intent = new Intent(this, typeof(HomeView));
                    //intent.AddFlags(ActivityFlags.ClearTop);
                    //StartActivity(intent);
                    NavUtils.NavigateUpFromSameTask(this);

                    //if this could be launched externally:
                    /*
                     var upIntent = NavUtils.GetParentActivityIntent(this);
                    if (NavUtils.ShouldUpRecreateTask(this, upIntent))
                    {
                        Android.Support.V4.App.TaskStackBuilder.Create(this).
                            AddNextIntentWithParentStack(upIntent).
                            StartActivities();
                    }
                    else
                    {
                        NavUtils.NavigateUpTo(this, upIntent);  
                    }
                     */
                    break;
            }

            return base.OnOptionsItemSelected(item);
        }
Example #14
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId) {
                case Resource.Id.sendSMS:
                    break;
                case Resource.Id.menuCreateGroup:
                    var groupName = new EditText(this);
                    new AlertDialog.Builder(this)
                        .SetTitle ("New SMS Group")
                        .SetMessage ("Please enter a name for the SMS group:")
                        .SetView (groupName)
                        .SetPositiveButton ("Ok", (o, e) => {
                                var imm = (InputMethodManager)GetSystemService(InputMethodService);
                                imm.HideSoftInputFromWindow (groupName.WindowToken, HideSoftInputFlags.None);
                                var intent = new Intent();
                                intent.SetClass(this, typeof(NewSmsGroupActivity));
                                intent.PutExtra("name", groupName.Text);
                                StartActivity(intent);
                            })
                        .SetNegativeButton ("Cancel", (o, e) => { })
                        .Show ();
                    break;
            }

            return true;
        }
Example #15
0
        // Pass the event to ActionBarDrawerToggle, if it returns
        // true, then it has handled the app icon touch event
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (drawerToggle.OnOptionsItemSelected(item))
            return true;

              return base.OnOptionsItemSelected(item);
        }
Example #16
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     if (item.ItemId == Resource.Id.reset)
     {
         steps = 0;
         calories = 0;
         speed = 0.0f;
         distance = 0.0f;
         tmp = null;
         chrono.Base = SystemClock.ElapsedRealtime();
         refreshTextViews();
     }
     else
     {
         if (!run)
         {
             sensorsListenerRegister();
             if (tmp == null)
                 chrono.Base = SystemClock.ElapsedRealtime();
             else
                 chrono.Base += SystemClock.ElapsedRealtime() - tmp.Base;
             chrono.Start();
             run = true;
         }
         else
         {
             sensorManager.UnregisterListener(this);
             run = false;
             chrono.Stop();
             tmp = new Chronometer(this);
         }
     }
     return base.OnOptionsItemSelected(item);
 }
		public override bool OnOptionsItemSelected (IMenuItem item)
		{
			int id = item.ItemId;
			if (id == Android.Resource.Id.Home) {
				Finish();
				return true;
			} else if (id == Resource.Id.action_normal) {
				_listView.SetParallax(false);
				return true;
			} else if (id == Resource.Id.action_parallax) {
				_listView.SetParallax(true);
				return true;
			} else if (id == Resource.Id.action_show_head) {
				_listView.SetHideHeader(false);
				return true;
			} else if (id == Resource.Id.action_hide_head) {
				_listView.SetHideHeader(true);
				return true;
			} else if (id == Resource.Id.action_disable_zoom) {
				_listView.SetZoomEnabled(false);
				return true;
			} else if (id == Resource.Id.action_enable_zoom) {
				_listView.SetZoomEnabled(true);
				return true;
			}
			return base.OnOptionsItemSelected (item);
		}
Example #18
0
        public override bool OnMenuItemSelected(int featureId, IMenuItem item)
        {
            switch (item.ItemId)
            {
                case Resource.Id.ScanAction:
                    item.SetTitle(_scanner.IsScanning ? Resource.String.StartScan : Resource.String.StopScan);
                    if (_scanner.IsScanning)
                    {
                        _scanner.StopScan();
                        break;
                    }
                    _scanner.StartScan();
                    break;

                case Resource.Id.OpenServerAction:
                    item.SetTitle(_bluetoothServer.IsOpened ?  Resource.String.OpenServer : Resource.String.CloseServer);
                    if (_bluetoothServer.IsOpened)
                    {
                        _bluetoothServer.Close();
                    }
                    else
                    {
                        _bluetoothServer.Open();
                    }
                    break;
            }
            return true;
        }
Example #19
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
                case Resource.Id.actionNew:
                    string default_game_name = "Game";
                    AlertDialog.Builder alert1 = new AlertDialog.Builder(this.Activity);
                    EditText input = new EditText(this.Activity);
                    input.Text = default_game_name;
                    alert1.SetTitle("Game Name");
                    alert1.SetView(input);
                    alert1.SetPositiveButton("OK", delegate { AddGame(input.Text); });
                    alert1.SetNegativeButton("Cancel", (s, e) => { });
                    alert1.Show();
                    _adapter.NotifyDataSetChanged();
                    return true;

                case Resource.Id.actionRefresh:
                    GameData.Service.RefreshCache();
                    _adapter.NotifyDataSetChanged();
                    return true;

                default:
                    return base.OnOptionsItemSelected(item);
            }
        }
 private ICollection<IMenuItem<IssuesEventArgs>> CreateIssueContextMenuItems()
 {
     mainIssuesExtMenuItem = new MenuItem<IssuesEventArgs>(contextMenuLabel, DelegateContextMenuAction);
     List<IMenuItem<IssuesEventArgs>> items = new List<IMenuItem<IssuesEventArgs>>();
     items.Add(mainIssuesExtMenuItem);
     return items;
 }
Example #21
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     // TODO Auto-generated method stub
     switch (item.ItemId)
     {
         case Resource.Id.miReset:
             // очищаем поля
             etNum1.Text = String.Empty;
             etNum2.Text = String.Empty;
             tvResult.Text = String.Empty;
             break;
         case Resource.Id.miQuit:
             // выход из приложения
             //MoveTaskToBack(true);
             Finish();
             break;
         case Resource.Id.miDisplayMetrics:
             Intent intent = new Intent(this, typeof(DisplayMetricsActivity));
             StartActivity(intent);
             break;
         case Resource.Id.miPreferences:
             StartActivity(new Intent(this, typeof(PreferencesActivity)));
             break;
     }
     return base.OnOptionsItemSelected(item);
 }
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     switch (item.ItemId)
     {
     case 0:
         File.Delete (Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "Cache.html"));
         StartActivity (typeof(MainActivity));
         break;
     case 1:
         Target = Target.AddDays (-1);
         Display ();
         break;
     case 2:
         Target = Target.AddDays (1);
         Display ();
         break;
     case 3:
         var transaction = FragmentManager.BeginTransaction ();
         var addcurriculum = new AddCurriculumDialog ();
         addcurriculum.Show (transaction, "添加课程");
         Display ();
         break;
     }
     return true;
 }
Example #23
0
        /*
        public override bool OnPrepareOptionsMenu(IMenu menu)
        {
            var drawerOpen = homeLayout.IsDrawerOpen(Resource.Id.left_drawer);
            //menu.FindItem(Resource.Id.action_websearch).SetVisible(!drawerOpen);
            return base.OnPrepareOptionsMenu(menu);
        }
         */
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if(drawerToggle.OnOptionsItemSelected((item)))
                return true;

            return base.OnOptionsItemSelected(item);

            //switch (item.ItemId)
            //{
            //    case Resource.Id.menu_add_record:
            //        // The user has tapped the add task button
            //        StartActivity(typeof(RecordDetailsScreen));
            //        return true;

            //    //case Resource.Id.menu_sort_record:
            //    //	var action = DisplayActionSheet(

            //    default:
            //        return base.OnOptionsItemSelected(item);
            //}

            /*
             * actionButton2.Clicked += async (sender, e) => {
            var action = await DisplayActionSheet ("ActionSheet: Save Photo?", "Cancel", "Delete", "Photo Roll", "Email");
            Debug.WriteLine("Action: " + action); // writes the selected button label to the console
            };
            */
        }
        /// <summary>
        ///     This hook is called whenever an item in your options menu is selected.
        /// </summary>
        /// <param name="item">The menu item that was selected.</param>
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
                case Android.Resource.Id.Home:
                    Finish();
                    return true;

                case Resource.Id.action_done:
                    ViewModel.DoneCommand.Execute(null);
                    return true;

                case Resource.Id.action_add:
                    var dialog = new ModifyCategoryDialog
                    {
                        ViewModel = Mvx.Resolve<CategoryDialogViewModel>()
                    };

                    dialog.Show(SupportFragmentManager, "dialog");
                    return true;

                default:
                    return false;
            }
        }
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
                case Resource.Id.atn_direct_enable:
                    if (_manager != null && _channel != null)
                    {
                        // Since this is the system wireless settings activity, it's
                        // not going to send us a result. We will be notified by
                        // WiFiDeviceBroadcastReceiver instead.

                        StartActivity(new Intent(Settings.ActionWirelessSettings));
                    }
                    else
                    {
                        Log.Error(Tag, "Channel or manager is null");
                    }
                    return true;
                case Resource.Id.atn_direct_discover:
                    if (!IsWifiP2PEnabled)
                    {
                        Toast.MakeText(this, Resource.String.p2p_off_warning, ToastLength.Short).Show();
                        return true;
                    }
                    var fragment = FragmentManager.FindFragmentById<DeviceListFragment>(Resource.Id.frag_list);
                    fragment.OnInitiateDiscovery();
                    _manager.DiscoverPeers(_channel, new MyActionListner(this, "Discovery", () => {}));
                    return true;
                default:
                    return base.OnOptionsItemSelected(item);
            }
        }
Example #26
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     //new AlertDialog.Builder(this.BaseContext).SetMessage(item.ItemId.ToString()).Show();
     //Toast.MakeText (this, item.ItemId.ToString (), ToastLength.Long);
     this.Finish ();
     return base.OnOptionsItemSelected (item);
 }
Example #27
0
		// Select an option from the menu
		public override bool OnOptionsItemSelected(IMenuItem item)
		{
			if (item.ItemId == Resource.Id.menu_refresh) {
				OnRefreshItemsSelected();
			}
			return true;
		}
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId){

            case Android.Resource.Id.Home:
                //The hamburger icon was clicked which means the drawer toggle will handle the event
                //all we need to do is ensure the right drawer is closed so the don't overlap
                _drawerLayout.CloseDrawer (_rightDrawer);
                _drawerToggle.OnOptionsItemSelected(item);
                return true;
            case Resource.Id.toolbar:
                //Refresh
                return true;
            case Resource.Id.action_help:
                if (_drawerLayout.IsDrawerOpen (_rightDrawer)) {
                    //Right Drawer is already open, close it
                    _drawerLayout.CloseDrawer (_rightDrawer);
                } else {
                    //Right Drawer is closed, open it and just in case close left drawer
                    _drawerLayout.OpenDrawer (_rightDrawer);
                    _drawerLayout.CloseDrawer (_leftDrawer);
                }
                return true;

            default:
                return base.OnOptionsItemSelected (item);
            }
        }
Example #29
0
        /// <param name="item">The menu item that was selected.</param>
        /// <summary>
        /// This hook is called whenever an item in your options menu is selected.
        /// </summary>
        /// <returns>To be added.</returns>
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            base.OnOptionsItemSelected(item);

            switch (item.ItemId)
            {
                case Resource.Id.ThemesBlue:
                    {
                        var newTheme = FlatUI.FlatUI.GetTheme("أزرق");
                        ChangeTheme(newTheme);
                        break;
                    }
                case Resource.Id.ThemesDark:
                    {
                        var newTheme = FlatUI.FlatUI.GetTheme("داكن");
                        ChangeTheme(newTheme);
                        break;
                    }
                case Resource.Id.ThemesGreen:
                    {
                        var newTheme = FlatUI.FlatUI.GetTheme("أخضر");
                        ChangeTheme(newTheme);
                        break;
                    }
                case Resource.Id.ThemesOrange:
                    {
                        var newTheme = FlatUI.FlatUI.GetTheme("برتقالي");
                        ChangeTheme(newTheme);
                        break;
                    }
                case Resource.Id.ThemesSnow:
                    {
                        var newTheme = FlatUI.FlatUI.GetTheme("فاتح");
                        ChangeTheme(newTheme);
                        break;
                    }
                case Resource.Id.BackgroundNormal:
                    {
                        var layout = FindViewById(Resource.Id.listBook);
                        layout.SetBackgroundResource(IslamicHadithAND.Resource.Drawable.Background);
                        break;
                    }
                case Resource.Id.BackgroundGray:
                    {
                        var layout = FindViewById(Resource.Id.listBook);
                        layout.SetBackgroundColor(Android.Graphics.Color.DarkGray);
                        break;
                    }
                case Resource.Id.BackgroundBlack:
                    {
                        var layout = FindViewById(Resource.Id.listBook);
                        layout.SetBackgroundColor(Android.Graphics.Color.Black);
                        break;
                    }
                default:
                    break;
            }

            return true;
        }
		public override bool OnOptionsItemSelected (IMenuItem item)
		{
			if (item.ItemId == Resource.Id.sample_action) {
				PerformFileSearch ();
			}
			return true;
		}