async Task SaveData()
        {
            loadingOverlay = new LoadingOverlay(UIScreen.MainScreen.Bounds);//, "Saving Data...");
            View.Add(loadingOverlay);

            try
            {
                await DoSaveData();

                if (saveMessage != null)
                {
                    new UIAlertView("Save", "Employee Added", null, "OK", null).Show();
                    var signut = Storyboard.InstantiateViewController("EmployeeListSignoutViewController") as EmployeeListSignoutViewController;
                    NavigationController.PushViewController(signut, true);
                }
                else
                {
                    new UIAlertView("Error", "Error while Saving", null, "Calcel", null).Show();
                }
            }
            catch (Exception ex)
            {
                if (ex != null)
                {
                    saveMessage = "Error occured Saving data";
                }
                System.Console.WriteLine(ex.Message);
            }
            finally
            {
                loadingOverlay.Hide();
            }
        }
        public async void GetConsumptionDetails(ConsumptionFor currentConsumption, int Id)
        {
            InvokeOnMainThread(() =>
            {
                // Added for showing loading screen
                var bounds = UIScreen.MainScreen.Bounds;
                // show the loading overlay on the UI thread using the correct orientation sizing
                loadingOverlay = new LoadingOverlay(bounds);
                View.Add(loadingOverlay);
            });

            string url = GetConsumptionURL(currentConsumption);

            if (Id != 0)
            {
                url = url + "/" + Convert.ToString(Id);
            }
            var responseConsumption = await InvokeApi.Invoke(url, string.Empty, HttpMethod.Get, PreferenceHandler.GetToken(), IOSUtil.CurrentStage);

            if (responseConsumption.StatusCode == HttpStatusCode.OK)
            {
                GetConsumptionResponse(responseConsumption);
            }
            else if (responseConsumption.StatusCode == HttpStatusCode.BadRequest || responseConsumption.StatusCode == HttpStatusCode.Unauthorized)
            {
                await IOSUtil.RefreshToken(this, loadingOverlay);
            }
        }
		public override void ViewWillAppear (bool animated)
		{
			base.ViewWillAppear (animated);

			if(this.PatientFileUpdateManager.UpdateInProgress) {
				if (this.loadingOverlay == null) {
					var bounds = new RectangleF(0,0,768,1004);
					if (this.InterfaceOrientation == UIInterfaceOrientation.LandscapeLeft
					|| this.InterfaceOrientation == UIInterfaceOrientation.LandscapeRight) {
						bounds = new RectangleF(0,0,1024,748);	
					} 

					this.loadingOverlay = new LoadingOverlay (bounds);
					// because DialogViewController is a UITableViewController,
					// we need to step OVER the UITableView, otherwise the loadingOverlay
					// sits *in* the scrolling area of the table
					this.View.Superview.Add (this.loadingOverlay); 
					this.View.Superview.BringSubviewToFront (this.loadingOverlay);
				}
				ConsoleD.WriteLine("Waiting for updates to finish before displaying table.");
			} else {
				this.loadingOverlay = null;
				if (this.AlwaysRefresh || this.Root == null || this.Root.Count == 0) {
					ConsoleD.WriteLine("Not updating, populating table.");
					this.PopulateTable();
				} else ConsoleD.WriteLine("Data already populated.");
			}
		}
Esempio n. 4
0
        protected override void OnShown(EventArgs e)
        {
            _loadingOverlay = LoadingOverlay.PutOn(this);
            _loadingOverlay.CancelRequested += LoadingOverlay_CancelRequested;

            _overlays = new Dictionary <OverlayState, Control>();
            _overlays[OverlayState.Empty]   = EmptyOverlay.PutOn(this);
            _overlays[OverlayState.Loading] = _loadingOverlay;
            var recordingOverlay = RecordingOverlay.PutOn(this);

            recordingOverlay.StopRequested   += btnRecord_Click;
            _overlays[OverlayState.Recording] = recordingOverlay;

            _overlays[OverlayState.Empty].SendToBack();
            _overlays[OverlayState.Loading].BringToFront();
            _overlays[OverlayState.Recording].BringToFront();

            _updateTimer = new System.Threading.Timer(async state => await CheckForUpdatesAsync(), null, 5000, Timeout.Infinite);

            _parser = new LogFileParser(new LogItemParser(), new FileReader(), null)
            {
                Progress = (current, total) => _loadingOverlay.SetProgress(current, total)
            };

            Text = GetAppNameWithVersion();

            base.OnShown(e);

            SetControlVisiblityByContext();
            SetOverlayState(OverlayState.Empty);

            ShowSocialFlyout();
        }
        private async Task GetAndOpenActivity(string code)
        {
            LoadingOverlay loadPop = new LoadingOverlay(UIScreen.MainScreen.Bounds);

            View.Add(loadPop);

            Common.ServerResponse <LearningActivity> result =
                await Common.ServerUtils.Get <LearningActivity>("/api/LearningActivities/GetWithCode?code=" + code);

            loadPop.Hide();

            if (result == null)
            {
                var suppress = AppUtils.SignOut(this);
            }

            if (result.Success)
            {
                var suppress = AppUtils.OpenActivity(result.Data, Storyboard, NavigationController);
            }
            else
            {
                if (result.Message.StartsWith("404"))
                {
                    AppUtils.ShowSimpleDialog(this, "Not found", "No activity was found with that share code.", "Got it");
                }
                else
                {
                    AppUtils.ShowSimpleDialog(this, "Connection Error", "Something went wrong! Please try again later.", "Got it");
                }
            }
        }
Esempio n. 6
0
        private async Task <string> DownloadExisting()
        {
            var            bounds  = UIScreen.MainScreen.Bounds;
            LoadingOverlay loadPop = new LoadingOverlay(bounds);

            View.Add(loadPop);

            using (WebClient webClient = new WebClient())
            {
                Console.WriteLine("Checking file ");

                // Update loading dialog with current progress
                string thisUrl = ServerUtils.GetUploadUrl(currentFile);
                cachePath = Storage.GetCacheFilePath(thisUrl, -1, "mp3");

                if (!File.Exists(cachePath))
                {
                    Console.WriteLine("Downloading file ");

                    await webClient.DownloadFileTaskAsync(new Uri(thisUrl), cachePath);

                    Console.WriteLine("Downloaded file ");
                }
            }

            loadPop.Hide();

            return(cachePath);
        }
        public async override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            InitViewReferences(view);

            var radius = Arguments.GetInt(Common.Constants.BundleKeys.Radius);

            var overlay = new LoadingOverlay(Activity);

            overlay.Show();

            var pubPlaces = await _googleApiService.GetNearByPlaces(_currentLocation, radius, null, Common.Constants.LocationKeys.Pub);

            var cafePlaces = await _googleApiService.GetNearByPlaces(_currentLocation, radius,
                                                                     Common.Constants.LocationKeys.Cafe, Common.Constants.LocationKeys.Cafe);

            var nightClubPlaces = await _googleApiService.GetNearByPlaces(_currentLocation, radius,
                                                                          Common.Constants.LocationKeys.NightClub, Common.Constants.LocationKeys.NightClub);

            _allPlaces.Add(pubPlaces);
            _allPlaces.Add(cafePlaces);
            _allPlaces.Add(nightClubPlaces);
            overlay.Hide();

            InitViewPager();
        }
Esempio n. 8
0
        public override async void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);
            var bounds = UIScreen.MainScreen.Bounds;

            _loadingOverlay = new LoadingOverlay(bounds, "Loading Orders...");
            View.Add(_loadingOverlay);
            //set the orders table

            List <Order> orders = await LoadOrders(_orderUrl, _orderType);

            _loadingOverlay.Hide();
            if (orders != null)
            {
                _tableSource = new OrderTablesSource(orders, this, _orderType);
                if (ordersTable != null)
                {
                    ordersTable.Source = _tableSource; //assign the table data source

                    //reload the data
                    //menuCatItemTableView.RowHeight = UITableView.AutomaticDimension;
                    //menuCatItemTableView.EstimatedRowHeight = 40f;
                    ordersTable.ReloadData();
                }
            }
        }
        public override async void ViewWillAppear(bool animated)
        {
            base.ViewDidLoad();
            try
            {
                var bounds = UIScreen.MainScreen.Bounds;
                _loadingOverlay = new LoadingOverlay(bounds, $"Loading {_selectedCategory.MENU_CAT_NAME} items...");
                View.Add(_loadingOverlay);

                _menuCategoriesItems = await LoadMenuCatItems(_selectedCategory.MENU_CAT_ID);

                _loadingOverlay.Hide();//hide the overlay
                if (_menuCategoriesItems != null)
                {
                    _menuCatItemTableSource = new MenuCatItemTableSource(_menuCategoriesItems, this);
                    if (menuCatItemTableView != null)
                    {
                        menuCatItemTableView.Source = _menuCatItemTableSource; //assign the table data source

                        //reload the data
                        //menuCatItemTableView.RowHeight = UITableView.AutomaticDimension;
                        //menuCatItemTableView.EstimatedRowHeight = 40f;
                        menuCatItemTableView.ReloadData();
                    }
                }
            }
            catch (Exception ex)
            {
                Crashes.TrackError(ex);
                _loadingOverlay.Hide();
            }
        }
        public override async void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            _mapButton         = view.FindViewById <ImageView>(Resource.Id.Fragment_PlaceDetails_MapSearchButton);
            _uberButton        = view.FindViewById <ImageView>(Resource.Id.Fragment_PlaceDetails_UberButton);
            _toolbar           = view.FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.Fragment_PlaceDetails_ActionBarToolbar);
            _callFAB           = view.FindViewById <FloatingActionButton>(Resource.Id.Fragment_PlaceDetails_CallFAB);
            _photoImageView    = view.FindViewById <ImageView>(Resource.Id.Fragment_PlaceDetails_PhotoImageView);
            _adressTextView    = view.FindViewById <TextView>(Resource.Id.Fragment_PlaceDetails_AdresTextView);
            _distanceTextView  = view.FindViewById <TextView>(Resource.Id.Fragment_PlaceDetails_DistanceTextView);
            _rootLayout        = view.FindViewById <CoordinatorLayout>(Resource.Id.Fragment_PlaceDetails_Root);
            _openHoursTextView = view.FindViewById <TextView>(Resource.Id.Fragment_PlaceDetails_OpenTextView);

            _rootLayout.Visibility = ViewStates.Invisible;
            var overlay = new LoadingOverlay(Activity);

            overlay.Show();

            _mapButton.Click  += OnMapButtonClick;
            _uberButton.Click += OnUberButtonClick;
            _callFAB.Click    += OnCallFABClick;

            await InitPage();

            InitActionBar();

            overlay.Hide();

            _rootLayout.Visibility = ViewStates.Visible;
        }
Esempio n. 11
0
        public NewsfeedTableViewController(IntPtr handle) : base(handle)
        {
            var bounds = UIScreen.MainScreen.Bounds;

            loadPop = new LoadingOverlay(bounds);
            View.Add(loadPop);



            if (newsList != null)
            {
                getNewsfeed();
            }
            else
            {
                //Fuling, egenligen är detta fel! Felsök varför den kommer hit!
                //dvs denna ska egenligen inte vara bortkommenterad

                //_message = new UIAlertView(Lang.MESSAGE_HEADLINE, Lang.SERVICE_NOT_AVAILABLE, null, Lang.BUTTON_OK, null);
                //_message.Show();

                fetchData();
            };

            loadPop.Hide();
        }
Esempio n. 12
0
 private void ButtonClicked(KButton btn)
 {
     LoadingOverlay.Load(delegate
     {
         Load(buttonFileMap[btn]);
     });
 }
Esempio n. 13
0
        public override async void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);
            try
            {
                var bounds = UIScreen.MainScreen.Bounds;
                _loadingOverlay = new LoadingOverlay(bounds, "Loading menu items...");
                View.Add(_loadingOverlay);


                //tableView.RegisterNibForCellReuse(CustomCell.Nib, CustomCell.Key);

                _menuCategories = await LoadMenuCategories();

                _loadingOverlay.Hide();//hide the overlay after loading
                if (_menuCategories != null)
                {
                    _tableSource         = new MenuCatTableSource(_menuCategories, this);
                    menuTableView.Source = _tableSource; //assign the table data source

                    //reload the data
                    //menuTableView.RowHeight = UITableView.AutomaticDimension;
                    //menuTableView.EstimatedRowHeight = 40f;
                    menuTableView.ReloadData();
                }
            }
            catch (Exception ex)
            {
                Crashes.TrackError(ex);
                _loadingOverlay.Hide();
            }
        }
Esempio n. 14
0
        async void GetUserInfo()
        {
            var    plist  = NSUserDefaults.StandardUserDefaults;
            string userId = plist.StringForKey("userId");

            userRepository = new UsersRepository();
            user           = userRepository.GetUser(userId);

            if (!user.Any())
            {
                Console.WriteLine("User does not exist");
                LoadingOverlay.RemoveOverlay();
                return;
            }

            if (user.First().Avatar != null && user.First().Avatar.Length > 0)
            {
                profileImage = await ConvertImage.ConvertBinaryToImage(user.First().Avatar);
            }
            else
            {
                profileImage = null;
            }

            userInfoTableView.Source = new UserProfileTableSource(userProfileTableItems, user.First(), profileImage, this);
            userInfoTableView.ReloadData();

            LoadingOverlay.RemoveOverlay();
        }
Esempio n. 15
0
        protected override void OnShown(EventArgs e)
        {
            _loadingOverlay = LoadingOverlay.PutOn(this);
            _loadingOverlay.CancelRequested += LoadingOverlay_CancelRequested;

            _overlays = new Dictionary <OverlayState, Control>();
            _overlays[OverlayState.Empty]   = EmptyOverlay.PutOn(this);
            _overlays[OverlayState.Loading] = _loadingOverlay;
            var recordingOverlay = RecordingOverlay.PutOn(this);

            recordingOverlay.StopRequested   += btnRecord_Click;
            _overlays[OverlayState.Recording] = recordingOverlay;

            _overlays[OverlayState.Empty].SendToBack();
            _overlays[OverlayState.Loading].BringToFront();
            _overlays[OverlayState.Recording].BringToFront();

            _updateTimer = new System.Threading.Timer(async state => await CheckForUpdatesAsync(), null, 5000, Timeout.Infinite);

            _parser = new LogFileParser(new LogItemParser(), new FileReader(), null)
            {
                Progress = (current, total) => _loadingOverlay.SetProgress(current, total)
            };

            var name = this.GetType().Assembly.GetName();

            Text = $"{name.Name} {name.Version.Major}.{name.Version.Minor}" + (name.Version.Build == 0 ? "" : $".{name.Version.Build}");

            base.OnShown(e);

            SetControlVisiblityByContext();
            SetOverlayState(OverlayState.Empty);
        }
Esempio n. 16
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            _restActions = new RestActions();

            SignUpButton.TouchUpInside += async(e, s) =>
            {
                var bounds = UIScreen.MainScreen.Bounds;

                // show the loading overlay on the UI thread using the correct orientation sizing
                _loadingOverlay = new LoadingOverlay(bounds, "Signing you up...");     // using field from step 2
                View.Add(_loadingOverlay);
                var canregister = CanRegister();

                if (canregister)
                {
                    //proceed to the registration logic
                    var user = await RegisterUserRest();

                    if (user?.USER_NAME != null)
                    {
                        _loadingOverlay.Hide();

                        MessagingActions.ShowAlert("Registration Successfull", "Welcome " + user.SURNAME + " Please login and begin ordering");
                        DismissViewController(true, null);     //close the view controller
                        return;
                    }
                    _loadingOverlay.Hide();
                    //MessagingActions.ShowAlert("Registration not Successfull", "Unable to register, please try again");
                }
                _loadingOverlay.Hide();
            };

            CancelButton.TouchUpInside += (e, s) => { DismissViewController(true, null); };

            #region  handle the return actions to clear the on screen keyboard properly
            //responders to handle keyboard clearing on textfields

            UserNameTextView.EditingDidEnd += HandleEditingDidEnd;
            UserNameTextView.Delegate       = new CatchEnterDelegate();

            SurNameTextView.EditingDidEnd += HandleEditingDidEnd;
            SurNameTextView.Delegate       = new CatchEnterDelegate();

            OtherNamesTextView.EditingDidEnd += HandleEditingDidEnd;
            OtherNamesTextView.Delegate       = new CatchEnterDelegate();

            EmailTextView.EditingDidEnd += HandleEditingDidEnd;
            EmailTextView.Delegate       = new CatchEnterDelegate();

            PhoneTextView.EditingDidEnd += HandleEditingDidEnd;
            PhoneTextView.Delegate       = new CatchEnterDelegate();

            PasswordTextField.EditingDidEnd += HandleEditingDidEnd;
            PasswordTextField.Delegate       = new CatchEnterDelegate();

            ConfirmPasswordTextField.EditingDidEnd += HandleEditingDidEnd;
            ConfirmPasswordTextField.Delegate       = new CatchEnterDelegate();
            #endregion
        }
        public MoreTableViewController(IntPtr handle) : base(handle)
        {
            var bounds = UIScreen.MainScreen.Bounds;

            loadPop = new LoadingOverlay(bounds);
            View.Add(loadPop);
            try
            {
                this.View.BackgroundColor = ColorExtensions.ToUIColor(GeneralSettings.BackgroundColor); // Color.FromHex("#00FF00").ToUIColor();
            }
            catch (Exception eee)
            {
            }
            if (moreList != null)
            {
                getMore();
            }
            else
            {
                LoadMore();
                getMore();
                //UIAlertView _error = new UIAlertView(Lang.MESSAGE_HEADLINE, Lang.SERVICE_NOT_AVAILABLE, null, Lang.BUTTON_OK, null);
                //_error.Show();
            }

            loadPop.Hide();
        }
Esempio n. 18
0
        protected void StopLoading()
        {
            Grid           grd     = Content as Grid;
            LoadingOverlay loading = grd.Children.OfType <LoadingOverlay>().SingleOrDefault();

            loading?.Hide();
        }
Esempio n. 19
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            var loadingView = new LoadingOverlay(UIScreen.MainScreen.Bounds);

            View.AddSubview(loadingView);
        }
Esempio n. 20
0
        private void LogOutButton_TouchUpInside(object sender, EventArgs e)
        {
            // Added for showing loading screen
            var bounds = UIScreen.MainScreen.Bounds;

            // show the loading overlay on the UI thread using the correct orientation sizing
            loadingOverlay = new LoadingOverlay(bounds);
            View.Add(loadingOverlay);
            PreferenceHandler.setLoggedIn(false);
            PreferenceHandler.SetToken(string.Empty);
            PreferenceHandler.SetRefreshToken(string.Empty);
            PreferenceHandler.SaveUserDetails(new UserDetails()
            {
                Email     = string.Empty,
                FirstName = string.Empty,
                LastName  = string.Empty,
                RoleId    = 0,
                RoleType  = 0,
                UserId    = 0
            });
            Action ResetSession = () =>
            {
            };

            NSUrlSession.SharedSession.Reset(ResetSession);
            var ViewController = (ViewController)Storyboard.InstantiateViewController("ViewController");

            ViewController.NavigationItem.SetHidesBackButton(true, false);
            NavController.PushViewController(ViewController, true);
            SidebarController.MenuWidth = 0;
            SidebarController.CloseMenu();
            loadingOverlay.Hide();
            Logout(new LogoutModel(PreferenceHandler.GetUserDetails().Email));
        }
Esempio n. 21
0
        public async Task <Boolean> getAllMensajes()
        {
            var bounds = UIScreen.MainScreen.Bounds;

            loadPop = new LoadingOverlay(bounds, "Buscando Mensajes ...");
            View.Add(loadPop);

            client = new HttpClient();
            string url = Consts.ulrserv + "controldeobras/getMensajesChat";
            var    uri = new Uri(string.Format(url));

            var json = "";

            string responseString = string.Empty;

            responseString = await funciones.llamadaRest(client, uri, loadPop, json, Consts.token);

            if (responseString.Equals("-1") || responseString.Equals("-2"))
            {
                funciones.SalirSesion(this);
                return(false);
            }

            JArray jrarray;


            try
            {
                var jsonresponse = JArray.Parse(responseString);
                jrarray = jsonresponse;
            }
            catch (Exception e)
            {
                loadPop.Hide();
                var jsonresponse = JObject.Parse(responseString);

                string mensaje = "error al traer los mensajes del servidor: " + e.HResult;

                var jtokenerror = jsonresponse["error"];
                if (jtokenerror != null)
                {
                    mensaje = jtokenerror.ToString();
                }

                funciones.MessageBox("Error", mensaje);
                return(false);
            }



            foreach (var mensaje in jrarray)
            {
                Message objm = getobjMensaje(mensaje);
                messages.Add(objm);
            }


            return(true);
        }
Esempio n. 22
0
        private async void OnJoinServerButtonPressed()
        {
            var overlay = new LoadingOverlay();

            Alex.GuiManager.AddScreen(overlay);

            try
            {
                var       entry = SelectedItem.SavedServerEntry;
                var       ips   = Dns.GetHostAddresses(entry.Host).ToArray();
                IPAddress ip    = ips[Rnd.Next(0, ips.Length - 1)];

                if (ip == null)
                {
                    return;
                }

                IPEndPoint target = new IPEndPoint(ip, entry.Port);

                var authenticationService = GetService <IPlayerProfileService>();
                var currentProfile        = authenticationService.CurrentProfile;

                if (Alex.ServerTypeManager.TryGet(entry.ServerType, out var typeImplementation))
                {
                    void Connect()
                    {
                        Alex.ConnectToServer(
                            typeImplementation, new ServerConnectionDetails(target, entry.Host),
                            authenticationService.CurrentProfile);

                        Alex.GuiManager.RemoveScreen(overlay);
                        overlay = null;
                    }

                    if (!await typeImplementation.VerifyAuthentication(currentProfile))
                    {
                        await typeImplementation.Authenticate(
                            _skyBox, currentProfile, result =>
                        {
                            if (result)
                            {
                                Connect();
                            }
                        });
                    }
                    else
                    {
                        Connect();
                    }
                }
            }
            finally
            {
                if (overlay != null)
                {
                    Alex.GuiManager.RemoveScreen(overlay);
                }
            }
        }
        public override async void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);
            try
            {
                _sizes = _categoryItem.GetSizes(_categoryItem.SIZES);

                LblItemName.Text = _categoryItem.MENU_ITEM_NAME;
                TxtItemDesc.Text = _categoryItem.MENU_ITEM_DESC;

                TxtItemDesc.Editable = false; //make the textfield readonly

                itemImage.SetImage(
                    url: new NSUrl(_categoryItem.MENU_ITEM_IMAGE),
                    placeholder: UIImage.FromBundle("placeholder")
                    );

                //lblItemDesc.Editable = false;
                LblSelectedQuantity.Text = _selectedQuantity.ToString();

                //set the default values
                SizePicker.MinimumValue = 0;
                SizePicker.MaximumValue = _sizes.Count - 1; //set the maximum value based on sizes list decrease by one

                QuantityPicker.MinimumValue = 1;
                QuantityPicker.MaximumValue = _categoryItem.MAX_QTY; //set the maximum value

                await ComputeSizeAndCost(_sizes[_sizeIndex]);

                //sizeStepper.Value = _selectedQuantity;
                QuantityPicker.Value = _selectedQuantity;

                SizePicker.ValueChanged += async(sender, e) => { await SizeStepperValueChanged(); };

                QuantityPicker.ValueChanged += async(sender, e) => { await QuantityStepperValueChanged(); };
                //click action for add to cart
                BtnAddToCart.TouchUpInside += async(sender, e) =>
                {
                    var bounds = UIScreen.MainScreen.Bounds;
                    _loadingOverlay = new LoadingOverlay(bounds, "Updating your cart...");
                    View.Add(_loadingOverlay);
                    var itemAdded = await AddItemToCart();

                    _loadingOverlay.Hide();
                    if (!itemAdded)
                    {
                        return;
                    }
                    //resest the exists flag
                    _itemExists = false;
                    //close the view and go back
                    NavigationController.PopViewController(true);
                };
            }
            catch (Exception ex)
            {
                Crashes.TrackError(ex);
            }
        }
Esempio n. 24
0
        public async Task <Boolean> changepass()
        {
            var bounds = UIScreen.MainScreen.Bounds;

            loadPop = new LoadingOverlay(bounds, "Cambiando password...");
            View.Add(loadPop);

            client         = new HttpClient();
            client.Timeout = new System.TimeSpan(0, 0, 0, 10, 0);

            string url = Consts.ulrserv + "common/cambiarPass";
            var    uri = new Uri(string.Format(url));

            Dictionary <String, String> pet = new Dictionary <String, String>();

            pet.Add("idusuario", Consts.idusuarioapp);
            pet.Add("newpass", txtnuevopass.Text);
            pet.Add("oldpass", txtpassactual.Text);

            var json = JsonConvert.SerializeObject(pet);

            string responseString = string.Empty;

            responseString = await funciones.llamadaRest(client, uri, loadPop, json, Consts.token);

            if (responseString.Equals("-1") || responseString.Equals("-2"))
            {
                funciones.SalirSesion(this);
                return(false);
            }

            var jsonresponse = JObject.Parse(responseString);

            var jtokenerror = jsonresponse["error_description"];


            if (jtokenerror != null)
            {
                loadPop.Hide();
                string error = jtokenerror.ToString();
                funciones.MessageBox("Error", error);
                return(false);
            }

            jtokenerror = jsonresponse["error"];


            if (jtokenerror != null)
            {
                loadPop.Hide();
                string error = jtokenerror.ToString();
                funciones.MessageBox("Error", error);
                return(false);
            }

            loadPop.Hide();
            funciones.MessageBox("Aviso", "Se ha cambiado tu password");
            return(true);
        }
        protected BaseViewController(IntPtr handle) : base(handle)
        {
            _bindings = new List <Binding>();
            _loader   = new LoadingOverlay(UIScreen.MainScreen.Bounds);

            LoginButton  = new UIBarButtonItem();
            LogoutButton = new UIBarButtonItem();
        }
Esempio n. 26
0
        public void ShowLoadingOverlay()
        {
            EdgesForExtendedLayout = UIRectEdge.None;
            var bounds = UIScreen.MainScreen.Bounds;

            loadingOverlay = new LoadingOverlay(bounds);
            View.Add(loadingOverlay);
        }
Esempio n. 27
0
        public virtual void ShowLoader()
        {
            HideLoader();
            var bounds = UIScreen.MainScreen.Bounds;

            overlay = new LoadingOverlay(bounds);
            UIApplication.SharedApplication.KeyWindow.AddSubview(overlay);
        }
Esempio n. 28
0
        private static void BusyMessageChanged(UIView uiView, AttachedMemberChangedEventArgs <object> args)
        {
            //Ignoring view and set overlay over main window
            uiView = UIApplication.SharedApplication.Windows[0];
            LoadingOverlay busyIndicator = BusyViewMember.GetValue(uiView, null);

            busyIndicator.BusyMessage = args.NewValue == null ? null : args.NewValue.ToString();
        }
Esempio n. 29
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            var bounds = UIScreen.MainScreen.Bounds;

            loadingOverlay = new LoadingOverlay(bounds);
            View.Add(loadingOverlay);
        }
Esempio n. 30
0
 /// <summary>
 /// Fired when the overlay is hidden.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void LoadingOverlay_OnHideComplete(object sender, EventArgs e)
 {
     ui_contentRoot.Children.Remove(_loadingOverlay);
     lock (this)
     {
         _loadingOverlay = null;
     }
 }
Esempio n. 31
0
 private void OnQuitConfirm()
 {
     LoadingOverlay.Load(delegate
     {
         Deactivate();
         TriggerQuitGame();
     });
 }
		void HandleUpdateFinished(object sender, EventArgs e)
		{
			ConsoleD.WriteLine("Updates finished, going to populate table.");
			this.InvokeOnMainThread ( () => {
				this.PopulateTable ();
				if (this.loadingOverlay != null)
					this.loadingOverlay.Hide ();
				this.loadingOverlay = null;
			});
		}
Esempio n. 33
0
		public async void loadData ()
		{
			LoadingOverlay loadingOverlay;
			// Determine the correct size to start the overlay (depending on device orientation)
			var bounds = UIScreen.MainScreen.Bounds; // portrait bounds
			if (UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeLeft
			    || UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeRight) {
				bounds.Size = new CGSize (bounds.Size.Height, bounds.Size.Width);
			}
			// show the loading overlay on the UI thread using the correct orientation sizing
			loadingOverlay = new LoadingOverlay (bounds);
			View.Add (loadingOverlay);

			// Fetch the weather information asynchronously, parse the results,
			// then update the screen:
			string url = "https://beep2.cellulant.com:9011/walletTouchTestScript_cfc.php";

			JsonValue json = await FetchBeneficiariesTask (url);
			loadingOverlay.Hide (); //Hide the dialog when the task is complete.

			// Extract the array of name/value results for the field name "weatherObservation":
			// Note that there is no exception handling for when this field is not found.
			JsonValue jsonResult = json ["RESULTS_ARRAY"];

			Console.Out.WriteLine ("Result: {0}", jsonResult.ToString ());
			for (int i = 0; i < jsonResult.Count; i++) {

				Console.Out.WriteLine ("Result: {0}", jsonResult [i] ["BANK_NAME"]);
				Conference confernce = new Conference ();
				confernce.Name = jsonResult [i] ["BANK_NAME"];
				confernce.DateString = jsonResult [i] ["NOMINATED_ACCOUNT"];
				confernce.Description = jsonResult [i] ["NOMINATION_ALIAS"];

				listItems.Add (confernce);
				TableView.Source = new MyTableViewSource (listItems);
			}
				
		}
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            this.Title = "More";
            var navBar = NavigationController.NavigationBar;
            navBar.BarTintColor = UIColor.White;

            nfloat ScreenWidth = UIScreen.MainScreen.Bounds.Width;
            nfloat ScreenHeight = UIScreen.MainScreen.Bounds.Height;
            navBar.ShadowImage = new UIImage();

            var ContactView = new UIView(new CGRect(0, 0, ScreenWidth, 300))
                {
                    BackgroundColor = UIColor.White
                };

            var ContactUsView = new UIViewWithBorders(new CGRect(0, 0, ScreenWidth, 55))
                {
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4)
                };

            ContactUsView.BorderWidth = new UIEdgeInsets(1, 1, 1, 1);
            ContactUsView.BorderColorBottom = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_5);

            var ContactUsLabel = new UILabel(new CGRect(16, 15, ScreenWidth - 32, 39))
                {
                    Font = UIFont.FromName("HelveticaNeue", 12f),
                    TextAlignment = UITextAlignment.Left,
                    Text = "CONTACT US",
                    TextColor =  UIColor.Clear.FromHexString (RSColors.RS_DARK_GRAY),
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4)
                };

            ContactUsView.Add(ContactUsLabel);
            ContactView.AddSubview(ContactUsView);

            //WebView
            var settingWebView = new UIWebView(new CGRect(0, ContactUsView.Frame.Height + ContactUsView.Frame.Y + 10, ContactUsView.Frame.Width, ContactView.Frame.Height - 120));
            loadingOverlay = new LoadingOverlay(settingWebView.Bounds);
            settingWebView.ScrollView.ScrollEnabled = false;
            settingWebView.AddSubview(loadingOverlay);
            ContactView.AddSubview(settingWebView);
            settingWebView.LoadRequest(new NSUrlRequest(new NSUrl(UrlConsts.URL_MORE_CONTACT_INFO)));
            settingWebView.LoadFinished += (sender, e) =>
                {
                    if (loadingOverlay != null)
                    {
                        loadingOverlay.Hide();
                        loadingOverlay = null;
                    }
                };
            settingWebView.BackgroundColor = UIColor.White;

            var MoreView = new UIView(new CGRect(-1, settingWebView.Frame.Height + settingWebView.Frame.Y + 1, ScreenWidth + 2, 55))
                {
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4),
                };
            var MoreLabel = new UILabel(new CGRect(8, 15, 60, 39))
                {
                    Font = UIFont.FromName("HelveticaNeue", 12f),
                    TextAlignment = UITextAlignment.Left,
                    Text = "   MORE",
                    TextColor =  UIColor.Clear.FromHexString (RSColors.RS_DARK_GRAY)
                };
            MoreView.Layer.BorderWidth = 1;
            MoreView.Layer.BorderColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_5).CGColor;

            MoreView.AddSubview(MoreLabel);
            ContactView.AddSubview(MoreView);

            var SettingsTableData = new List<SettingsItem>();

            var profileItem = new SettingsItem
                {
                    EntryData = new TableData
                        {
                            Title = "Personal Information"
                        },
                    OnClickAction = "PushProfile"
                };
            SettingsTableData.Add(profileItem);

            var changeLogInItem = new SettingsItem
                {
                    EntryData = new TableData
                        {
                            Title = "Change Log In"
                        },
                    OnClickAction = "PushChangeLogIn"
                };
            SettingsTableData.Add(changeLogInItem);

            var retireLinkItem = new SettingsItem
                {
                    EntryData = new TableData
                        {
                            Title = "Go to www.TextShield.com"
                        },
                    OnClickAction = "LaunchTextShieldWeb"
                };
            SettingsTableData.Add(retireLinkItem);

            var policyItem = new SettingsItem
                {
                    EntryData = new TableData
                        {
                            Title = "Privacy Policy"
                        },
                    OnClickAction = "PushPrivatePolicy"
                };
            SettingsTableData.Add(policyItem);

            var legalItem = new SettingsItem
                {
                    EntryData = new TableData
                        {
                            Title = "Legal"
                        },
                    OnClickAction = "PushLegal"
                };
            SettingsTableData.Add(legalItem);

            var termsItem = new SettingsItem
                {
                    EntryData = new TableData
                        {
                            Title = "Terms of Use"
                        },
                    OnClickAction = "PushTermsConditions"
                };
            SettingsTableData.Add(termsItem);


            var versionItem = new SettingsItem
                {
                    EntryData = new TableData
                        {
                            Title = "About"
                        },
                    OnClickAction = "About"
                };
            SettingsTableData.Add(versionItem);

            var TableViewSource = new SettingsTableViewSource(this, SettingsTableData);

            CGRect SettingsTableViewFrame;
            CGRect LogoutButtonFrame;

            var statusNavHeight = NavigationController.NavigationBar.Frame.Height + UIApplication.SharedApplication.StatusBarFrame.Height;

            SettingsTableViewFrame = new CGRect(0, statusNavHeight, View.Frame.Width, View.Frame.Height - TabBarController.TabBar.Frame.Height - statusNavHeight);
            LogoutButtonFrame = new CoreGraphics.CGRect(-10, 15f, View.Frame.Width + 10, 55f);

            UITableView SettingsTableView = new UITableView(SettingsTableViewFrame);

            var LogoutButton = new UIButton(LogoutButtonFrame);

            var LogoutView = new UIViewWithBorders(new CGRect(0, 0, View.Frame.Width, 90f));
            LogoutView.BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4);
            LogoutButton.SetTitle("LOG OUT", UIControlState.Normal);
            LogoutButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            LogoutButton.Font = UIFont.FromName("HelveticaNeue-Medium", 14f);
            LogoutButton.SetTitleColor(UIColor.FromRGB(255, 54, 54), UIControlState.Normal);
            LogoutButton.BackgroundColor = UIColor.White;
            LogoutButton.Layer.BorderWidth = 1;
            LogoutButton.Layer.BorderColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_5).CGColor;
            SettingsTableView.SeparatorInset = new UIEdgeInsets(0, 16, 0, 0);

            if (!UIDevice.CurrentDevice.CheckSystemVersion(9, 0))
            {
                SettingsTableView.ContentInset = new UIEdgeInsets(statusNavHeight * -1, 0, 0, 0);
            }
            LogoutView.Add(LogoutButton);
            SettingsTableView.BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4);
            SettingsTableView.TableHeaderView = ContactView;
            SettingsTableView.TableFooterView = LogoutView;
            LogoutView.BorderWidth = new UIEdgeInsets(1, 1, 1, 1);
            LogoutView.BorderColorTop = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_5);
            SettingsTableView.Source = TableViewSource;
            SettingsTableView.ReloadData();
            SettingsTableView.ScrollIndicatorInsets = new UIEdgeInsets(0, 0, 0, 0);
            View.AddSubview(SettingsTableView);
            View.BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4);

            LogoutButton.TouchUpInside += (object sender, EventArgs e) =>
                {
                    NSUserDefaults.StandardUserDefaults.SetBool(true, TouchIDUtil.TouchIDSettings.UserLogout.ToString());
                    base.InvalidateSession();
                };

        }
        public async override void ViewDidLoad ()
        {
            base.ViewDidLoad ();
            if (!CrossConnectivity.Current.IsConnected)
            { 
                await DialogUtil.ShowAlert ("Network Unavailable", "This application requires internet access to function. Please check your connection and try again.", "OK");
                return;
            }
            if (AppCache.Instance.CanChangePassword)
                this.Title = "PIN";
            else
                this.Title = "Password (PIN)";

                #region Navigation

                var Cancel = new UIBarButtonItem("Cancel"
                , UIBarButtonItemStyle.Plain
                , (sender, args) =>
                    {
                        this.NavigationController.PopViewController(true);
                    });

                Cancel.TintColor = UIColor.Clear.FromHexString(RSColors.MM_BLUE);
                Cancel.Enabled = true;
                this.NavigationItem.SetLeftBarButtonItem(Cancel, true);

                #endregion

                this.View.BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4);
                nfloat ScreenWidth = UIScreen.MainScreen.Bounds.Width;
                nfloat ScreenHeight = UIScreen.MainScreen.Bounds.Height;

                ChangePinScrollview = new UIScrollView(new CGRect(0, 63, ScreenWidth, ScreenHeight + 700));
                ChangePinView = new UIView(new CGRect(0, -63, ScreenWidth, ScreenHeight - 63));
                ChangePinScrollview.ContentSize = new Size((int)ScreenWidth, (int)ScreenHeight + 700);
                ChangePinScrollview.ScrollEnabled = true;
                ChangePinScrollview.UserInteractionEnabled = true;
                ChangePinScrollview.AddSubview(ChangePinView);
                this.View.Add(ChangePinScrollview);
                var EnterLabel = new UILabel(new CGRect(0, 28, 100, 18))
                {
                    Font = UIFont.FromName("HelveticaNeue", 12f),
                    TextAlignment = UITextAlignment.Left,
                    Text = "     ENTER",
                    TextColor = UIColor.Clear.FromHexString(RSColors.RS_DARK_GRAY)
                };

                //ChangePinView.AddSubview(EnterLabel);
                var EnterView = new UIView(new CGRect(-1, 0, ScreenWidth + 2, 55))
                {
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4),
                };

                EnterView.AddSubview(EnterLabel);
                ChangePinView.Add(EnterView);

                #region Validation Text
                var MainPINView = new UIView(new CGRect(0, EnterView.Frame.Height + EnterView.Frame.Y, ScreenWidth, 153))
                {
                    BackgroundColor = UIColor.White
                };
               // View.AddSubview(MainPINView);
                ChangePinView.AddSubview(MainPINView);
                MainPINView.Layer.BorderWidth = 1;
                MainPINView.Layer.BorderColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_5).CGColor;
                var CurrentPinTextField = new UITextField(new CGRect(15, 0, ScreenWidth - 15, 50))
                {
                    Font = UIFont.FromName("HelveticaNeue", 15f),
                    TintColor = UIColor.Black,
                    Placeholder = "Current PIN",
                    KeyboardType = UIKeyboardType.NumberPad,
                    SecureTextEntry = true
                };

                MainPINView.Add(CurrentPinTextField);

                var PinView = new UIView(new CGRect(15, CurrentPinTextField.Frame.Height + CurrentPinTextField.Frame.Y, ScreenWidth - 15, 1))
                {
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_6)
                };
                MainPINView.Add(PinView);

                var NewPinTextField = new UITextField(new CGRect(15, CurrentPinTextField.Frame.Height + CurrentPinTextField.Frame.Y + 1, ScreenWidth - 15, 50))
                {
                    Font = UIFont.FromName("HelveticaNeue", 15f),
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_WHITE),
                    Placeholder = "New PIN",
                    KeyboardType = UIKeyboardType.NumberPad,
                    SecureTextEntry = true
                };

                MainPINView.Add(NewPinTextField);

                var PasswordView = new UIView(new CGRect(15, NewPinTextField.Frame.Height + NewPinTextField.Frame.Y, ScreenWidth - 15, 1))
                {
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_6)
                };
                MainPINView.Add(PasswordView);


                var RetypePinTextField = new UITextField(new CGRect(15, NewPinTextField.Frame.Height + NewPinTextField.Frame.Y + 1, ScreenWidth - 15, 50))
                {
                    Font = UIFont.FromName("HelveticaNeue", 15f),
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_WHITE),
                    Placeholder = "Retype New PIN",
                    KeyboardType = UIKeyboardType.NumberPad,
                    SecureTextEntry = true
                };
                MainPINView.Add(RetypePinTextField);

                var IDView = new UIView(new CGRect(15, RetypePinTextField.Frame.Height + RetypePinTextField.Frame.Y, ScreenWidth - 15, 1))
                {
                    BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_6)
                };
                MainPINView.Add(IDView);

                //WebView
                var ChangePinwebView = new UIWebView(new CGRect(0, MainPINView.Frame.Height + MainPINView.Frame.Y + 20, ScreenWidth, 120));
                ChangePinwebView.Layer.BorderWidth = 1;
                ChangePinwebView.Layer.BorderColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_5).CGColor;
                loadingOverlay = new LoadingOverlay(ChangePinwebView.Bounds);
                ChangePinwebView.AddSubview(loadingOverlay);
                ChangePinView.AddSubview(ChangePinwebView);
                ChangePinwebView.UserInteractionEnabled = false;
                ChangePinwebView.LoadRequest(new NSUrlRequest(new NSUrl(UrlConsts.URL_CHANGE_LOGIN_PIN_RULES)));
                ChangePinwebView.LoadFinished += (sender, e) =>
                {
                    if (loadingOverlay != null)
                    {
                        loadingOverlay.Hide();
                        loadingOverlay = null;
                    }
                };
                #endregion

                var Save = new UIBarButtonItem("Save"
                , UIBarButtonItemStyle.Plain
                , async(sender, args) =>
                    {
                        if (App.authManager.TicketExpired())
                        {
                            await DialogUtil.ShowAlert("Session Expired", "Your session has expired. Returning to Login Screen", "OK");
                            InvalidateSession();
                            return;
                        } 
                        if (!CrossConnectivity.Current.IsConnected)
                        {
                            await DialogUtil.ShowAlert("Network Unavailable", "This application requires internet access to function. Please check your connection and try again.", "OK");
                            return;
                        }
                        if (string.IsNullOrEmpty(NewPinTextField.Text) || string.IsNullOrEmpty(RetypePinTextField.Text) || string.IsNullOrEmpty(CurrentPinTextField.Text))
                        {
                            UIAlertView alert = new UIAlertView("PIN should not be empty, try again.", " ", null, "OK");
                            alert.Show();
                            NewPinTextField.Text = string.Empty;
                            RetypePinTextField.Text = string.Empty;
                            CurrentPinTextField.Text = string.Empty;
                            return;
                        }
                        else if (!NewPinTextField.Text.Equals(RetypePinTextField.Text))
                        {
                            UIAlertView alert = new UIAlertView("PIN's do not match, try again.", " ", null, "OK");
                            alert.Show();
                            NewPinTextField.Text = string.Empty;
                            RetypePinTextField.Text = string.Empty;
                            CurrentPinTextField.Text = string.Empty;
                            return;
                        } 
                        InvokeOnMainThread(() =>
                            {
                                loadingOverlay = new LoadingOverlay(this.View.Bounds);
                                this.View.AddSubview(loadingOverlay);
                            });
                    try{
                        var repo = new RSContentRepository();
                        var deviceId = UIKit.UIDevice.CurrentDevice.IdentifierForVendor.AsString(); 
                        var acct = AppCache.Instance.GetCacheItem<AccountInfo>(AppCache.AppCacheKey.CURRENTACCOUNT);
                        var pinRequest = RequestObjectFactory.GetChangePinRequestObject(acct, deviceId, CurrentPinTextField.Text, NewPinTextField.Text, RetypePinTextField.Text);
                        var changePin = await repo.ChangePin(pinRequest);

                        if (loadingOverlay != null)
                        {
                            loadingOverlay.Hide();
                            loadingOverlay = null;
                        }
                        if (changePin.success)
                        {
                            UIAlertView alert = new UIAlertView("Your PIN has been changed successfully.", " ", null, "OK");
                            alert.Clicked += delegate (object _sender, UIButtonEventArgs btnArgs) {
                                this.NavigationController.PopViewController (false);
                            };
                            alert.Show ();
                            DeleteCredentials();
                            return;
                        }
                        else if (changePin.errorList != null && changePin.errorList.Count > 0)
                        { 
                            ErrorList errorList = changePin.errorList[0];
                            UIAlertView alert = new UIAlertView("PIN change was unsuccessful, try again.",errorList.errorDescription, null, "OK");
                            alert.Show();
                            CurrentPinTextField.Text = string.Empty;
                            NewPinTextField.Text = string.Empty;
                            RetypePinTextField.Text = string.Empty;
                            CurrentPinTextField.ResignFirstResponder();
                            NewPinTextField.ResignFirstResponder();
                            RetypePinTextField.ResignFirstResponder();
                            return;
                        }
                        else
                        {
                            UIAlertView alert = new UIAlertView("PIN change was unsuccessful, try again.", "Please try again", null, "OK");
                            alert.Show();
                            CurrentPinTextField.Text = string.Empty;
                            NewPinTextField.Text = string.Empty;
                            RetypePinTextField.Text = string.Empty;
                            CurrentPinTextField.ResignFirstResponder();
                            NewPinTextField.ResignFirstResponder();
                            RetypePinTextField.ResignFirstResponder();
                            return;
                        }
                    }catch(Exception e){
                        UIAlertView alert = new UIAlertView("Unable to process your request.", "Please try again later", null, "OK");
                        alert.Show();

                        if (loadingOverlay != null)
                        {
                            loadingOverlay.Hide();
                            loadingOverlay = null;
                        }
                        NewPinTextField.Text = string.Empty;
                        RetypePinTextField.Text = string.Empty;
                        CurrentPinTextField.Text = string.Empty;
                        return;
                    }
                       
                    });
                Save.TintColor = UIColor.Clear.FromHexString(RSColors.MM_BLUE);
                Save.Enabled = true;
                this.NavigationItem.SetRightBarButtonItem(Save, true);
            }