コード例 #1
0
        public static ReminderDateDialog NewInstance(Bundle bundle)
        {
            ReminderDateDialog fragment = new ReminderDateDialog();

            fragment.Arguments = bundle;
            return(fragment);
        }
コード例 #2
0
        public void closeDateDialog(ReminderDateDialog dialog)
        {
            FragmentTransaction ft = FragmentManager.BeginTransaction();

            ft.Remove(dialog);

            ft.AddToBackStack("close-time");
            //ft.Commit();
            dateDialog = dialog;
            //Also tried i.e. dialog.Dismiss(); here
        }
コード例 #3
0
        public void openDateDialog(int id, Bundle bundle)
        {
            Console.WriteLine("Trying to open new date dialog!");
            FragmentTransaction ft = FragmentManager.BeginTransaction();
            //Remove fragment else it will crash as it is already added to backstack
            Fragment prev = FragmentManager.FindFragmentByTag("dialog");

            if (prev != null)
            {
                ft.Remove(prev);
            }

            ft.AddToBackStack("date-dialog");

            // Create and show the dialog.


            //Add fragment



            Bundle taskdata = new Bundle();

            taskdata.PutInt("id", 3);
            taskdata.PutInt("day", 9);
            taskdata.PutInt("month", 11);
            taskdata.PutInt("year", 2017);
            Console.WriteLine("Opening new date dialog!");
            ReminderDateDialog dateDialog = ReminderDateDialog.NewInstance(taskdata);

            dateDialog.Arguments = taskdata;
            dateDialog.SetStyle(DialogFragmentStyle.NoTitle, 0);//TODO: Create own theme and style
            dateDialog.Show(ft, "dialog");

            //ft.Commit();//added by winffee
        }