示例#1
0
        void ShowErrorDialog(ConnectionResult connectionResult)
        {
            int errorCode = connectionResult.ErrorCode;

            if (GooglePlayServicesUtil.IsUserRecoverableError(errorCode))
            {
                var listener = new DialogInterfaceOnCancelListener();
                listener.OnCancelImpl = (dialog) =>
                {
                    mShouldResolve = false;
                    // UpdateUI(false);
                };
                GooglePlayServicesUtil.GetErrorDialog(errorCode, this, RC_SIGN_IN, listener).Show();
            }
            else
            {
                //var errorstring = string.Format(GetString(Resource.String.play_services_error_fmt), errorCode);
                //Toast.MakeText(this, errorstring, ToastLength.Short).Show();

                mShouldResolve = false;
                //UpdateUI(false);
            }
            HandleResult(new GoogleLoginResult {
                IsSuccess = false, Message = connectionResult.ErrorMessage
            });
        }
示例#2
0
        void ShowErrorDialog(ConnectionResult connectionResult)
        {
            int errorCode = connectionResult.ErrorCode;
            var googleApi = GoogleApiAvailability.Instance;

            if (googleApi.IsUserResolvableError(errorCode))
            {
                var listener = new DialogInterfaceOnCancelListener
                {
                    OnCancelImpl = (dialog) =>
                    {
                        ShouldResolve = false;
                        UpdateUI(false);
                    }
                };
                googleApi.GetErrorDialog(this, errorCode, RC_SIGN_IN, listener).Show();
            }
            else
            {
                var errorstring = string.Format(GetString(Resource.String.play_services_error_fmt), errorCode);
                Toast.MakeText(this, errorstring, ToastLength.Short).Show();

                ShouldResolve = false;
                UpdateUI(false);
            }
        }
示例#3
0
        void ShowErrorDialog(ConnectionResult connectionResult)
        {
            int errorCode = connectionResult.ErrorCode;

            if (GoogleApiAvailability.Instance.IsUserResolvableError(errorCode))
            {
                var listener = new DialogInterfaceOnCancelListener();
                listener.OnCancelImpl = (dialog) =>
                {
                    mShouldResolve = false;
                };
                GoogleApiAvailability.Instance.GetErrorDialog(this, errorCode, RC_SIGN_IN, listener).Show();
            }
            else
            {
                mShouldResolve = false;
            }
            HandleResult(mAuth);
        }
        void ShowErrorDialog(ConnectionResult connectionResult)
        {
            int errorCode = connectionResult.ErrorCode;

            if (GooglePlayServicesUtil.IsUserRecoverableError(errorCode))
            {
                var listener = new DialogInterfaceOnCancelListener();
                listener.OnCancelImpl = (dialog) =>
                {
                    mShouldResolve = false;
                };
                GooglePlayServicesUtil.GetErrorDialog(errorCode, this, RC_SIGN_IN, listener).Show();
            }
            else
            {
                mShouldResolve = false;
            }
            HandleResult(new GoogleLoginResult {
                IsSuccess = false, Message = connectionResult.ErrorMessage
            });
        }
示例#5
0
        void ShowErrorDialog(ConnectionResult connectionResult)
        {
            int errorCode = connectionResult.ErrorCode;

            if (GooglePlayServicesUtil.IsUserRecoverableError(errorCode))
            {
                var listener = new DialogInterfaceOnCancelListener();
                listener.OnCancelImpl = (dialog) => {
                    mShouldResolve = false;
                    UpdateUI(false);
                };
                GooglePlayServicesUtil.GetErrorDialog(errorCode, this, RC_SIGN_IN, listener).Show();
            }
            else
            {
                var errorstring = string.Format("{0}", errorCode);
                Toast.MakeText(this, errorstring, ToastLength.Short).Show();

                mShouldResolve = false;
                UpdateUI(false);
            }
        }
示例#6
0
        public static Task <string> ShowDialog(Context context, string title, params string[] items)
        {
            var tcs = new TaskCompletionSource <string>();

            AlertDialog.Builder builder = new AlertDialog.Builder(context);
            builder.SetTitle(title);
            //public Builder SetSingleChoiceItems(string[] items, int checkedItem, EventHandler<DialogClickEventArgs> handler);
            builder.SetItems(items, (s, e) =>
            {
                var item = items[e.Which];
                tcs.SetResult(item);
                var dialog = s as AlertDialog;
                dialog.Dismiss();
            });
            var listener = new DialogInterfaceOnCancelListener(tcs);

            builder.SetOnCancelListener(listener);
            builder.SetNegativeButton("Cancel", (senderAlert, args) =>
            {
                tcs.SetResult("");
            });
            builder.Create().Show();
            return(tcs.Task);
        }
		void ShowErrorDialog (ConnectionResult connectionResult)
		{
			int errorCode = connectionResult.ErrorCode;

			if (GooglePlayServicesUtil.IsUserRecoverableError (errorCode)) {
				var listener = new DialogInterfaceOnCancelListener ();
				listener.OnCancelImpl = (dialog) => {
					mShouldResolve = false;
					UpdateUI (false);
				};
				GooglePlayServicesUtil.GetErrorDialog (errorCode, this, RC_SIGN_IN, listener).Show ();
			} else {
				var errorstring = string.Format(GetString (Resource.String.play_services_error_fmt), errorCode);
				Toast.MakeText (this, errorstring, ToastLength.Short).Show ();

				mShouldResolve = false;
				UpdateUI (false);
			}
		}
示例#8
0
        void ShowErrorDialog (ConnectionResult connectionResult)
        {
            int errorCode = connectionResult.ErrorCode;

            if (GooglePlayServicesUtil.IsUserRecoverableError (errorCode))
            {
                var listener = new DialogInterfaceOnCancelListener ();
                listener.OnCancelImpl = (dialog) =>
                {
                    mShouldResolve = false;
                    UpdateUI (false);
                };
                GooglePlayServicesUtil.GetErrorDialog (errorCode, Activity, RC_SIGN_IN, listener).Show ();
            }
            else {
                Snackbar.Make (_view, Resource.String.play_services_error_fmt, Snackbar.LengthShort).Show ();

                mShouldResolve = false;
                UpdateUI (false);
            }
        }