Ejemplo n.º 1
0
        /// <summary>
        /// Gets the details of the mail.
        /// </summary>
        async void GetDetails()
        {
            if (IosUtils.IosUtility.IsReachable())
            {
                IosUtils.IosUtility.showProgressHud("");
                var desc = await WebServiceMethods.EmailDetail(mail.MailId, IosUtils.Settings.UserId);

                if (desc != null)
                {
                    IBContnTxt.AttributedText = GetAttributedStringFromHtml(desc);
                }
                IosUtils.IosUtility.hideProgressHud();
            }
        }
        private async void GetEmailDetails(string mailId, string userId)
        {
            try
            {
                if (CrossConnectivity.Current.IsConnected)
                {
                    CustomProgressDialog.ShowProgDialog(mActivity, null);



                    string emailDetail = await WebServiceMethods.EmailDetail(mailId, userId);

                    if (emailDetail != null)
                    {
                        //WebView webview = FindViewById<WebView>(Resource.Id.webview);
                        // webview.Settings.JavaScriptEnabled = true;
                        // webview.LoadData(emailDetail, "text/html; charset=utf-8", "UTF-8");

                        TextView textview = FindViewById <TextView>(Resource.Id.webview);
                        textview.SetText(Html.FromHtml(emailDetail), TextView.BufferType.Spannable);

                        CustomProgressDialog.HideProgressDialog();
                    }
                    else
                    {
                        CustomProgressDialog.HideProgressDialog();
                        UtilityDroid.GetInstance().ShowAlertDialog(mActivity, Resources.GetString(Resource.String.error_alert_title),
                                                                   Resources.GetString(Resource.String.alert_message_error),
                                                                   Resources.GetString(Resource.String.alert_cancel_btn), Resources.GetString(Resource.String.alert_ok_btn));
                    }
                }
                else
                {
                    UtilityDroid.GetInstance().ShowAlertDialog(mActivity, Resources.GetString(Resource.String.error_alert_title),
                                                               Resources.GetString(Resource.String.alert_message_no_network_connection),
                                                               Resources.GetString(Resource.String.alert_cancel_btn), Resources.GetString(Resource.String.alert_ok_btn));
                }
            }
            catch (Exception)
            {
                CustomProgressDialog.HideProgressDialog();
                UtilityDroid.GetInstance().ShowAlertDialog(mActivity, Resources.GetString(Resource.String.error_alert_title),
                                                           Resources.GetString(Resource.String.alert_message_invalid_credentials),
                                                           Resources.GetString(Resource.String.alert_cancel_btn), Resources.GetString(Resource.String.alert_ok_btn));
            }
        }