public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
		{
			var conferencesScheduleViewModel = this.DataContext as ConferencesScheduleViewModel;

			inflater.Inflate(Resource.Menu.ConferencesListActionItems, menu);

			var searchView = (SearchView)menu.FindItem(Resource.Id.menu_search).ActionView;

			var textChangedLastTime = DateTime.Now;
			searchView.QueryTextChange += async (object sender, SearchView.QueryTextChangeEventArgs e) => 
			{
				var changedSpan = DateTime.Now.Subtract(textChangedLastTime);
				if (changedSpan.TotalMilliseconds > 200)
				{
					await conferencesScheduleViewModel.SearchAsync(e.NewText);
				}
				textChangedLastTime = DateTime.Now;
			};

			searchView.Close += async (sender, e) => 
			{
				await conferencesScheduleViewModel.LoadConferencesAsync(LoadRequest.Load);
				searchView.ClearFocus();
				searchView.OnActionViewCollapsed();
			};

			searchView.QueryTextSubmit += async (sender, e) => {
				await conferencesScheduleViewModel.SearchAsync(e.Query);
				searchView.ClearFocus();
				searchView.OnActionViewCollapsed(); 
			};
		}
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            MenuInflater menuInflater = new Android.Views.MenuInflater(this);
            menuInflater.Inflate(Resource.Layout.MenuNewsDetails, menu);

            return true;
        }
 public override bool OnCreateOptionsMenu(IMenu menu)
 {
     base.OnCreateOptionsMenu(menu);
     MenuInflater inflater = new MenuInflater(this);
     inflater.Inflate(Resource.Layout.XmlMenu, menu);
     return true;
 }
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            Activity.MenuInflater.Inflate (Resource.Menu.schedule_menu, menu);

            //Handle share action provider
            var shareMenuItem = menu.FindItem (Resource.Id.action_schedule_share);
            var shareActionProvider =
                (ShareActionProvider)shareMenuItem.ActionProvider;
            shareActionProvider.SetShareIntent (CreateIntent ());

            //Handle search action provider
            var searchOption = menu.FindItem(Resource.Id.action_schedule_search);

            //Handle expand/colapse of action bar
            MenuItemCompat.SetOnActionExpandListener(searchOption, new SearchViewExpandListener(_adapter));

            var searchItem = MenuItemCompat.GetActionView(searchOption);
            _searchView = searchItem.JavaCast<SearchView>();
            _searchView.QueryTextChange += (s, e) => _adapter.Filter.InvokeFilter(e.NewText);

            _searchView.QueryTextSubmit += (s, e) =>
            {
                Toast.MakeText(Activity, "Searched for: " + e.Query, ToastLength.Short).Show();
                e.Handled = true;
            };
        }
Exemple #5
0
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            MenuInflater menuInflater = new Android.Views.MenuInflater(this);

            menuInflater.Inflate(Resource.Layout.TabsMenu, menu);

            return(true);
        }
		public override void OnCreateOptionsMenu (IMenu menu, MenuInflater menuInflater) {
			menuInflater.Inflate (Resource.Layout.order_menu, menu);
			favourite = menu.FindItem (Resource.Id.fav);

			favourite.SetVisible (false);

			base.OnCreateOptionsMenu (menu, menuInflater);
		}
		public override void OnCreateOptionsMenu (IMenu menu, MenuInflater inflater)
		{
			base.OnCreateOptionsMenu (menu, inflater);

			menu.RemoveItem (Resource.Id.action_search);
			menu.RemoveItem (Resource.Id.action_radar);
			menu.RemoveItem (Resource.Id.action_settings);
		}
        /// <inheritdoc/>
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            ZTnTrace.Trace(MethodBase.GetCurrentMethod());

            Activity.MenuInflater.Inflate(Resource.Menu.HomeActivity, menu);

            base.OnCreateOptionsMenu(menu, inflater);
        }
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            // Put overlay items first
            MapView.OverlayManager.OnCreateOptionsMenu(menu, MenuLastId, MapView);

            menu.Add(0, MenuZoominId, Menu.None, "ZoomIn");
            menu.Add(0, MenuZoomoutId, Menu.None, "ZoomOut");

            base.OnCreateOptionsMenu(menu, inflater);
        }
			public override void OnCreateOptionsMenu (IMenu menu, MenuInflater inflater)
			{
				base.OnCreateOptionsMenu (menu, inflater);
				
				IMenuItem item;
				item = menu.Add("Menu 1a");
				MenuCompat.SetShowAsAction(item, MenuItemCompat.ShowAsActionIfRoom);
				item = menu.Add("Menu 1b");
				MenuCompat.SetShowAsAction(item, MenuItemCompat.ShowAsActionIfRoom);
			}
 public void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
 {
     // If the drawer is open, show the global app actions in the action bar. See also
     // showGlobalContextActionBar, which controls the top-left area of the action bar.
     if (mDrawerLayout != null && isDrawerOpen()) {
         inflater.Inflate(Resource.Menu.global, menu);
         showGlobalContextActionBar();
     }
     base.OnCreateOptionsMenu(menu, inflater);
 }
Exemple #12
0
        public override void OnCreateOptionsMenu(Android.Views.IMenu menu, Android.Views.MenuInflater inflater)
        {
            var typedValue = new TypedValue();

            Activity.Theme.ResolveAttribute(Resource.Attribute.app_map_ic_map, typedValue, true);

            var mapMenuItem = menu.Add(0, MENU_MAP_ID, 0, new Java.Lang.String(LocalizationService.GetLocalizableString(MapConstants.RESX_NAME, "Map_Title")));

            mapMenuItem.SetIcon(Resources.GetDrawable(typedValue.ResourceId, Context.Theme));
            mapMenuItem.SetShowAsAction(ShowAsAction.Always);
        }
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            base.OnCreateOptionsMenu(menu, inflater);

            inflater.Inflate(Resource.Menu.menuitem, menu);

            refreshButton = new MenuItemWrapper(menu.FindItem(Resource.Id.refresh));

            var bindingSet = this.CreateBindingSet<LastAddedTournamentsView, LastAddedTournamentsViewModel>();
            bindingSet.Bind(refreshButton).For(n => n.Visible).To(vm => vm.DataLoader.HasError);
            bindingSet.Apply();            
        }
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            inflater.Inflate (Resource.Menu.ActionMenu, menu);

            // Set up the search
            var search = menu.FindItem (Resource.Id.actionSearch);
            var searchView = MenuItemCompat.GetActionView (search);
            mSearch = searchView.JavaCast<SupportSearch> ();

            // Check for query and filter ListView
            mSearch.QueryTextChange += (sender, e) => mAdapter.Filter.InvokeFilter(e.NewText);
            mSearch.QueryTextSubmit += (sender, e) => {};
        }
Exemple #15
0
		public override void OnCreateOptionsMenu (IMenu menu, MenuInflater inflater)
		{
			base.OnCreateOptionsMenu (menu, inflater);
			inflater.Inflate (Resource.Menu.question, menu);

			_timeText = menu.FindItem (Resource.Id.time).ActionView as TextView;
			_startButton = new MenuItemWrapper (menu.FindItem (Resource.Id.start_timer));
			_stopButton = new MenuItemWrapper (menu.FindItem (Resource.Id.stop_timer));

			var bindingSet = this.CreateBindingSet<QuestionView, QuestionViewModel> ();
			bindingSet.Bind (_timeText).For (n => n.Text).To (vm => vm.Time).WithConversion ("Timer");
			bindingSet.Bind (_startButton).For (n => n.Visible).To (vm => vm.IsTimerStopped);
			bindingSet.Bind (_stopButton).For (n => n.Visible).To (vm => vm.IsTimerStarted);
			bindingSet.Apply ();
		}
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            inflater.Inflate(Resource.Menu.menu, menu);
            var cartItem = menu.FindItem(Resource.Id.cart_menu_item);
            cartItem.SetIcon((basketBadge = new BadgeDrawable(cartItem.Icon)));

            var order = WebService.Shared.CurrentOrder;
            if (badgeCount != order.Products.Count)
                basketBadge.SetCountAnimated(order.Products.Count);
            else
                basketBadge.Count = order.Products.Count;
            badgeCount = order.Products.Count;
            order.ProductsChanged += (sender, e) => basketBadge.SetCountAnimated(order.Products.Count);
            base.OnCreateOptionsMenu(menu, inflater);
        }
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            inflater.Inflate (Resource.Menu.NewsList, menu);

            var searchManager = (global::Android.App.SearchManager)Activity.GetSystemService(Context.SearchService);
            var searchItem = menu.FindItem (Resource.Id.Search);
            var searchView = searchItem.ActionView.JavaCast<SearchView>();
            searchView.SetSearchableInfo(searchManager.GetSearchableInfo(Activity.ComponentName));
            searchView.QueryTextChange += (object sender, SearchView.QueryTextChangeEventArgs e) =>
            {
                FindArticles(e.NewText);
            };

            base.OnCreateOptionsMenu(menu, inflater);
        }
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            base.OnCreateOptionsMenu(menu, inflater);

            inflater.Inflate(HasSearchView ? Resource.Menu.options_menu : Resource.Menu.options_menu_nosearch, menu);

            IMenuItem searchItem = menu.FindItem(Resource.Id.action_search);
            if(null == searchItem) {
                return;
            }

            View actionView = Android.Support.V4.View.MenuItemCompat.GetActionView(searchItem);
            FilterView = actionView.JavaCast<Android.Support.V7.Widget.SearchView>();

            // TODO: let the subclasses set this up
            FilterView.QueryHint = Resources.GetString(Resource.String.search_hint);
        }
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            inflater.Inflate(Resource.Menu.DetailMenu, menu);

            var menuItem = menu.FindItem(Resource.Id.action_share);

            var shareActionProvider = (ShareActionProvider)menuItem.ActionProvider;

            if (shareActionProvider != null)
            {
                shareActionProvider.SetShareIntent(Intents.CreateShareForecastIntent(_forecastString + " #SpringTimeApp"));
            }
            else
            {
                Log.Debug("SpringTime", "Share Action Provider is null?");
            }
        }
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            //			inflater.Inflate (Resource.Menu.mfActionBar, menu);

            miAddAtt = menu.Add (1, 1, 1, @"Начать посещение");
            miAddAtt.SetIcon (Resource.Drawable.ic_add_circle_outline_white_48dp);
            //			miAddAtt.SetShowAsAction()
            miAddAtt.SetEnabled (true);

            //			miAddAtt.Id

            miAddPhoto = menu.Add(1, 2, 2, @"Добавить фото");
            miAddPhoto.SetIcon (Resource.Drawable.ic_camera_alt_white_48dp);
            miAddPhoto.SetEnabled (false);

            base.OnCreateOptionsMenu (menu, inflater);
        }
		/// <summary>
		/// Raised, when option menu for this fragment should be created.
		/// </summary>
		/// <param name="menu">Menu.</param>
		/// <param name="inflater">Inflater.</param>
		public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
		{
			inflater.Inflate (Resource.Menu.ScreenMainMenu, menu);

			menuSave = menu.FindItem (Resource.Id.menu_screen_main_save);
			menuQuit = menu.FindItem (Resource.Id.menu_screen_main_quit);

			base.OnCreateOptionsMenu(menu, inflater);

//			menuSave = menu.Add(Resource.String.menu_screen_main_save);
//			menuSave.SetShowAsAction(ShowAsAction.Always);
//			menuSave.SetIcon(Resource.Drawable.menu_save);
//			menuQuit = menu.Add(Resource.String.menu_screen_main_quit);
//			menuQuit.SetShowAsAction(ShowAsAction.Always);
//			menuQuit.SetIcon(Resource.Drawable.lock_power_off);
//			//			ISubMenu sub = menu.AddSubMenu ("Theme");
//			//			sub.Add (0, Resource.Style.Theme_Sherlock, 0, "Default");
//			//			sub.Add (0, Resource.Style.Theme_Sherlock_Light, 0, "Light");
//			//			sub.Add (0, Resource.Style.Theme_Sherlock_Light_DarkActionBar, 0, "Light (Dark Action Bar)");
//			//			sub.Item.Show.SetShowAsAction (MenuItem.ShowAsActionAlways | MenuItem.ShowAsActionWithText);
		}
 public override void OnCreateOptionsMenu(IMenu menu, MenuInflater menuInflater)
 {
     // Do nothing
 }
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            // Put overlay items first
            _mapView.OverlayManager.OnCreateOptionsMenu(menu, MenuLastId, _mapView);

            // Put samples next
            var samplesSubMenu = menu.AddSubMenu(0, MenuSamples, Menu.None, Resource.String.samples)
                .SetIcon(Android.Resource.Drawable.IcMenuGallery);
            var sampleFactory = SampleFactory.GetInstance();
            for (var a = 0; a < sampleFactory.Count(); a++)
            {
                var f = sampleFactory.GetSample(a);
                samplesSubMenu.Add(f.GetSampleTitle()).SetOnMenuItemClickListener(new StartSampleFragment(this, f));
            }

            // Put "About" menu item last
            menu.Add(0, MenuAbout, (int) MenuCategory.Secondary, Resource.String.about)
                .SetIcon(Android.Resource.Drawable.IcMenuInfoDetails);

            base.OnCreateOptionsMenu(menu, inflater);
        }
		public override void OnCreateOptionsMenu (IMenu menu, MenuInflater inflater)
		{
			inflater.Inflate (Resource.Menu.session_detail_menu_items, menu);
			base.OnCreateOptionsMenu (menu, inflater);
		}
 public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
 {
     Mediator.OnCreateOptionsMenu(menu, inflater, base.OnCreateOptionsMenu);
 }
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            inflater.Inflate (Resource.Menu.actionBar_search, menu);

            base.OnCreateOptionsMenu (menu, inflater);
        }
Exemple #27
0
        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            base.OnCreateOptionsMenu(menu, inflater);

            inflater.Inflate(Resource.Menu.menuitem, menu);
        }
 /**
  * Returns a {@link android.view.MenuInflater} that can read action bar metadata on
  * pre-Honeycomb devices.
  */
 public MenuInflater getMenuInflater(MenuInflater superMenuInflater)
 {
     return new WrappedMenuInflater(mActivity, superMenuInflater);
 }
 public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
 {
     inflater.Inflate (Resource.Menu.detail_fragment, menu);
     IMenuItem menuItem = menu.FindItem (Resource.Id.action_share);
     shareWeather (menuItem);
     base.OnCreateOptionsMenu (menu, inflater);
 }
 public override void OnCreateOptionsMenu (IMenu menu, MenuInflater inflater)
 {
     inflater.Inflate (Resource.Menu.SaveItemMenu, menu);
     SaveMenuItem = menu.FindItem (Resource.Id.saveItem);
     ConfigureOptionMenu ();
 }
 public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
 {
     inflater.Inflate(Resource.Menu.refresh, menu);
 }
		public override void OnCreateOptionsMenu (IMenu menu, MenuInflater inflater)
		{
			inflater.Inflate (Resource.Menu.map_menu, menu);
			searchItem = menu.FindItem (Resource.Id.menu_search);
			SetupSearchInput ((SearchView)searchItem.ActionView);
		}