Beispiel #1
0
            void OnActionSheetRequested(Page sender, ActionSheetArguments arguments)
            {
                // Verify that the page making the request is part of this activity
                if (!PageIsInThisContext(sender))
                {
                    return;
                }

                var builder = new DialogBuilder(Activity);

                builder.SetTitle(arguments.Title);
                string[] items = arguments.Buttons.ToArray();
                builder.SetItems(items, (o, args) => arguments.Result.TrySetResult(items[args.Which]));

                if (arguments.Cancel != null)
                {
                    builder.SetPositiveButton(arguments.Cancel, (o, args) => arguments.Result.TrySetResult(arguments.Cancel));
                }

                if (arguments.Destruction != null)
                {
                    builder.SetNegativeButton(arguments.Destruction, (o, args) => arguments.Result.TrySetResult(arguments.Destruction));
                }

                var dialog = builder.Create();

                builder.Dispose();
                //to match current functionality of renderer we set cancelable on outside
                //and return null
                dialog.SetCanceledOnTouchOutside(true);
                dialog.SetCancelEvent((o, e) => arguments.SetResult(null));
                dialog.Show();
            }
        public override PlayerDialog SetUp(uint player)
        {
            var dialog = DialogBuilder.Create()
                         .AddPage(MainPageId, MainPageInit)
                         .Build();

            return(dialog);
        }
Beispiel #3
0
            void OnActionSheetRequested(Page sender, ActionSheetArguments arguments)
            {
                // Verify that the page making the request is part of this activity
                if (!PageIsInThisContext(sender))
                {
                    return;
                }

                var builder = new DialogBuilder(Activity);

                builder.SetTitle(arguments.Title);
                string[] items = arguments.Buttons.ToArray();
                builder.SetItems(items, (o, args) => arguments.Result.TrySetResult(items[args.Which]));

                if (arguments.Cancel != null)
                {
                    builder.SetPositiveButton(arguments.Cancel, (o, args) => arguments.Result.TrySetResult(arguments.Cancel));
                }

                if (arguments.Destruction != null)
                {
                    builder.SetNegativeButton(arguments.Destruction, (o, args) => arguments.Result.TrySetResult(arguments.Destruction));
                }

                var dialog = builder.Create();

                builder.Dispose();
                //to match current functionality of renderer we set cancelable on outside
                //and return null
                if (arguments.FlowDirection == FlowDirection.MatchParent && sender is IVisualElementController ve)
                {
                    dialog.Window.DecorView.UpdateFlowDirection(ve);
                }
                else if (arguments.FlowDirection == FlowDirection.LeftToRight)
                {
                    dialog.Window.DecorView.LayoutDirection = LayoutDirection.Ltr;
                }
                else if (arguments.FlowDirection == FlowDirection.RightToLeft)
                {
                    dialog.Window.DecorView.LayoutDirection = LayoutDirection.Rtl;
                }

                dialog.SetCanceledOnTouchOutside(true);
                dialog.SetCancelEvent((o, e) => arguments.SetResult(null));
                dialog.Show();

                dialog.GetListView().TextDirection = GetTextDirection(sender, arguments.FlowDirection);
                LayoutDirection layoutDirection    = GetLayoutDirection(sender, arguments.FlowDirection);

                if (arguments.Cancel != null)
                {
                    ((dialog.GetButton((int)DialogButtonType.Positive).Parent) as global::Android.Views.View).LayoutDirection = layoutDirection;
                }
                if (arguments.Destruction != null)
                {
                    ((dialog.GetButton((int)DialogButtonType.Negative).Parent) as global::Android.Views.View).LayoutDirection = layoutDirection;
                }
            }
Beispiel #4
0
    public override void OnRootScreenBack()
    {
        DialogInterface dialog = DialogBuilder.Create(DialogBuilder.DialogType.CHOICE_DIALOG);

        dialog.SetMessage("Go back to main menu?");
        dialog.SetOnConfirmListener(() => {
            LoadManager.Instance.LoadScene(SceneNames.MAIN_SCENE);
        });
    }
Beispiel #5
0
    public override void OnRootScreenBack()
    {
        DialogInterface dialog = DialogBuilder.Create(DialogBuilder.DialogType.CHOICE_DIALOG);

        dialog.SetMessage("Exit the application?");
        dialog.SetOnConfirmListener(() => {
            Application.Quit();
        });
    }
    public void OnMainMenuClicked()
    {
        DialogInterface choiceDialog = DialogBuilder.Create(DialogBuilder.DialogType.CHOICE_DIALOG);

        choiceDialog.SetMessage("Are you sure? All progress wil be lost.");
        choiceDialog.SetOnConfirmListener(() => {
            SceneManager.LoadScene(SceneNames.MAIN_MENU_SCENE);
        });
    }
Beispiel #7
0
    public override void OnRootScreenBack()
    {
        base.OnRootScreenBack();
        TwoChoiceDialog twoChoiceDialog = (TwoChoiceDialog)DialogBuilder.Create(DialogBuilder.DialogType.CHOICE_DIALOG);

        twoChoiceDialog.SetMessage("Go back to main menu?");
        twoChoiceDialog.SetOnConfirmListener(() => {
            LoadManager.Instance.LoadScene(SceneNames.MAIN_SCENE);
        });
    }
    public void DisplayExitDialog()
    {
        Debug.Log("Display");
        DialogInterface dialog = DialogBuilder.Create(DialogBuilder.DialogType.CHOICE_DIALOG);

        dialog.SetMessage("Are you sure you want to go back?");
        dialog.SetOnConfirmListener(() => {
            LoadManager.Instance.LoadScene(SceneNames.MAIN_SCENE);
        });
    }
    public void DisplayTestDialog()
    {
        DialogInterface dialog = DialogBuilder.Create(DialogBuilder.DialogType.NOTIFICATION);

        dialog.SetMessage("Test");
        dialog.SetOnDismissListener(() => {
            DialogInterface addedDialog = DialogBuilder.Create(DialogBuilder.DialogType.NOTIFICATION);
            addedDialog.SetMessage("Another test");
        });
    }
Beispiel #10
0
    public void OnQuitClicked()
    {
        Debug.Log("Quit Clicked!");
        TwoChoiceDialog dialog = (TwoChoiceDialog)DialogBuilder.Create(DialogBuilder.DialogType.CHOICE_DIALOG);

        dialog.SetMessage("Are you sure you want to quit the game?");
        dialog.SetConfirmText("YES");
        dialog.SetCancelText("No");
        dialog.SetOnConfirmListener(() =>
        {
            Debug.Log("About to quit");
            Application.Quit();
        });
    }
Beispiel #11
0
        public override PlayerDialog SetUp(uint player)
        {
            var dialog = DialogBuilder.Create()
                         .WithDataModel(new Model())
                         .AddBackAction((oldPage, newPage) =>
            {
                var model            = GetDataModel <Model>();
                model.IsConfirming   = false;
                model.XPDistributing = 0;
            })
                         .AddPage(CategorySelectionId, SkillCategorySelectionInit)
                         .AddPage(SkillSelectionId, SkillSelectionInit)
                         .AddPage(SkillDetailsId, SkillDetailsInit)
                         .AddPage(DistributeXPId, DistributeXPAmountInit);

            return(dialog.Build());
        }
Beispiel #12
0
    public void OnTestPopupClicked()
    {
        NotificationDialog notifDiaglog = (NotificationDialog)DialogBuilder.Create(DialogBuilder.DialogType.NOTIFICATION);

        notifDiaglog.SetMessage("Test popup");
    }