public void Busy()
 {
     this.busyDlg = new ProgressDialog (this);
     this.busyDlg.SetMessage (Resources.GetString (Resource.String.busy_msg));
     this.busyDlg.SetCancelable (false);
     this.busyDlg.Show ();
 }
		protected override void OnResume ()
		{
			base.OnResume ();

			Log.Debug (logTag, "ActivityBase.OnCreate.");

			if (!App.Current.IsInitialized){
			Log.Debug(logTag, "ActivityBase.App is NOT initialized");
				// show the loading overlay on the UI thread
				progress = ProgressDialog.Show(this, "Loading", "Please Wait...", true); 

				// when the app has initialized, hide the progress bar and call Finished Initialzing
				initializedEventHandler = (s, e) => {
					// call finished initializing so that any derived activities have a chance to do work
					RunOnUiThread( () => {
						this.FinishedInitializing();
						// hide the progress bar
						if (progress != null)
							progress.Dismiss();
					});
				};
				App.Current.Initialized += initializedEventHandler;

			} else {
				Log.Debug(logTag, "ActivityBase.App is initialized");
			}
		}
		public ProgressDialogHelper(Context context) {
			this.progress = new ProgressDialog(context);
			progress.SetProgressStyle(ProgressDialogStyle.Spinner);
			progress.Indeterminate = false;
			progress.Progress = 99;
			progress.SetCanceledOnTouchOutside(false);
		}
Exemple #4
0
        private async void  Botonvalidar_Click(object sender, EventArgs e)
        {
            progress = new Android.App.ProgressDialog(this.Context);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Validando...Espere...");
            progress.SetCancelable(false);
            progress.Show();

            if (!string.IsNullOrEmpty(txtdni.Text))
            {
                var dato = await controller.ValidaCliente(int.Parse(txtdni.Text));

                if (dato != null)
                {
                    txtnombre.Text = dato.nom_clie;
                    txtEmail.Text  = dato.correo;
                    txtTele_F.Text = dato.telefono_f;
                    txtTele_C.Text = dato.telefono_c;
                    progress.Dismiss();
                }
                else
                {
                    progress.Dismiss();
                    Toast.MakeText(this.Context, "Cliente no encontrado", ToastLength.Long).Show();
                    LimpiarCasillas();
                }
            }
            else
            {
                progress.Dismiss();
                Toast.MakeText(this.Context, "Campo vacio", ToastLength.Long).Show();
            }
        }
 public static ProgressDialog ShowStatus(Context cxt, string msg)
 {
     ProgressDialog status = new ProgressDialog(cxt);
     status.SetMessage(msg);
     status.Show();
     return status;
 }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            _contentView = inflater.Inflate(Resource.Layout.device_detail, null);
            _contentView.FindViewById<Button>(Resource.Id.btn_connect).Click += (sender, args) =>
                {
                    var config = new WifiP2pConfig
                        {
                            DeviceAddress = _device.DeviceAddress, 
                            Wps =
                                {
                                    Setup = WpsInfo.Pbc
                                }
                        };
                    if (_progressDialog != null && _progressDialog.IsShowing)
                        _progressDialog.Dismiss();

                    _progressDialog = ProgressDialog.Show(Activity, "Press back to cancel",
                                                          "Connecting to: " + _device.DeviceAddress, true, true);

                    ((IDeviceActionListener)Activity).Connect(config);
                };

            _contentView.FindViewById<Button>(Resource.Id.btn_disconnect).Click += (sender, args) => 
                ((IDeviceActionListener)Activity).Disconnect();

            _contentView.FindViewById<Button>(Resource.Id.btn_start_client).Click += (sender, args) =>
                {
                    var intent = new Intent(Intent.ActionGetContent);
                    intent.SetType("image/*");
                    StartActivityForResult(intent, ChooseFileResultCode);
                };

            return _contentView;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Login);
            EditText storeUsernameText = FindViewById <EditText>(Resource.Id.editTextUserName);
            EditText storePasswordText = FindViewById <EditText>(Resource.Id.textViewPassword);
            Button   btnLoginStore     = FindViewById <Button>(Resource.Id.btnLogin);

            btnLoginStore.Click += async(sender, e) =>
            {
                progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Loading... Please wait...");
                progress.SetCancelable(false);
                progress.Show();
                try
                {
                    LoginEntity loginEntity = new LoginEntity {
                        AuthToken = "", UserNameOREmail = storeUsernameText.Text, PasswordHash = storePasswordText.Text
                    };
                    JsonValue json = await HttpRequestHelper <LoginEntity> .POSTreq(ServiceTypes.Login, loginEntity);

                    ParseJSON(json);
                    progress.Hide();
                }
                catch (Exception ex)
                {
                    progress.Dismiss();
                }
            };
        }
Exemple #8
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.instructorChapterListToolBar);
            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetTitle("Please Wait");
            progress.SetMessage("Getting Course Details");
            progress.SetCancelable(false);
            progress.Show();
            string inst_id = Intent.GetStringExtra("instructor_id") ?? "Data not available";

            language_id = Intent.GetStringExtra("language_id") ?? "Data not available";
            inst_name   = Intent.GetStringExtra("instructor_name") ?? "Name Not Available";

            try
            {
                Console.WriteLine("instructor_name : " + inst_name);
                await Task.Run(() => ChapterList(inst_id, language_id));

                await Task.Run(() => CourseInfoFetcher(language_id));

                progress.Hide();
                //InitData();
                FindViews();
                chapterListInstructorName.Text = inst_name;
            }
            catch (Exception ChapterListError)
            {
                Console.WriteLine("ChapterListError : " + ChapterListError);
                throw;
            }
        }
    public static void CloseProgressDialog(Activity context) {
        if (!context.IsFinishing && _mProgressDialog != null)
        {
    		_mProgressDialog.Dismiss();
    	}
    	_mProgressDialog = null;
	}
		private async Task ConnectToRelay()
		{
			bool connected = false;

			var waitIndicator = new ProgressDialog(this) { Indeterminate = true };
			waitIndicator.SetCancelable(false);
			waitIndicator.SetMessage("Connecting...");
			waitIndicator.Show();

			try
			{
				var prefs = PreferenceManager.GetDefaultSharedPreferences(this);

				connected = await _remote.Connect(prefs.GetString("RelayServerUrl", ""), 
				                                  prefs.GetString("RemoteGroup", ""), 
				                                  prefs.GetString("HubName", ""));
			}
			catch (Exception)
			{
			}
			finally
			{
				waitIndicator.Hide();
			}

			Toast.MakeText(this, connected ? "Connected!" : "Unable to connect", ToastLength.Short).Show();
		}
Exemple #11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Validar);

            var textEmailAddress = FindViewById <EditText>(Resource.Id.etCorreo);
            var etPassword       = FindViewById <EditText>(Resource.Id.etPassword);
            var btn    = FindViewById <Button>(Resource.Id.btn);
            var txview = FindViewById <TextView>(Resource.Id.txview);

            btn.Click += async(sender, e) =>
            {
                progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Loading is Progress...");
                progress.SetCancelable(false);
                progress.Show();

                this.Email    = textEmailAddress.Text.ToString();
                this.Password = etPassword.Text.ToString();

                string res = await Validate();

                txview.Text = res.ToString();
                progress.Cancel();
            };
        }
		public void Done () {
			if (this.busyDlg != null) {
				this.busyDlg.Dismiss ();
				this.busyDlg.Dispose ();
				this.busyDlg = null;
			}
		}
Exemple #13
0
        protected override void OnResume()
        {
            base.OnResume();

            Task startupWork = new Task(() =>
            {
                //Log.Debug(TAG, "Performing some startup work that takes a bit of time.");
                //Task.Delay(5000);  // Simulate a bit of startup work.
                //Log.Debug(TAG, "Working in the background - important stuff.");
            });

            startupWork.ContinueWith(t =>
            {
                Log.Debug(TAG, "Work is finished - start MainActivity.");
                StartActivity(new Intent(Application.Context, typeof(MainActivity)));
            }, TaskScheduler.FromCurrentSynchronizationContext());

            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Loading... Please wait...");
            progress.SetCancelable(false);
            progress.Show();

            startupWork.Start();
        }
Exemple #14
0
        private async void TrySave()
        {
            ProgressDialog progress;

            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Logging In... Please wait...");
            progress.SetCancelable(false);
            progress.Show();
            CurrentPlatform.Init();
            EditText     firstName   = (EditText)FindViewById(Resource.Id.firstName);
            EditText     lastName    = (EditText)FindViewById(Resource.Id.lastName);
            EditText     email       = (EditText)FindViewById(Resource.Id.email);
            EditText     phoneNo     = (EditText)FindViewById(Resource.Id.phoneNo);
            Spinner      gender      = (Spinner)FindViewById(Resource.Id.gender);
            Spinner      county      = (Spinner)FindViewById(Resource.Id.county);
            UserProfiles newUserInfo = new UserProfiles {
                UsersID  = pref.GetString("UserID", "NULL"), Firstname = firstName.Text,
                Lastname = lastName.Text, Email = email.Text, PhoneNo = phoneNo.Text, Gender = gender.SelectedItem.ToString(),
                County   = county.SelectedItem.ToString()
            };

            MobileService.GetTable <UserProfiles>().InsertAsync(newUserInfo);
            progress.Hide();
            Toast.MakeText(ApplicationContext, "User " + pref.GetString("UserName", "NULL") + " info created!", ToastLength.Short).Show();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);



            Button btnClickId = FindViewById <Button>(Resource.Id.btnClickId);

            btnClickId.Click += async(sender, args) =>
            {
                var progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Aguarde...");
                progress.SetCancelable(false);
                progress.Show();

                await Task.Delay(5000);

                guid = Guid.NewGuid();
                progress.Dismiss();

                StartActivity(typeof(WebViewActivity));
            };
        }
        public override Android.Views.View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.SignLayout, container, false);

            Button clearButton = view.FindViewById<Button> (Resource.Id.clearButton);
            Button sendButton = view.FindViewById<Button> (Resource.Id.sendButton);

            EditText remarks = view.FindViewById<EditText> (Resource.Id.txtRemarks);
            ToggleButton notification = view.FindViewById<ToggleButton> (Resource.Id.toggleNotifications);

            SignView signView = view.FindViewById<SignView> (Resource.Id.signView);

            mDialog = new ProgressDialog(this.Activity);
            mDialog.SetMessage("Sending...");
            mDialog.SetCancelable(false);

            clearButton.Click += delegate {
                signView.ClearCanvas();
            };

            sendButton.Click += delegate {
                using (MemoryStream stream = new MemoryStream())
                {
                    if (signView.CanvasBitmap().Compress(Bitmap.CompressFormat.Png, 100, stream))
                    {
                        byte[] image = stream.ToArray();
                        string base64signature = Convert.ToBase64String(image);
                        Backend.Current.send(base64signature, remarks.Text, notification.Activated, OnSendSuccess, OnSendFail);
                        mDialog.Show();
                    }
                }
            };

            return view;
        }
		async Task<bool> fnGetProfileInfoFromGoogle()
		{ 
			progress =  ProgressDialog.Show (this,"","Please wait..."); 
			bool isValid=false;
			//Google API REST request
			string userInfo = await fnDownloadString (string.Format(googUesrInfoAccessleUrl, access_token ));  
			if ( userInfo != "Exception" )
			{ 
				googleInfo = JsonConvert.DeserializeObject<GoogleInfo> ( userInfo );   
				isValid = true;
			}
			else
			{ 
				if ( progress != null )
				{
					progress.Dismiss ();
					progress = null;
				}   
				isValid = false;
				Toast.MakeText ( this , "Connection failed! Please try again" , ToastLength.Short ).Show (); 
			}
			if ( progress != null )
			{
				progress.Dismiss ();
				progress = null;
			}  
			return isValid;
		}
Exemple #18
0
 public void HideLoadingDialog()
 {
     if(_loadingDialog != null){
         _loadingDialog.Dismiss();
         _loadingDialog = null;
     }
 }
Exemple #19
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            var textEmailAddress = FindViewById <EditText>(Resource.Id.editTextEmail);
            var etPassword       = FindViewById <EditText>(Resource.Id.editTextPassword);
            var btn = FindViewById <Button>(Resource.Id.buttonValidate);

            btn.Click += async(sender, e) =>
            {
                progress = new Android.App.ProgressDialog(this);
                progress.SetCancelable(false);
                progress.SetTitle("Trabajando");
                progress.SetMessage("Por favor, espera...");
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Horizontal);
                progress.Indeterminate = true;
                progress.Show();

                await Validate();

                Android.App.AlertDialog.Builder Builder =
                    new AlertDialog.Builder(this);
                AlertDialog Alert = Builder.Create();
                Alert.SetTitle("Resultado de la verificación");
                Alert.SetIcon(Resource.Drawable.dotnet);
                Alert.SetMessage(
                    $"{Result.Status}\n{Result.FullName}\n{Result.Token}");
                Alert.SetButton("Ok", (s, ev) => { });
                progress.Cancel();
                Alert.Show();
            };
        }
Exemple #20
0
    private async void SaveButton_Click(object sender, EventArgs ea)
    {
      var dialog = new ProgressDialog(this);
      dialog.SetMessage(Resources.GetString(Resource.String.Saving));
      dialog.SetCancelable(false);
      dialog.Show();

      try
      {
        Bindings.UpdateSourceForLastView();
        this.Model.ApplyEdit();
        var returnModel = await this.Model.SaveAsync();
        InitializeBindings(returnModel);
      }
      catch (Exception ex)
      {
        var alert = new AlertDialog.Builder(this);
        alert.SetMessage(string.Format(Resources.GetString(Resource.String.Error), ex.Message));
        alert.Show();
      }
      finally
      {
        dialog.Hide();
      }
    }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            var groupName = Intent.GetStringExtra("name");
            Title = groupName;
            GroupName = groupName;

            _contactRepo = new ContactRepository(this);

            _progressDialog = new ProgressDialog(this);
            _progressDialog.SetMessage("Loading Contacts.  Please wait...");
            _progressDialog.Show();

            Task.Factory
                .StartNew(() =>
                    _contactRepo.GetAllMobile())
                .ContinueWith(task =>
                    RunOnUiThread(() =>
                    {
                        if (task.Result != null)
                            DisplayContacts(task.Result);
                        _progressDialog.Dismiss ();
                    }));
        }
Exemple #22
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            Button start = FindViewById<Button>(Resource.Id.startButton);
            Button stop = FindViewById<Button>(Resource.Id.stopButton);

            ProgressDialog pd = new ProgressDialog(this)
            {
                Indeterminate = true,
            };

            pd.SetMessage("Waiting");

            pd.SetButton("cancel", (s, e) => Stop(pd));
            pd.SetIcon(Resource.Drawable.Icon);

            //pd.SetCancelable(false);

            Drawable myIcon = Resources.GetDrawable(Resource.Animation.progress_dialog_icon_drawable_animation);
            pd.SetIndeterminateDrawable(myIcon);

            start.Click += delegate { Start(pd); };
            stop.Click += delegate { Stop(pd); };
        }
		protected async override void OnResume ()
		{
			try
			{
				base.OnResume ();

				ProgressDialogLogin = ProgressDialog.Show(this, "", "Loading...");

				await GetWorkshops();

				if (ProgressDialogLogin != null)
				{
					ProgressDialogLogin.Dismiss();
					ProgressDialogLogin = null;
				}
			}
			catch (Exception e) 
			{
				ErrorHandling.LogError (e, this);
			}
			finally 
			{
				if (ProgressDialogLogin != null)
				{
					ProgressDialogLogin.Dismiss();
					ProgressDialogLogin = null;
				}
			}
		}
Exemple #24
0
        public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            //			Console.WriteLine("[{0}] OnCreateView Called: {1}", TAG, DateTime.Now.ToLongTimeString());
            View v = inflater.Inflate(Resource.Layout.fragment_photo, container, false);

            mImageView = v.FindViewById<ImageView>(Resource.Id.photoView);

            photoUrl = Activity.Intent.GetStringExtra(PhotoGalleryFragment.PHOTO_URL_EXTRA);

            photoUrl = photoUrl.Substring(0, photoUrl.Length-6) + ".jpg";
            photoFilename = new FlickrFetchr().GetFilenameFromUrl(photoUrl);

            ProgressDialog pg = new ProgressDialog(Activity);
            pg.SetMessage(Resources.GetString(Resource.String.loading_photo_message));
            pg.SetTitle(Resources.GetString(Resource.String.loading_photo_title));
            pg.SetCancelable(false);
            pg.Show();

            Task.Run(async () => {
                Bitmap image = await new FlickrFetchr().GetImageBitmapAsync(photoUrl, 0, new CancellationTokenSource().Token, photoFilename).ConfigureAwait(false);
                Activity.RunOnUiThread(() => {
                    mImageView.SetImageBitmap(image);
                    //Console.WriteLine("[{0}] File created: {1}", TAG, photoUrl);
                    pg.Dismiss();
                });
            });

            return v;
        }
        public async void ProgressDialog()
        {
            try
            {
                progress = new ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);

                //progress.SetProgressDrawable(Resource.Drawable.loading);
                progress.SetMessage("Loading data....");

                progress.SetCancelable(false);
                progress.Show();
                await Task.Run((() => Foo()));

                progress.Dismiss();

                void Foo()
                {
                    for (int i = 0; i < 2; i++)
                    {
                        Thread.Sleep(500);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
		protected override void OnViewModelSet()
		{
			base.OnViewModelSet();

			// show a progress box if there is some work
			var events = ViewModel as EventsViewModel;
			if (events != null)
			{
				ProgressDialog progress = null;
				events.PropertyChanged += (sender, e) =>
				{
					if (e.PropertyName == "IsWorking")
					{
						if (events.IsWorking)
						{
							if (progress == null)
							{
								progress = new ProgressDialog(this);
								progress.SetProgressStyle(ProgressDialogStyle.Spinner);
								progress.SetMessage("Doing absolutely nothing in the background...");
								progress.Show();
							}
						}
						else
						{
							if (progress != null)
							{
								progress.Dismiss();
								progress = null;
							}
						}
					}
				};
			}
		}
        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // shows a spinner while it gets polls from database
            var progressDialog = new ProgressDialog(this);
            progressDialog.Show();
            {
                try
                {
                    // gets all the polls from the database
                    polls = await VotingService.MobileService.GetTable<Poll>().ToListAsync();
                }
                catch (Exception exc)
                {
                    // error dialog that shows if something goes wrong
                    var errorDialog = new AlertDialog.Builder(this).SetTitle("Oops!").SetMessage("Something went wrong " + exc.ToString()).SetPositiveButton("Okay", (sender1, e1) =>
                    {

                    }).Create();
                    errorDialog.Show();
                }
            };
            // ends spinner on completion
            progressDialog.Dismiss();

            // created table for polls
            ListAdapter = new ArrayAdapter<Poll>(this, Android.Resource.Layout.SimpleListItem1, polls);
        }
        private void OnMikuniProtocol()
        {
            status = DialogManager.ShowStatus(this, Database.GetText("Communicating", "System"));
            Manager.LiveDataVector = Database.GetLiveData("QingQi");
            for (int i = 0; i < Manager.LiveDataVector.Count; i++)
            {
                if ((Manager.LiveDataVector[i].ShortName == "TS")
                    || (Manager.LiveDataVector[i].ShortName == "ERF")
                    || (Manager.LiveDataVector[i].ShortName == "IS"))
                {
                    Manager.LiveDataVector[i].Enabled = false;
                }
            }
            Core.LiveDataVector vec = Manager.LiveDataVector;
            vec.DeployEnabledIndex();
            vec.DeployShowedIndex();
            task = Task.Factory.StartNew(() =>
            {
                if (!Manager.Commbox.Close() || !Manager.Commbox.Open())
                {
                    throw new IOException(Database.GetText("Open Commbox Fail", "System"));
                }
                Diag.MikuniOptions options = new Diag.MikuniOptions();
                options.Parity = Diag.MikuniParity.Even;
                Mikuni protocol = new Mikuni(Manager.Commbox, options);
                protocol.StaticDataStream(vec);
            });

            task.ContinueWith((t) =>
            {
                ShowResult(t);
            });
        }
Exemple #29
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.ChapterDetailsLayout);
            string chapt_id = Intent.GetStringExtra("chapter_id") ?? "Data not available";

            //string instructor_name = Intent.GetStringExtra("instructor_name") ?? "Name Not Available";
            //instructorName.Text = instructor_name;
            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetTitle("Please Wait");
            progress.SetMessage("Getting Course Details");
            progress.SetCancelable(false);
            progress.Show();

            await Task.Run(() => ChapterDetailsFetcher(chapt_id));

            progress.Hide();

            FindViews();
            instructorName.Text       = Convert.ToString(instructorChapterList.inst_name);
            briefDescription.Text     = briefDesc;
            mainContent.Text          = chapterContent;
            toolbarChapterNumber.Text = chapterNumber;
            toolbarChapterName.Text   = chapterName;
        }
        private void StartDownloading(object sender, EventArgs e)
        {
            progressDialog = ProgressDialog.Show(this, "Pobieranie...", "");
            stopwatch = new Stopwatch();
            stopwatch.Start();

            new Thread(new Runnable(() => { networkService.DownloadImage(addressField.Text); })).Start();
        }
Exemple #31
0
 public static ProgressDialog CreateProgressDialog(string message, Activity activity)
 {
     var mProgressDialog = new ProgressDialog(activity, Resource.Style.LightDialog);
     mProgressDialog.SetMessage(message);
     mProgressDialog.SetCancelable(false);
     mProgressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
     return mProgressDialog;
 }
        private void StartPositioning(object sender, EventArgs e)
        {
            progressDialog = ProgressDialog.Show(this, "Wyznaczanie pozycji...", "");
            stopwatch = new Stopwatch();
            stopwatch.Start();

            locationService.GetLocation();
        }
Exemple #33
0
		public ChangeStatusPopup (Activity _activity) : base (_activity)
		{
			this._activity = _activity;
			progress = ProgressDialog.Show (_activity, "", "", true);
			progress.SetContentView(new ProgressBar(_activity));
			progress.Hide ();
			popupNotice = new PopupNoticeInfomation (_activity);
		}
 /// <summary>
 /// Hides the progress dialog
 /// </summary>
 public void Hide()
 {
     if (_currentDialog != null)
     {
         _currentDialog.Hide();
         _currentDialog = null;
     }
 }
 private void StarShowingPtogressDialog()
 {
     progress = new Android.App.ProgressDialog(this);
     progress.Indeterminate = true;
     progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
     progress.SetMessage("Зареждане... Моля изчакайте...");
     progress.SetCancelable(false);
     progress.Show();
 }
Exemple #36
0
 public static void ShowProgressBar(Context context)
 {
     progress = new Android.App.ProgressDialog(context);
     progress.Indeterminate = true;
     progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
     progress.SetMessage("Loading... Please wait...");
     progress.SetCancelable(false);
     progress.Show();
 }
Exemple #37
0
 void ShowDialog()
 {
     progress = new ProgressDialog(this);
     progress.Indeterminate = true;
     progress.SetProgressStyle(ProgressDialogStyle.Spinner);
     progress.SetMessage("Please wait...");
     progress.SetCancelable(false);
     progress.Show();
 }
Exemple #38
0
		public void Show(Context context, string content)
		{
			var dialog = new ProgressDialog(context);
			dialog.SetMessage(content);
			dialog.SetCancelable(false);
			dialog.Show();
			System.Threading.Thread.Sleep (2000);
			dialog.Hide ();
		}
 private void ShowProgressDialog()
 {
     progress = new Android.App.ProgressDialog(this);
     progress.Indeterminate = true;
     progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
     progress.SetMessage("Изпращане на сигнал ...");
     progress.SetCancelable(false);
     progress.Show();
 }
 public override void DismissProgressDialog()
 {
     _context.RunOnUiThread (() => {
         if (_progressDialog != null && _progressDialog.IsShowing) {
             _progressDialog.Dismiss ();
             _progressDialog = null;
         }
     });
 }
Exemple #41
0
 public void CreateProgressDialog(string message, Boolean cacelable, ProgressDialogStyle style)
 {
     mProgressDialog = new Android.App.ProgressDialog(mContext);
     mProgressDialog.Indeterminate = true;
     mProgressDialog.SetProgressStyle(style);
     mProgressDialog.SetMessage(message);
     mProgressDialog.SetCancelable(false);
     mProgressDialog.Show();
 }
        public void OnClick(View V)
        {
            ProgressDialog progress = new ProgressDialog(this);
            try
            {
                switch(V.Id)
                {
                case Resource.Id.bSignIn :
                    {
                        isLogin=false;
                        Boolean blnValidate=  FieldValidation();
                        if (blnValidate==true)
                        {
                            progress.Indeterminate = true;
                            progress.SetProgressStyle(ProgressDialogStyle.Spinner);
                            progress.SetMessage("Contacting server. Please wait...");
                            progress.SetCancelable(true);
                            progress.Show();

                            var progressDialog = ProgressDialog.Show(this, "Please wait...", "Checking Login info...", true);

                            new Thread(new ThreadStart(delegate
                            {

                                RunOnUiThread(() => ValidateSqluserpwd(etUsername.Text.ToString() , etpwd.Text.ToString()));
                                if (isLogin== true){
                                    RunOnUiThread(() => Toast.MakeText(this, "Login detail found in system...", ToastLength.Short).Show());
                                }
                                RunOnUiThread(() => progressDialog.Hide());
                            })).Start();
                        }
                        break;
                    }
                case Resource.Id.tvforget :
                    {
                        var toast = Toast.MakeText(this,"Forget link clicked",ToastLength.Short);
                        toast.Show();
                        break;
                    }
                case Resource.Id.tvregister :
                    {
                        var myIntent = new Intent (this, typeof(MainActivity));
                        StartActivityForResult (myIntent, 0);
                        break;
                    }
                }
            }
            catch (NullReferenceException ex) {
                var toast = Toast.MakeText (this, ex.Message ,ToastLength.Short);
                toast.Show ();
            }
            finally
            {
                // Now hide the progress dialog
                progress.Dismiss();
            }
        }
Exemple #43
0
        private async void TryLoginAsync(object sender, EventArgs e)
        {
            ProgressDialog progress;

            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Logging In... Please wait...");
            progress.SetCancelable(false);
            progress.Show();
            EditText username      = (EditText)FindViewById(Resource.Id.username);
            EditText password      = (EditText)FindViewById(Resource.Id.passwordInput);
            string   user          = username.Text.Trim();
            string   passwordInput = password.Text;

            if (!await DBHelper.DoesUserExist(user))
            {
                progress.Hide();
                Toast.MakeText(ApplicationContext, "Invalid Login", ToastLength.Short).Show();
            }
            else
            {
                Users u = await DBHelper.GetUser(user);

                if (PasswordStorage.VerifyPassword(passwordInput, u.Password))
                {
                    edit.PutString("UserID", u.ID);
                    edit.PutString("UserName", u.Username);
                    edit.PutString("LoggedIn", "true");
                    edit.PutString("Password", passwordInput);
                    edit.Commit();

                    Toast.MakeText(ApplicationContext, "Success", ToastLength.Short).Show();
                    if (await DBHelper.IsUserProfileCreated(u.ID))
                    {
                        //go to main menu
                        UserProfiles up = await DBHelper.GetUsersProfile(u.ID);

                        edit.PutString("FirstName", up.Firstname);
                        edit.PutString("LastName", up.Lastname);
                        edit.Commit();
                        progress.Hide();
                        StartActivity(typeof(MainProfileActivity));
                    }
                    else
                    {
                        progress.Hide();
                        StartActivity(typeof(SetUpProfileActivity));
                    }
                }
                else
                {
                    progress.Hide();
                    Toast.MakeText(ApplicationContext, "Invalid Login", ToastLength.Short).Show();
                }
            }
        }
Exemple #44
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			//RequestWindowFeature (WindowFeatures.NoTitle);
			progressDialogParent = ProgressDialog.Show (this, "", "", true);
			progressDialogParent.SetContentView(new ProgressBar(this));
			progressDialogParent.Hide ();
			LayoutInflater.Factory = new TextFactoryManager();
		}
 private void StarShowingPtogressDialog()
 {
     progress = new Android.App.ProgressDialog(this);
     progress.Indeterminate = true;
     progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
     progress.SetMessage("Добавяне на абонат ...");
     progress.SetCancelable(false);
     progress.Show();
 }
 protected void CancelDelete()
 {
     progress = ProgressDialog.Show(this, "Обработка...", "Пожалуйста, подождите.", true);
     if (doctor.ID != 0) {
         DoctorManager.DeleteDoctor(doctor.ID);
     }
     progress.Dismiss();
     Finish();
 }
 protected void CancelDelete()
 {
     progress = ProgressDialog.Show(this, "Обработка...", "Пожалуйста, подождите.", true);
     if (hospital.ID != 0) {
         HospitalManager.DeleteHospital(hospital.ID);
     }
     progress.Dismiss();
     Finish();
 }
Exemple #48
0
	    public static void MakeCall(CallEntity callEntity, Activity activity)
	    {
            var category = callEntity.Category;
            var choice = callEntity.Choice ?? "";
            var detail = callEntity.Detail ?? "";

	        new AlertDialog.Builder(activity)
	            .SetTitle(category + " " + choice + " " + detail)
	            .SetMessage(Strings.CallSendMessage)
	            .SetPositiveButton(Strings.CallSend, delegate
	            {
                    ThreadPool.QueueUserWorkItem(o =>
                    {
                        activity.RunOnUiThread(() =>
                        {
                            dialog = new ProgressDialog(activity);
                            dialog.SetMessage(Strings.SpinnerDataSending);
                            dialog.SetCancelable(false);
                            dialog.Show();
                        });

                        try
                        {
                            ICall patientCall = new PatientCall();
                            // Assign the callid with the returned MongoDB id
                            callEntity._id = patientCall.MakeCall(callEntity);

                            activity.RunOnUiThread(() =>
                            {
                                // Call successfull, take the user to myCalls
                                activity.ActionBar.SelectTab(activity.ActionBar.GetTabAt(1));
                                SetNewCalls(callEntity);
                                dialog.Hide();
                            });
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("ERROR making call: " + ex.Message);

                            activity.RunOnUiThread(() =>
                            {
                                dialog.Hide();

                                new AlertDialog.Builder(activity).SetTitle(Strings.Error)
                                    .SetMessage(Strings.ErrorSendingCall)
                                    .SetPositiveButton(Strings.OK,
                                        delegate { }).Show();
                            });
                        }
              
                    });
             
	            })
            .SetNegativeButton(Strings.Cancel, delegate {/* Do nothing */ })
            .Show();
	    }
        public async void Validate()
        {
            var errorMsg = "";

            if (user.Text.Length == 0 && pass.Text.Length == 0)
            {
                if (user.Text.Length == 0 || pass.Text.Length == 0)
                {
                    errorMsg = "Please enter User Name ";
                }
                if (pass.Text.Length == 0 || pass.Text.Length == 0)
                {
                    errorMsg = errorMsg + "Please enter Password";
                }

                Toast.MakeText(this, errorMsg, ToastLength.Long).Show();
                return;
            }
            else
            {
                Boolean result = ic.connectivity();
                if (result)
                {
                    progress = new Android.App.ProgressDialog(this);
                    progress.Indeterminate = true;
                    progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                    progress.SetCancelable(false);
                    progress.SetMessage("Please wait...");
                    progress.Show();
                    JsonValue login_value = null;
                    try
                    {
                        login_value = await nextActivity(user.Text, pass.Text);
                    }
                    catch (Exception e)
                    {
                    }
                    if (login_value != null)
                    {
                        await ParseAndDisplay(login_value, user.Text);
                    }
                    else
                    {
                        Toast.MakeText(this, "No Internet", ToastLength.Long).Show();
                    }

                    //  loginId1 = user.Text;
                    // password1 = pass.Text;
                }
                else
                {
                    Toast.MakeText(this, "No Internet", ToastLength.Long).Show();
                }
            }
        }
 public void RegisterGCMID()
 {
     //AndHUD.Shared.Show(_context, "Registering...", (int)AndroidHUD.MaskType.Clear);
     progressDialog = Android.App.ProgressDialog.Show(this, "Please wait...", "Registering gcm...", true);
     if (true)
     {
         waitingForGCM = true;
         var intent = new Intent(this, typeof(RegistrationIntentService));
         StartService(intent);
     }
 }
        private void ShowProgressDialog()
        {
            //  Looper.Prepare();

            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Обновяване ...");
            progress.SetCancelable(false);
            progress.Show();
        }
Exemple #52
0
        public async Task getorglist(string org_id)
        {
            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");
            progress.Show();

            dynamic value = new ExpandoObject();

            value.OrgId = org_id;

            string json = JsonConvert.SerializeObject(value);

            try
            {
                string item = await restservice.MarkingList(this, json, location).ConfigureAwait(false);

                markinglist = JsonConvert.DeserializeObject <List <MarkingListModel> >(item);
                markinglist[0].DesignationName = "Select Designation";
                for (int j = 0; j < markinglist.Count; j++)
                {
                    MarkingListModel model = new MarkingListModel();
                    model.DesignationName = markinglist[j].DesignationName;
                    addmarkinglist.Add(model);
                }
                //db.InsertMarkingList(markinglist);

                progress.Dismiss();
            }
            catch (Exception ex)
            {
                progress.Dismiss();
            }

            if (markinglist != null)
            {
                this.RunOnUiThread(() =>
                {
                    designationSpinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Selectdesignation_ItemSelected);
                    ArrayAdapter adapter1            = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, addmarkinglist);
                    designationSpinner.Adapter       = adapter1;
                });

                //Activity.RunOnUiThread(() =>
                //{
                //    marked = new MarkingListAdapter(this, markinglist);
                //    list.SetAdapter(marked);
                //});
            }
            progress.Dismiss();
        }
Exemple #53
0
        private void BtnIngresar_Click(object sender, System.EventArgs e)
        {
            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Iniciando Sesion... Por Favor espere...");
            progress.SetCancelable(false);
            progress.Show();
            RunOnUiThread(() =>
            {
                try
                {
                    //creando la conexion
                    MySqlConnection miConecion = new MySqlConnection(@"Password=PnH5LYCjBx;Persist Security Info=True;User ID=sql8171912;Initial Catalog=sql8171912;Data Source=sql8.freesqldatabase.com");
                    //abriendo conexion
                    miConecion.Open();

                    MySqlCommand comando = new MySqlCommand("select id, password from usuarios where id = '" + User.Text + "'And password = '******' ", miConecion);

                    //ejecuta una instruccion de sql devolviendo el numero de las filas afectadas
                    comando.ExecuteNonQuery();
                    DataSet ds          = new DataSet();
                    MySqlDataAdapter da = new MySqlDataAdapter(comando);

                    //Llenando el dataAdapter
                    da.Fill(ds, "usuarios");
                    //utilizado para representar una fila de la tabla que necesitas en este caso usuario
                    DataRow DR;
                    DR = ds.Tables["usuarios"].Rows[0];

                    //evaluando que la contraseña y usuario sean correctos
                    if ((User.Text == DR["id"].ToString()) || (Password.Text == DR["password"].ToString()))
                    {
                        string user = User.Text;

                        //instanciando la actividad principal
                        Intent intent = new Intent(this, typeof(Inicio));
                        intent.PutExtra("IdUser", user);

                        StartActivity(intent);
                    }
                    else
                    {
                        Toast.MakeText(this, "Error! Su contraseña y/o usuario son invalidos", ToastLength.Long);
                    }
                }
                catch
                {
                    Toast.MakeText(this, "Error! Su contraseña y/o usuario son invalidos", ToastLength.Long);
                }
            });
        }
Exemple #54
0
        public async void button_Click(object sender, EventArgs e)
        {
            MSCognitiveServices cognitiveServices = new MSCognitiveServices();
            MyClass             c = new MyClass();
            string path           = string.Empty;
            string albumPath      = string.Empty;
            Stream data           = await c.LoadPhoto(path, albumPath);

            progress = new Android.App.ProgressDialog(this);
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Loading... Please wait...");
            progress.SetCancelable(false);
            progress.Show();
            MemoryStream faceStream = new MemoryStream();

            data.CopyTo(faceStream);
            data.Seek(0, SeekOrigin.Begin);
            MemoryStream emotionStream = new MemoryStream();

            data.CopyTo(emotionStream);
            data.Seek(0, SeekOrigin.Begin);
            faceStream.Seek(0, SeekOrigin.Begin);
            emotionStream.Seek(0, SeekOrigin.Begin);
            Dictionary <string, string> faceProperties = await cognitiveServices.GetFaceProperties(faceStream);

            Dictionary <string, float> emotionProperties = await cognitiveServices.GetEmotionProperties(emotionStream);

            var et_faceText = FindViewById <TextView>(Resource.Id.et_faceText);

            et_faceText.Text = string.Format("Gender: {0} Age: {1}", faceProperties["Gender"], faceProperties["Age"]);
            var et_emotionText   = FindViewById <TextView>(Resource.Id.et_emotionText);
            var et_emotionText_1 = FindViewById <TextView>(Resource.Id.et_emotionText_1);
            var et_emotionText_2 = FindViewById <TextView>(Resource.Id.et_emotionText_2);
            var et_emotionText_3 = FindViewById <TextView>(Resource.Id.et_emotionText_3);

            et_emotionText.Text   = string.Format("Anger: {0}% Contempt:{1}% ", emotionProperties["Anger"], emotionProperties["Contempt"]);
            et_emotionText_1.Text = string.Format("Fear: {0}% Happiness:{1}% ", emotionProperties["Fear"], emotionProperties["Happiness"]);
            et_emotionText_2.Text = string.Format("Sadness: {0}% Surprise:{1}%", emotionProperties["Sadness"], emotionProperties["Surprise"]);
            et_emotionText_3.Text = string.Format("Disgust:{0}% Neutral:{1}%", emotionProperties["Disgust"], emotionProperties["Neutral"]);
            var imageView = FindViewById <ImageView>(Resource.Id.myImageView);

            using (var stream = data)
            {
                var bitmap = BitmapFactory.DecodeStream(stream);
                imageView.SetImageBitmap(bitmap);
                // do stuff with bitmap
            }
            progress.Hide();
            faceStream.Close();
            emotionStream.Close();
        }
        /// <summary>
        /// Shows the progress dialog
        /// </summary>
        /// <param name="message">The message to display</param>
        public void Show(string message)
        {
            if (_currentDialog != null)
            {
                this.Hide();
            }

            _currentDialog = new ProgressDialog(_activity);
            _currentDialog.Indeterminate = true;
            _currentDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
            _currentDialog.SetMessage(message);
            _currentDialog.SetCancelable(false);
            _currentDialog.Show();
        }
Exemple #56
0
        public void ShowProgressMessage(string message, bool spinner)
        {
            spinners++;

            if (m_Progress == null)
            {
                switch (theme)
                {
                case Theming.Themes.Comos:
                    m_Progress = new ProgressDialog(m_Activity, ProgressDialog.ThemeHoloLight);
                    break;

                case Theming.Themes.Siemens:
                    m_Progress = new ProgressDialog(m_Activity, ProgressDialog.ThemeDeviceDefaultLight);
                    break;

                case Theming.Themes.Light:

                    m_Progress = new ProgressDialog(m_Activity, ProgressDialog.ThemeHoloDark);
                    break;

                case Theming.Themes.Black:
                    m_Progress = new ProgressDialog(m_Activity, ProgressDialog.ThemeDeviceDefaultDark);
                    break;

                default:
                    m_Progress = new ProgressDialog(m_Activity);
                    break;
                }


                m_Progress.Indeterminate = true;
                if (spinner)
                {
                    m_Progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                }
                else
                {
                    m_Progress.SetProgressStyle(Android.App.ProgressDialogStyle.Horizontal);
                }
                m_Progress.SetMessage(message);
                m_Progress.SetCancelable(false);
                m_Progress.SetMessage(message);
                m_Progress.Show();
            }
            else
            {
                m_Progress.SetMessage(message);
            }
        }
Exemple #57
0
        protected void showProgressDialog(int messageId)
        {
            if (progressDialog != null && progressDialog.IsShowing)
            {
                return;
            }

            if (progressDialog == null)
            {
                progressDialog = new Android.App.ProgressDialog(this);
                progressDialog.SetCancelable(false);
            }
            progressDialog.SetMessage(Resources.GetString(messageId));
            progressDialog.Show();
        }
Exemple #58
0
 public void HideProgressMessage()
 {
     if (m_Progress != null)
     {
         if (spinners == 1)
         {
             m_Progress.Dismiss();
             spinners   = 0;
             m_Progress = null;
         }
         else
         {
             spinners--;
         }
     }
 }
        private async void TryRegister(object sender, EventArgs e)
        {
            ProgressDialog progress;

            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Registering... Please wait...");
            progress.SetCancelable(false);
            progress.Show();
            EditText username        = (EditText)FindViewById(Resource.Id.usernameReg);
            EditText password        = (EditText)FindViewById(Resource.Id.passwordInput1);
            EditText confirmPassword = (EditText)FindViewById(Resource.Id.passwordInput2);

            if (password.Text == confirmPassword.Text)
            {
                string hashedPassword = PasswordStorage.CreateHash(password.Text);
                string userName       = username.Text.Trim();
                //CurrentPlatform.Init();
                Users newUser = new Users {
                    Username = userName, Password = hashedPassword
                };
                List <Users> allUsers = await MobileService.GetTable <Users>().ToListAsync();

                Users u = allUsers.FirstOrDefault(x => x.Username == newUser.Username);
                if (u == null)
                {
                    DBHelper.InsertNewUser(newUser);
                    //MobileService.GetTable<Users>().InsertAsync(newUser);
                    progress.Hide();
                    Toast.MakeText(ApplicationContext, "User " + newUser.Username + " created! You can now log in!", ToastLength.Short).Show();
                    StartActivity(typeof(MainActivity));
                }
                else
                {
                    progress.Hide();
                    Toast.MakeText(ApplicationContext, "User " + u.Username + " already exists!", ToastLength.Short).Show();
                }
            }
            else
            {
                progress.Hide();
                string message = "Passwords don't match.";
                Toast.MakeText(ApplicationContext, message, ToastLength.Short).Show();
            }
        }
Exemple #60
0
        private async void Botonregistrar_Click(object sender, EventArgs e)
        {
            progress = new Android.App.ProgressDialog(this.Context);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Registrando...Espere...");
            progress.SetCancelable(false);
            progress.Show();

            string dni    = txtdni.Text;
            string nombre = txtnombre.Text;
            string email  = txtEmail.Text;
            string telef  = txtTele_F.Text;
            string telec  = txtTele_C.Text;

            try
            {
                if (!string.IsNullOrEmpty(dni) || !string.IsNullOrEmpty(nombre) || !string.IsNullOrEmpty(email) || !string.IsNullOrEmpty(telef) || !string.IsNullOrEmpty(telec))
                {
                    //await
                    var dato = await controller.RegistraCliente(int.Parse(dni), nombre, email, int.Parse(telef), int.Parse(telec));

                    if (dato != null)
                    {
                        progress.Dismiss();
                        Toast.MakeText(this.Context, "Registrado Correctamente", ToastLength.Short).Show();
                        LimpiarCasillas();
                    }
                    else
                    {
                        progress.Dismiss();
                        Toast.MakeText(this.Context, "Error al Registrar", ToastLength.Short).Show();
                        LimpiarCasillas();
                    }
                }
                else
                {
                    progress.Dismiss();
                    Toast.MakeText(this.Context, "Campos vacios", ToastLength.Short).Show();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }