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);
            }
Exemplo n.º 2
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;
			}
Exemplo n.º 3
0
		protected override void OnCreate(Bundle savedInstanceState) {
			SetTheme(SampleList.THEME); //Used for theme switching in samples
			base.OnCreate(savedInstanceState);
			SetContentView(Resource.Layout.action_modes);

			((Button)FindViewById (Resource.Id.start)).Click += delegate {
				mMode = StartActionMode (new AnActionModeOfEpicProportions (this));
			};
			((Button)FindViewById (Resource.Id.cancel)).Click += delegate {
				if (mMode != null) {
					mMode.Finish ();
				}
			};
		}
        protected override void OnCreate(Bundle savedInstanceState)
        {
            SetTheme(SampleList.THEME);             //Used for theme switching in samples
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.action_modes);

            ((Button)FindViewById(Resource.Id.start)).Click += delegate {
                mMode = StartActionMode(new AnActionModeOfEpicProportions(this));
            };
            ((Button)FindViewById(Resource.Id.cancel)).Click += delegate {
                if (mMode != null)
                {
                    mMode.Finish();
                }
            };
        }
Exemplo n.º 5
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			SetTheme (SampleList.THEME); //Used for theme switching in samples

			//You could also use Theme.Sherlock.NoActionBar or Theme.Sherlock.Light.NoActionBar
			RequestWindowFeature (WindowFeatures.NoTitle);

			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.action_modes);

			((Button)FindViewById (Resource.Id.start)).Click += delegate {
				mMode = StartActionMode (new AnActionModeOfEpicProportions (this));
			};
			((Button)FindViewById (Resource.Id.cancel)).Click += delegate {
				if (mMode != null) {
					mMode.Finish ();
				}
			};
		}
        protected override void OnCreate(Bundle savedInstanceState)
        {
            SetTheme(SampleList.THEME);              //Used for theme switching in samples

            //You could also use Theme.Sherlock.NoActionBar or Theme.Sherlock.Light.NoActionBar
            RequestWindowFeature(WindowFeatures.NoTitle);

            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.action_modes);

            ((Button)FindViewById(Resource.Id.start)).Click += delegate {
                mMode = StartActionMode(new AnActionModeOfEpicProportions(this));
            };
            ((Button)FindViewById(Resource.Id.cancel)).Click += delegate {
                if (mMode != null)
                {
                    mMode.Finish();
                }
            };
        }
 public void OnDestroyActionMode(ActionMode mode)
 {
 }
Exemplo n.º 8
0
			public void OnDestroyActionMode (ActionMode mode)
			{
			}
Exemplo n.º 9
0
 public bool OnActionItemClicked(ActionMode mode, IMenuItem item)
 {
     return clicked(mode, item);
 }
Exemplo n.º 10
0
			public bool OnPrepareActionMode (ActionMode mode, IMenu menu)
			{
				return false;
			}
Exemplo n.º 11
0
			public bool OnActionItemClicked (ActionMode mode, IMenuItem item)
			{
				Toast.MakeText (owner, "Got click: " + item, ToastLength.Short).Show ();
				mode.Finish ();
				return true;
			}
Exemplo n.º 12
0
 public void OnDestroyActionMode(ActionMode mode)
 {
     destroy(mode);
 }
Exemplo n.º 13
0
 public bool OnCreateActionMode(ActionMode mode, IMenu menu)
 {
     return create(mode, menu);
 }
Exemplo n.º 14
0
 public bool OnPrepareActionMode(ActionMode mode, IMenu menu)
 {
     return prepare(mode, menu);
 }
Exemplo n.º 15
0
        public ReaderFragment()
        {
            contentSelectionActionModeCallback = new CreateActionModeImpl(delegate(ActionMode actionMode, IMenu menu)
            {
                actionMode.Title = "Highlighting";

                SherlockActivity.SupportMenuInflater.Inflate(Resource.Menu.highlighting_menu, menu);
                return true;
            }, delegate(ActionMode actionMode, IMenu menu)
            {
                return false;
            }, delegate(ActionMode actionMode, IMenuItem menuItem)
            {
                switch (menuItem.ItemId)
                {
                    case Resource.Id.highlight:
                        actionMode.Finish();
                        return true;
                }
                return false;
            }, delegate(ActionMode actionMode)
            {
                view.Selected = false;
                currentActionMode = null;
            });
        }
Exemplo n.º 16
0
 public bool OnActionItemClicked(ActionMode mode, IMenuItem item)
 {
     Toast.MakeText(owner, "Got click: " + item, ToastLength.Short).Show();
     mode.Finish();
     return(true);
 }
Exemplo n.º 17
0
 public bool OnPrepareActionMode(ActionMode mode, IMenu menu)
 {
     return(false);
 }
Exemplo n.º 18
0
        public void ShowHighlightingMenu()
        {
            if (currentActionMode != null)
            {
                return;
            }

            currentActionMode = SherlockActivity.StartActionMode(contentSelectionActionModeCallback);
        }