예제 #1
0
        public static CalendarFragment NewInstance(int activityId)
        {
            var args = new Bundle(1);

            args.PutInt(DetailFragment.ArgActivityId, activityId);

            var f = new CalendarFragment();

            f.Arguments = args;

            return(f);
        }
예제 #2
0
        /// <Docs>The menu item that was selected.</Docs>
        /// <returns>To be added.</returns>
        /// <para tool="javadoc-to-mdoc">This hook is called whenever an item in your options menu is selected.
        ///  The default implementation simply returns false to have the normal
        ///  processing happen (calling the item's Runnable or sending a message to
        ///  its Handler as appropriate). You can use this method for any items
        ///  for which you would like to do processing without those other
        ///  facilities.</para>
        /// <summary>
        /// Raises the options item selected event.
        /// </summary>
        /// <param name="item">Item.</param>
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Android.Resource.Id.Home:
                Activity.NavigateUpTo(new Intent(Activity, typeof(MasterActivity)));
                return(true);

            case Resource.Id.action_display_calendar:
                FragmentManager.BeginTransaction()
                .Add(Resource.Id.activity_detail_container, CalendarFragment.NewInstance(mActivityId))
                .AddToBackStack(null)
                .Hide(this)
                .Commit();
                return(true);

            case Resource.Id.action_new_activity_date:
                var dialog = new AddActivityDateDialogFragment();
                dialog.Show(this);
                return(true);
            }
            return(base.OnOptionsItemSelected(item));
        }