Пример #1
0
			public bool OnCreateActionMode (ActionMode mode, IMenu menu)
			{
				//Used to put dark icons on light action bar
				bool isLight = SampleList.THEME == Resource.Style.Theme_Sherlock_Light;

				menu.Add ("Save")
					.SetIcon (isLight ? Resource.Drawable.ic_compose_inverse : Resource.Drawable.ic_compose)
						.SetShowAsAction (MenuItem.ShowAsActionIfRoom);

				menu.Add ("Search")
					.SetIcon (isLight ? Resource.Drawable.ic_search_inverse : Resource.Drawable.ic_search)
						.SetShowAsAction (MenuItem.ShowAsActionIfRoom);

				menu.Add ("Refresh")
					.SetIcon (isLight ? Resource.Drawable.ic_refresh_inverse : Resource.Drawable.ic_refresh)
						.SetShowAsAction (MenuItem.ShowAsActionIfRoom);

				menu.Add ("Save")
					.SetIcon (isLight ? Resource.Drawable.ic_compose_inverse : Resource.Drawable.ic_compose)
						.SetShowAsAction (MenuItem.ShowAsActionIfRoom);

				menu.Add ("Search")
					.SetIcon (isLight ? Resource.Drawable.ic_search_inverse : Resource.Drawable.ic_search)
						.SetShowAsAction (MenuItem.ShowAsActionIfRoom);

				menu.Add ("Refresh")
					.SetIcon (isLight ? Resource.Drawable.ic_refresh_inverse : Resource.Drawable.ic_refresh)
						.SetShowAsAction (MenuItem.ShowAsActionIfRoom);

				return true;
			}
Пример #2
0
		public override bool OnCreateOptionsMenu (IMenu menu)
		{
			//Used to put dark icons on light action bar
			bool isLight = SampleList.THEME == Resource.Style.Sherlock___Theme_Light;

			//Create the search view
			SearchView searchView = new SearchView (SupportActionBar.ThemedContext);
			searchView.QueryHint = "Search for countries…";
			searchView.SetOnQueryTextListener (this);
			searchView.SetOnSuggestionListener (this);

			if (mSuggestionsAdapter == null) {
				MatrixCursor cursor = new MatrixCursor (COLUMNS);
				Converter<string, Java.Lang.Object> func = s => new Java.Lang.String (s);
				cursor.AddRow (Array.ConvertAll<string,Java.Lang.Object> (new string[] { "1", "'Murica" }, func));
				cursor.AddRow (Array.ConvertAll<string,Java.Lang.Object> (new string[] { "2", "Canada" }, func));
				cursor.AddRow (Array.ConvertAll<string,Java.Lang.Object> (new string[] { "3", "Denmark" }, func));
				mSuggestionsAdapter = new SuggestionsAdapter (SupportActionBar.ThemedContext, cursor);
			}

			searchView.SuggestionsAdapter = mSuggestionsAdapter;

			menu.Add ("Search")
				.SetIcon (isLight ? Resource.Drawable.ic_search_inverse : Resource.Drawable.abs__ic_search)
					.SetActionView (searchView)
					.SetShowAsAction (MenuItem.ShowAsActionIfRoom | MenuItem.ShowAsActionCollapseActionView);

			return true;
		}
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            //Used to put dark icons on light action bar
            bool isLight = SampleList.THEME == Resource.Style.Theme_Sherlock_Light;

            menu.Add("Save")
            .SetIcon(isLight ? Resource.Drawable.ic_compose_inverse : Resource.Drawable.ic_compose)
            .SetShowAsAction(MenuItem.ShowAsActionIfRoom | MenuItem.ShowAsActionWithText);

            menu.Add("Search")
            .SetIcon(isLight ? Resource.Drawable.ic_search_inverse : Resource.Drawable.ic_search)
            .SetShowAsAction(MenuItem.ShowAsActionIfRoom | MenuItem.ShowAsActionWithText);

            menu.Add("Refresh")
            .SetIcon(isLight ? Resource.Drawable.ic_refresh_inverse : Resource.Drawable.ic_refresh)
            .SetShowAsAction(MenuItem.ShowAsActionIfRoom | MenuItem.ShowAsActionWithText);

            return(base.OnCreateOptionsMenu(menu));
        }
Пример #4
0
		public override bool OnCreateOptionsMenu (IMenu menu)
		{
			//Used to put dark icons on light action bar
			bool isLight = SampleList.THEME == Resource.Style.Theme_Sherlock_Light;

			menu.Add ("Save")
				.SetIcon (isLight ? Resource.Drawable.ic_compose_inverse : Resource.Drawable.ic_compose)
					.SetShowAsAction (MenuItem.ShowAsActionIfRoom | MenuItem.ShowAsActionWithText);

			menu.Add ("Search")
				.SetIcon (isLight ? Resource.Drawable.ic_search_inverse : Resource.Drawable.ic_search)
					.SetShowAsAction (MenuItem.ShowAsActionIfRoom | MenuItem.ShowAsActionWithText);

			menu.Add ("Refresh")
				.SetIcon (isLight ? Resource.Drawable.ic_refresh_inverse : Resource.Drawable.ic_refresh)
					.SetShowAsAction (MenuItem.ShowAsActionIfRoom | MenuItem.ShowAsActionWithText);

			return base.OnCreateOptionsMenu (menu);
		}
        public override bool OnCreateOptionsMenu(Xamarin.ActionbarSherlockBinding.Views.IMenu menu)
        {
            for (int i = 0; i < items; i++)
            {
                menu.Add("Text")
                .SetIcon(Resource.Drawable.ic_title_share_default)
                .SetShowAsAction(MenuItem.ShowAsActionIfRoom | MenuItem.ShowAsActionWithText);
            }

            return(base.OnCreateOptionsMenu(menu));
        }
Пример #6
0
        public override bool OnCreateOptionsMenu(Xamarin.ActionbarSherlockBinding.Views.IMenu menu)
        {
            //Used to put dark icons on light action bar
            bool isLight = SampleList.THEME == Resource.Style.Theme_Sherlock_Light;

            menu.Add("Search")
            .SetIcon(isLight ? Resource.Drawable.ic_search_inverse : Resource.Drawable.ic_search)
            .SetActionView(Resource.Layout.collapsible_edittext)
            .SetShowAsAction(MenuItem.ShowAsActionAlways | MenuItem.ShowAsActionCollapseActionView);

            return(true);
        }
            public bool OnCreateActionMode(ActionMode mode, IMenu menu)
            {
                //Used to put dark icons on light action bar
                bool isLight = SampleList.THEME == Resource.Style.Theme_Sherlock_Light;

                menu.Add("Save")
                .SetIcon(isLight ? Resource.Drawable.ic_compose_inverse : Resource.Drawable.ic_compose)
                .SetShowAsAction(MenuItem.ShowAsActionIfRoom);

                menu.Add("Search")
                .SetIcon(isLight ? Resource.Drawable.ic_search_inverse : Resource.Drawable.ic_search)
                .SetShowAsAction(MenuItem.ShowAsActionIfRoom);

                menu.Add("Refresh")
                .SetIcon(isLight ? Resource.Drawable.ic_refresh_inverse : Resource.Drawable.ic_refresh)
                .SetShowAsAction(MenuItem.ShowAsActionIfRoom);

                menu.Add("Save")
                .SetIcon(isLight ? Resource.Drawable.ic_compose_inverse : Resource.Drawable.ic_compose)
                .SetShowAsAction(MenuItem.ShowAsActionIfRoom);

                menu.Add("Search")
                .SetIcon(isLight ? Resource.Drawable.ic_search_inverse : Resource.Drawable.ic_search)
                .SetShowAsAction(MenuItem.ShowAsActionIfRoom);

                menu.Add("Refresh")
                .SetIcon(isLight ? Resource.Drawable.ic_refresh_inverse : Resource.Drawable.ic_refresh)
                .SetShowAsAction(MenuItem.ShowAsActionIfRoom);

                return(true);
            }
Пример #8
0
		public override bool OnCreateOptionsMenu (IMenu menu)
		{
			menu.Add ("Refresh")
				.SetIcon (Android.Resource.Drawable.IcMenuMyLocation)
				.SetShowAsAction (MenuItem.ShowAsActionAlways);

			return true;
		}