private void SendEventToServer(Feature eventObj) { Task.Run(async() => { try { Feature featureCreated; if (EditFeature == null) { // Create Event featureCreated = await AysaClient.Instance.CreateFeature(eventObj); } else { // Update Event featureCreated = await AysaClient.Instance.UpdateFeature(EditFeature.Id, eventObj); } InvokeOnMainThread(() => { if (EditFeature != null) { // Send filter to EventsViewController to get events by filter if (_delegate != null) { Delegate?.FeatureWasUpdated(featureCreated); } } string successMsj = EditFeature == null ? "La novedad ha sido creado con éxito" : "La novedad ha sido modificado con éxito"; BTProgressHUD.ShowImage(UIImage.FromBundle("ok_icon"), successMsj, 2000); PerformSelector(new Selector("PopViewController"), null, 2.0f); }); } catch (HttpUnauthorized) { InvokeOnMainThread(() => { // Remove progress BTProgressHUD.Dismiss(); ShowSessionExpiredError(); }); } catch (Exception ex) { InvokeOnMainThread(() => { // Remove progress BTProgressHUD.Dismiss(); ShowErrorAlert(ex.Message); CountAttachmentsUploaded = 0; }); } }); }
private void SendObservationToServer(Observation observationObj) { //Show a HUD with a progress spinner and the text BTProgressHUD.Show("Cargando...", -1, ProgressHUD.MaskType.Black); Task.Run(async() => { try { Observation observation = await AysaClient.Instance.CreateObservation(observationObj); InvokeOnMainThread(() => { if (observation != null) { if (EventDetail.Observaciones != null) { // Clear TextField ObservationTextView.Text = ""; // Add observetion in fist position to show it in first place EventDetail.Observaciones.Insert(0, observation); // Reload list of Observations LoadObservationsOfEvent(); } } BTProgressHUD.ShowImage(UIImage.FromBundle("ok_icon"), "La observación ha sido creada con éxito", 2000); }); } catch (HttpUnauthorized) { InvokeOnMainThread(() => { // Remove progress BTProgressHUD.Dismiss(); ShowSessionExpiredError(); }); } catch (Exception ex) { InvokeOnMainThread(() => { // Remove progress BTProgressHUD.Dismiss(); ShowErrorAlert(ex.Message); }); } }); }
public void Show(HUDType type, string msg, int duaration) { switch (type) { case HUDType.Loading: BTProgressHUD.Show(msg, maskType: MaskType.Black); break; case HUDType.Success: BTProgressHUD.ShowImage(UIImage.FromBundle("IconSuccess"), msg, duaration); break; case HUDType.Fail: BTProgressHUD.ShowImage(UIImage.FromBundle("IconFail"), msg, duaration); break; } }
private void RemoveFileFromServer(AttachmentFile file) { //Show a HUD with a progress spinner and the text BTProgressHUD.Show("Cargando...", -1, ProgressHUD.MaskType.Black); Task.Run(async() => { try { AttachmentFile response = await AysaClient.Instance.DeleteFile(file.Id); InvokeOnMainThread(() => { string successMsj = "El evento ha sido eliminado"; BTProgressHUD.ShowImage(UIImage.FromBundle("ok_icon"), successMsj, 2000); // Remove file in view RemoveFileFromView(file); }); } catch (HttpUnauthorized) { InvokeOnMainThread(() => { ShowErrorAlert("No tiene permisos para ejecutar esta acción"); }); } catch (Exception ex) { InvokeOnMainThread(() => { ShowErrorAlert(ex.Message); }); } finally { BTProgressHUD.Dismiss(); } }); }
public override void ShowSuccess(string message, int timeoutMillis) { //this.ShowWithOverlay(timeoutMillis, () => BTProgressHUD.ShowSuccessWithStatus(message, timeoutMillis)); this.ShowWithOverlay(timeoutMillis, () => BTProgressHUD.ShowImage(ProgressHUD.Shared.SuccessImage, message, timeoutMillis)); }
public override void ShowImage(IBitmap image, string message, int timeoutMillis) { this.ShowWithOverlay(timeoutMillis, () => BTProgressHUD.ShowImage(image.ToNative(), message, timeoutMillis)); }
public override void ShowImage(IBitmap image, string message, int timeoutMillis) => BTProgressHUD.ShowImage(image.ToNative(), message, timeoutMillis);
public override void ShowImage(IBitmap image, string message, int timeoutMillis) { UIApplication.SharedApplication.InvokeOnMainThread(() => BTProgressHUD.ShowImage(image.ToNative(), message, timeoutMillis) ); }
public void ShowSharedError(string errorString) { var image = UIImage.FromBundle("warning.png"); BTProgressHUD.ShowImage(image, errorString, 3000); }
public void ShowShareSuccess(string successString) { var image = UIImage.FromBundle("tick.png"); BTProgressHUD.ShowImage(image, successString, 3000); }
public override void ShowImage(object image, string message = null, MaskType mask = MaskType.None, TimeSpan?timeout = default(TimeSpan?), Action clickCallback = null, string cancelCaption = null, Action cancelCallback = null) { BTProgressHUD.ShowImage((UIKit.UIImage)image, message, timeout.HasValue ? timeout.Value.TotalMilliseconds : 1000); }
public override void ShowSuccess(string message, int timeoutMillis) { UIApplication.SharedApplication.InvokeOnMainThread(() => BTProgressHUD.ShowImage(ProgressHUD.Shared.SuccessImage, message, timeoutMillis) ); }
public void ShowSuccessToast(string successText = "Gotowe!") { BTProgressHUD.ForceiOS6LookAndFeel = true; BTProgressHUD.ShowImage(UIImage.FromFile("checked.png"), successText); }
public void ShowFailedToast(string failedText = "Coś poszło nie tak ;/") { BTProgressHUD.ShowImage(UIImage.FromFile("closewindow.png"), failedText); }
public override void ShowError(string message, int timeoutSeconds) { UIApplication.SharedApplication.InvokeOnMainThread(() => BTProgressHUD.ShowImage(ProgressHUD.Shared.ErrorImage, message, timeoutSeconds * 1000) ); }