Example #1
0
        private void ShowAuthError(string email, AuthResult res, Mode mode, bool googleAuth = false)
        {
            DialogFragment dia = null;

            switch (res)
            {
            case AuthResult.InvalidCredentials:
                if (mode == Mode.Login && !googleAuth)
                {
                    dia = new InvalidCredentialsDialogFragment();
                }
                else if (mode == Mode.Signup && !googleAuth)
                {
                    dia = new SignupFailedDialogFragment();
                }
                else if (mode == Mode.Login && googleAuth)
                {
                    dia = new NoAccountDialogFragment();
                }
                else if (mode == Mode.Signup && googleAuth)
                {
                    dia = new SignupFailedDialogFragment();
                }
                break;

            case AuthResult.NoDefaultWorkspace:
                dia = new NoWorkspaceDialogFragment(email);
                break;

            case AuthResult.NetworkError:
                dia = new NetworkErrorDialogFragment();
                break;

            default:
                dia = new SystemErrorDialogFragment();
                break;
            }

            if (dia != null)
            {
                dia.Show(FragmentManager, "auth_result_dialog");
            }
        }
Example #2
0
        private void ShowAuthError (string email, AuthResult res, Mode mode, bool googleAuth=false)
        {
            DialogFragment dia = null;

            switch (res) {
            case AuthResult.InvalidCredentials:
                if (mode == Mode.Login && !googleAuth) {
                    dia = new InvalidCredentialsDialogFragment ();
                } else if (mode == Mode.Signup && !googleAuth) {
                    dia = new SignupFailedDialogFragment ();
                } else if (mode == Mode.Login && googleAuth) {
                    dia = new NoAccountDialogFragment ();
                } else if (mode == Mode.Signup && googleAuth) {
                    dia = new SignupFailedDialogFragment ();
                }
                break;
            case AuthResult.NoDefaultWorkspace:
                dia = new NoWorkspaceDialogFragment (email);
                break;
            case AuthResult.NetworkError:
                dia = new NetworkErrorDialogFragment ();
                break;
            default:
                dia = new SystemErrorDialogFragment ();
                break;
            }

            if (dia != null) {
                dia.Show (FragmentManager, "auth_result_dialog");
            }
        }