Esempio n. 1
0
        private void Fab_Click(object sender, EventArgs e)
        {
            Log.Debug(TAG, $"{nameof(Fab_Click)} - try to show ReportFragment like dialog - START");

            // DialogFragment.show() will take care of adding the fragment
            // in a transaction.  We also want to remove any currently showing
            // dialog, so make our own transaction and take care of that here.
            FragmentTransaction ft   = FragmentManager.BeginTransaction();
            Fragment            prev = FragmentManager.FindFragmentByTag("dialog");

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


            // Create and show the dialog.
            DialogFragment newFragment = ReportFragment.NewInstance(null, delegate()
            {
                var r = LoadData();

                this.Activity.RunOnUiThread(() =>
                {
                    InitLayout(true, false);
                });
            });

            newFragment.Show(ft, "dialog");

            Log.Debug(TAG, $"{nameof(Fab_Click)} - try to show ReportFragment like dialog - END");
        }
Esempio n. 2
0
        private void OnListItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            Log.Debug(TAG, nameof(OnListItemClick));

            var item = listData.ElementAt(e.Position);
            FragmentTransaction ft   = FragmentManager.BeginTransaction();
            Fragment            prev = FragmentManager.FindFragmentByTag("dialog");

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

            Log.Debug(TAG, $"{nameof(OnListItemClick)} - try to show ReportFragment like dialog - START");
            // Create and show the dialog.
            DialogFragment newFragment = ReportFragment.NewInstance(item.IncludeObjects(db), delegate()
            {
                var r = LoadData(((JavaLangObjectWrapper <DateTime>)dateFrom_button.Tag).Value, ((JavaLangObjectWrapper <DateTime>)dateTo_button.Tag).Value, costs_checkBox.Checked, earnings_checkBox.Checked);//.Result;
            });


            newFragment.Show(ft, "dialog");
            Log.Debug(TAG, $"{nameof(OnListItemClick)} - try to show ReportFragment like dialog - END");
        }
Esempio n. 3
0
        private void AddRecurringPayment_button_Click(object sender, EventArgs e)
        {
            Log.Debug(TAG, nameof(AddRecurringPayment_button_Click));

            FragmentTransaction ft   = FragmentManager.BeginTransaction();
            Fragment            prev = FragmentManager.FindFragmentByTag("dialog");

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

            Log.Debug(TAG, $"{nameof(AddRecurringPayment_button_Click)} - try to show RecurringPaymentFragment like dialog - START");
            // Create and show the dialog.
            DialogFragment newFragment = RecurringPaymentFragment.NewInstance(null, delegate()
            {
                var r = LoadData();
            });

            Log.Debug(TAG, $"{nameof(AddRecurringPayment_button_Click)} - 1");

            newFragment.Show(ft, "dialog");
            Log.Debug(TAG, $"{nameof(AddRecurringPayment_button_Click)} - try to show ReportFragment like dialog - END");
        }
        void ShowDialog()
        {
            DialogFragment newFragment = MyAlertDialogFragment.NewInstance(
                R.Strings.alert_dialog_two_buttons_title);

            newFragment.Show(GetSupportFragmentManager(), "dialog");
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.NewGame, container, false);

            var adapter = new SpinnerAdapter(this.Activity, Resource.Layout.Row, mTeams.ToArray());

            // Set Home Team
            mHomeTeamName               = view.FindViewById <Spinner>(Resource.Id.homeTeam);
            mHomeTeamName.Adapter       = adapter;
            mHomeTeamName.ItemSelected += setTeam;

            // Set Away Team
            mAwayTeamName               = view.FindViewById <Spinner>(Resource.Id.awayTeam);
            mAwayTeamName.Adapter       = adapter;
            mAwayTeamName.ItemSelected += setTeam;

            // Set Overs
            mOvers               = view.FindViewById <Spinner>(Resource.Id.overs);
            mOvers.Adapter       = new SpinnerAdapter(this.Activity, Resource.Layout.Row, mOversArray);
            mOvers.ItemSelected += setOvers;

            // Set Location
            mLocation               = view.FindViewById <Spinner>(Resource.Id.location);
            mLocation.Adapter       = new SpinnerAdapter(this.Activity, Resource.Layout.Row, Locations.ToArray());
            mLocation.ItemSelected += setLocation;

            // Set Umpire one
            mUmpireOne               = view.FindViewById <Spinner>(Resource.Id.umpire1);
            mUmpireOne.Adapter       = new SpinnerAdapter(this.Activity, Resource.Layout.Row, Umpires.ToArray());
            mUmpireOne.ItemSelected += setUmpires;

            // Set Umpire two
            mUmpireTwo               = view.FindViewById <Spinner>(Resource.Id.umpire2);
            mUmpireTwo.Adapter       = new SpinnerAdapter(this.Activity, Resource.Layout.Row, Umpires.ToArray());
            mUmpireTwo.ItemSelected += setUmpires;

            // Create Match
            mCreateMatchBtn         = view.FindViewById <Button>(Resource.Id.createMatchButton);
            mCreateMatchBtn.Enabled = false;
            mCreateMatchBtn.Click  += (object sender, EventArgs e) =>
            {
                int matchId = AddMatch();
                if (matchId == 0)
                {
                    return;
                }
                var currentMatchActivity = new Intent(this.Activity, typeof(CurrentMatchActivity));
                currentMatchActivity.PutExtra("MatchId", matchId);
                StartActivity(currentMatchActivity);
                Fragment prev = (DialogFragment)FragmentManager.FindFragmentByTag("newgame dialog");
                if (prev != null)
                {
                    DialogFragment df = (DialogFragment)prev;
                    df.Dismiss();
                }
            };

            return(view);
        }
Esempio n. 6
0
        private void Button_Zmien_Dane_Click(object sender, EventArgs e)
        {
            FragmentTransaction transaction = FragmentManager.BeginTransaction();
            DialogFragment      diag        = new DialogFragment();

            diag.Show(transaction, "Dialog fragment");
        }
Esempio n. 7
0
        private bool isShowingErrorDialog()
        {
            DialogFragment errorDialog =
                (DialogFragment)GetFragmentManager().FindFragmentByTag(TAG_ERROR_DIALOG);

            return(errorDialog != null && !errorDialog.IsHidden());
        }
        void ShowDialog()
        {
            // Create the fragment and show it as a dialog.
            DialogFragment newFragment = MyDialogFragment.NewInstance();

            newFragment.Show(GetSupportFragmentManager(), "dialog");
        }
        public ContactsListAdapter(Activity activity, DialogFragment parentFragment)
        {
            _activity       = activity;
            _parentFragment = parentFragment;

            _contacts = new List <Model.Contact>();

            GetAllContactsData();
        }
Esempio n. 10
0
 public void onClick()
 {
     DialogFragment.showDialogFragment(title: "質問", message: "たい焼きはつぶ餡派?",
                                       positiveMessage: "YES",
                                       positiveCallbackName: ((Action)onDialogPositiveButton).Method.Name,
                                       negativeMessage: "NO",
                                       negativeCallbackName: ((Action)onDialogNegativeButton).Method.Name,
                                       gameObjectName: gameObject.name);
 }
Esempio n. 11
0
        private void hideErrorDialog()
        {
            DialogFragment errorDialog =
                (DialogFragment)GetFragmentManager().FindFragmentByTag(TAG_ERROR_DIALOG);

            if (errorDialog != null)
            {
                errorDialog.Dismiss();
            }
        }
Esempio n. 12
0
        private void showProgressDialog()
        {
            DialogFragment progressDialog =
                (DialogFragment)GetFragmentManager().FindFragmentByTag(TAG_PROGRESS_DIALOG);

            if (progressDialog == null)
            {
                progressDialog = ProgressDialogFragment.create();
                progressDialog.Show(GetFragmentManager(), TAG_PROGRESS_DIALOG);
            }
        }
Esempio n. 13
0
        void ShowDialog(String text)
        {
            // DialogFragment.show() will take care of adding the fragment
            // in a transaction.  We also want to remove any currently showing
            // dialog, so make our own transaction and take care of that here.
            FragmentTransaction ft = FragmentManager.BeginTransaction();

            DialogFragment newFragment = MyDialogFragment.NewInstance(text);

            // Show the dialog.
            newFragment.Show(ft, "dialog");
        }
Esempio n. 14
0
        private void showErrorDialog(DialogFragment errorDialog)
        {
            DialogFragment oldErrorDialog =
                (DialogFragment)GetFragmentManager().FindFragmentByTag(TAG_ERROR_DIALOG);

            if (oldErrorDialog != null)
            {
                oldErrorDialog.Dismiss();
            }

            errorDialog.Show(GetFragmentManager(), TAG_ERROR_DIALOG);
        }
Esempio n. 15
0
            /// <summary>
            /// Called when the permission request is canceled by the web content.
            /// </summary>
            /// <param name="request">Request.</param>
            public override void OnPermissionRequestCanceled(Android.Webkit.PermissionRequest request)
            {
                Log.Info(TAG, "onPermissionRequestCanceled");
                // We dismiss the prompt UI here as the request is no longer valid.
                permissionReqFrag.mPermissionRequest = null;
                DialogFragment fragment = (DialogFragment)permissionReqFrag.ChildFragmentManager
                                          .FindFragmentByTag(FRAGMENT_DIALOG);

                if (null != fragment)
                {
                    fragment.Dismiss();
                }
            }
Esempio n. 16
0
 public void onDialogPositiveClick(DialogFragment dialog, string otpEntered)
 {
     if (otpEntered.Equals(otpRecieved))
     {
         Intent intent = new Intent(this, typeof(RequestPasswordActivity));
         intent.PutExtra("mobile", mobile.Text);
         StartActivity(intent);
     }
     else
     {
         Toast.MakeText(ApplicationContext, "Invalid OTP", ToastLength.Short).Show();
         return;
     }
 }
Esempio n. 17
0
        protected void hideProgressDialog()
        {
            FragmentManager manager = GetFragmentManager();

            if (manager != null)
            {
                DialogFragment progressDialog = (DialogFragment)manager
                                                .FindFragmentByTag(TAG_PROGRESS_DIALOG);
                if (progressDialog != null)
                {
                    progressDialog.Dismiss();
                }
            }
        }
Esempio n. 18
0
        private void Adapter_ClickedObject(object sender, object e)
        {
            FragmentTransaction ft   = Activity.SupportFragmentManager.BeginTransaction();
            Fragment            prev = Activity.SupportFragmentManager.FindFragmentByTag("eventdialog");

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

            DialogFragment dialog = EventDialogFragment.Instance(e as MatchEventModel);

            dialog.Show(ft, "dialog");
        }
Esempio n. 19
0
        private void OnListItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e)
        {
            Log.Debug(TAG, nameof(OnListItemLongClick));

            var item = listData.ElementAt(e.Position);

            Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this.Activity);
            builder.SetMessage(item.ToString())
            .SetPositiveButton(this.Activity.Resources.GetString(Resource.String.Edit), (s, args) =>
            {
                // DialogFragment.show() will take care of adding the fragment
                // in a transaction.  We also want to remove any currently showing
                // dialog, so make our own transaction and take care of that here.
                FragmentTransaction ft = FragmentManager.BeginTransaction();
                Fragment prev          = FragmentManager.FindFragmentByTag("dialog");
                if (prev != null)
                {
                    ft.Remove(prev);
                }
                ft.AddToBackStack(null);

                Log.Debug(TAG, $"{nameof(OnListItemLongClick)} - try to show ReportFragment like dialog - START");
                // Create and show the dialog.
                DialogFragment newFragment = ReportFragment.NewInstance(item.IncludeObjects(db), delegate()
                {
                    var r = LoadData(((JavaLangObjectWrapper <DateTime>)dateFrom_button.Tag).Value, ((JavaLangObjectWrapper <DateTime>)dateTo_button.Tag).Value, costs_checkBox.Checked, earnings_checkBox.Checked);  //.Result;
                });


                newFragment.Show(ft, "dialog");
                Log.Debug(TAG, $"{nameof(OnListItemLongClick)} - try to show ReportFragment like dialog - END");
            })
            //.SetNegativeButton("No", dialogClickListener)
            .SetNegativeButton(this.Activity.Resources.GetString(Resource.String.Delete), (s, args) =>
            {
                if (db.Delete(item).Result)
                {
                    Toast.MakeText(this.Activity, Resources.GetString(Resource.String.Deleted), ToastLength.Short).Show();

                    var r = LoadData(((JavaLangObjectWrapper <DateTime>)dateFrom_button.Tag).Value, ((JavaLangObjectWrapper <DateTime>)dateTo_button.Tag).Value, costs_checkBox.Checked, earnings_checkBox.Checked);  //.Result;
                }
                else
                {
                    Toast.MakeText(this.Activity, Resources.GetString(Resource.String.WasntDeleted), ToastLength.Short).Show();
                }
            })
            .Show();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(R.Layouts.fragment_dialog_or_activity);

            if (savedInstanceState == null)
            {
                // First-time init; create fragment to embed in activity.

                FragmentTransaction ft          = GetSupportFragmentManager().BeginTransaction();
                DialogFragment      newFragment = MyDialogFragment.NewInstance();
                ft.Add(R.Ids.embedded, newFragment);
                ft.Commit();
            }

            // Watch for button clicks.
            Button button = (Button)FindViewById(R.Ids.show_dialog);

            button.Click += (x, y) => ShowDialog();
        }
Esempio n. 21
0
        void ShowDialog()
        {
            mStackLevel++;

            // DialogFragment.Show() will take care of Adding the fragment
            // in a transaction.  We also want to remove any currently showing
            // dialog, so make our own transaction and take care of that here.
            FragmentTransaction ft   = GetSupportFragmentManager().BeginTransaction();
            Fragment            prev = GetSupportFragmentManager().FindFragmentByTag("dialog");

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

            // Create and show the dialog.
            DialogFragment newFragment = MyDialogFragment.NewInstance(mStackLevel);

            newFragment.Show(ft, "dialog");
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.NewGameView, container, false);

            mHomeTeamName = view.FindViewById <Spinner>(Resource.Id.homeTeam);
            mAwayTeamName = view.FindViewById <Spinner>(Resource.Id.awayTeam);
            var overs_tournaments = view.FindViewById <TextView>(Resource.Id.overs_tournaments_label);

            mOversOrTournaments = view.FindViewById <Spinner>(Resource.Id.overs_tournaments_values);
            mLocation           = view.FindViewById <Spinner>(Resource.Id.location);
            mUmpireOne          = view.FindViewById <Spinner>(Resource.Id.umpire1);
            mUmpireTwo          = view.FindViewById <Spinner>(Resource.Id.umpire2);

            mCreateMatchBtn         = view.FindViewById <Button>(Resource.Id.createMatchButton);
            mCreateMatchBtn.Enabled = false;
            mCreateMatchBtn.Click  += (object sender, EventArgs e) =>
            {
                var hometeamname       = mHomeTeamName.SelectedItem.ToString();
                var awayteamname       = mAwayTeamName.SelectedItem.ToString();
                var oversOrTournaments = mOversOrTournaments.SelectedItem.ToString();
                var location           = mLocation.SelectedItem.ToString();
                var primaryumpire      = mUmpireOne.SelectedItem.ToString();
                var secondaryumpire    = mUmpireTwo.SelectedItem.ToString();

                var match = ViewModel.AddMatch(hometeamname, awayteamname, oversOrTournaments, location, primaryumpire, secondaryumpire);
                var currentMatchActivity = new Intent(this.Activity, typeof(MatchActivity));
                currentMatchActivity.PutExtra("MatchId", match.Id);
                StartActivity(currentMatchActivity);
                Fragment prev = (DialogFragment)FragmentManager.FindFragmentByTag("newgame dialog");
                if (prev != null)
                {
                    DialogFragment df = (DialogFragment)prev;
                    df.Dismiss();
                }
            };

            return(view);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.DialogDeclare, container, false);

            // Set match result
            mMatchResult               = view.FindViewById <Spinner>(Resource.Id.matchresult);
            mMatchResult.Adapter       = new SpinnerAdapter(this.Activity, Resource.Layout.Row, MatchResults);
            mMatchResult.ItemSelected += setMatchResult;

            // Set winning team
            mWinner         = view.FindViewById <Spinner>(Resource.Id.winner);
            mWinner.Adapter = new SpinnerAdapter(this.Activity, Resource.Layout.Row, TeamNames.ToArray());
            mWinner.Enabled = false;

            mComment = view.FindViewById <EditText>(Resource.Id.comments);

            // Declare match
            mDeclareMatch        = view.FindViewById <Button>(Resource.Id.declarematch);
            mDeclareMatch.Click += (object sender, EventArgs e) =>
            {
                Match.Comments        = mComment.Text;
                Match.Complete        = true;
                Match.WinningTeamName = mWinner.SelectedItem.ToString();
                Access.MatchService.UpdateMatch(Match);

                var currentMatchActivity = new Intent(this.Activity, typeof(CurrentMatchActivity));
                currentMatchActivity.PutExtra("MatchId", Match.Id);
                StartActivity(currentMatchActivity);
                Fragment prev = (DialogFragment)FragmentManager.FindFragmentByTag("declare dialog");
                if (prev != null)
                {
                    DialogFragment df = (DialogFragment)prev;
                    df.Dismiss();
                }
            };
            return(view);
        }
      private void showErrorDialog(DialogFragment errorDialog)
      {
         DialogFragment oldErrorDialog =
                 (DialogFragment)GetFragmentManager().FindFragmentByTag(TAG_ERROR_DIALOG);
         if (oldErrorDialog != null)
         {
            oldErrorDialog.Dismiss();
         }

         errorDialog.Show(GetFragmentManager(), TAG_ERROR_DIALOG);
      }
Esempio n. 25
0
 public DialogFragmentInnerStack(NavigationStack <TViewModel> navigationStack, ActivityInnerStack <TViewModel> fragmentHost, DialogFragment fragment) : base(navigationStack)
 {
     FragmentHost = fragmentHost;
     Fragment     = fragment;
     FragmentTag  = $"{Fragment.GetType().Name}+{Guid.NewGuid():N}";
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="MediatorBase{TTarget}" /> class.
 /// </summary>
 public MvvmFragmentMediator([NotNull] Fragment target)
     : base(target)
 {
     _dialogFragment = target as DialogFragment;
 }