Пример #1
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();
            };
        }
Пример #2
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();
        }
Пример #3
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 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;
							}
						}
					}
				};
			}
		}
Пример #5
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();
        }
Пример #6
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;
            }
        }
Пример #7
0
        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();
                }
            };
        }
Пример #8
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;
        }
Пример #9
0
        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;
            }
        }
Пример #10
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();
            }
        }
Пример #11
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;
        }
Пример #12
0
        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 ();
                    }));
        }
Пример #13
0
        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));
            };
        }
Пример #14
0
 public static ProgressDialog ShowStatus(Context cxt, string msg)
 {
     ProgressDialog status = new ProgressDialog(cxt);
     status.SetMessage(msg);
     status.Show();
     return status;
 }
Пример #15
0
        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);
        }
Пример #16
0
        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;
        }
		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();
		}
Пример #18
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();
            };
        }
Пример #19
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();
 }
Пример #20
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 ();
		}
Пример #21
0
 void ShowDialog()
 {
     progress = new ProgressDialog(this);
     progress.Indeterminate = true;
     progress.SetProgressStyle(ProgressDialogStyle.Spinner);
     progress.SetMessage("Please wait...");
     progress.SetCancelable(false);
     progress.Show();
 }
Пример #22
0
 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();
 }
Пример #23
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();
 }
Пример #24
0
 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();
 }
 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();
 }
Пример #26
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();
                }
            }
        }
        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();
            }
        }
Пример #28
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();
	    }
Пример #29
0
        public static ProgressDialog ShowLoadingDialog(Context context)
        {
            var loadingDialog = new ProgressDialog(context);
            loadingDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
            loadingDialog.Show();
            return loadingDialog;

            // Alt
            //ProgressDialog.Show(this, "Retrieving Nearby Places", "Please wait...", true);
        }
Пример #30
0
 protected override void OnPreExecute()
 {
     base.OnPreExecute();
     progDialog = new ProgressDialog(activity);
     progDialog.SetMessage("Logging Out...");
     progDialog.Indeterminate=false;
     progDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
     progDialog.SetCancelable(true);
     progDialog.Show();
 }
Пример #31
0
		public void showProgressRootView(Activity _activity){
			if (progressDialogParentRootView != null) {
				progressDialogParentRootView.Hide ();
				progressDialogParentRootView = null;
			}
			progressDialogParentRootView = ProgressDialog.Show (_activity, "", "", true);
			progressDialogParentRootView.SetContentView(new ProgressBar(_activity));
			progressDialogParentRootView.SetCancelable (true);
			progressDialogParentRootView.Show ();
		}
Пример #32
0
        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();
                }
            }
        }
Пример #33
0
 public static ProgressDialog ShowProgressDialog(Activity activity, int messageResId, /*int titleResId,*/ bool allowCancel, ProgressDialogStyle style=ProgressDialogStyle.Spinner)
 {
     ProgressDialog dialog = new ProgressDialog(activity);
     dialog.SetProgressStyle(style);
     //dialog.SetTitle(titleResId);
     dialog.SetMessage(activity.Resources.GetString(messageResId));
     dialog.SetCancelable(allowCancel);
     dialog.SetCanceledOnTouchOutside(allowCancel);
     dialog.Show();
     return dialog;
 }
Пример #34
0
        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();
        }
Пример #35
0
 private void Start(ProgressDialog pd)
 {
     try
     {
         pd.Show();
     }
     catch (System.Exception ex)
     {
         Log.Debug("TEST", ex.Message);
     }
 }
        public ExpenseFormArrayAdapter(Activity context)
            : base()
        {
            this.context = context;
            this.items = new List<SavedExpenseForm> ();
            mDialog = new ProgressDialog(this.context);
            mDialog.SetMessage("Loading...");
            mDialog.SetCancelable(false);

            Backend.Current.getExpenseForms(OnGetExpenseFormsSuccess, OnGetExpenseFormsFail);
            mDialog.Show ();
        }
Пример #37
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();
        }
Пример #38
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);
                }
            });
        }
Пример #39
0
 private void ShowProgressDialog(ProgressDialog progressDialog, string message, bool show)
 {
     if (show)
     {
         progressDialog.Indeterminate = true;
         progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
         progressDialog.SetMessage(message);
         progressDialog.SetCancelable(false);
         progressDialog.Show();
     }
     else
         progressDialog.Hide();
 }
 public override void ShowProgressDialog(string message)
 {
     _context.RunOnUiThread(() => {
         if(_progressDialog != null)
         {
             _progressDialog.Dismiss ();
             _progressDialog= null;
         }
         _progressDialog = new ProgressDialog(_context);
         _progressDialog.SetMessage(message);
         _progressDialog.Show();
     });
 }
Пример #41
0
	public static void ShowProgressDialog(Activity context, string msg="Loading",  string title="",bool isCancle=false) {
		if(_mProgressDialog != null)	return;
		
		_mProgressDialog = new ProgressDialog(context);
		_mProgressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
		_mProgressDialog.SetTitle(title);
        _mProgressDialog.SetMessage(msg);
        _mProgressDialog.SetCancelable(isCancle);
	    if (!context.IsFinishing)
	    {
	        _mProgressDialog.Show();
	    }
	}
Пример #42
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();
        }
Пример #43
0
        /// <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();
        }
Пример #44
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);
            }
        }
Пример #45
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();
        }
Пример #46
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());
            }
        }
Пример #47
0
        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();
            }
        }
Пример #48
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

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

			product_id = Intent.GetIntExtra("product_id",0);
			//setup background worker for data loading
			worker = new BackgroundWorker ();
			worker.DoWork += worker_DoWork;
			worker.WorkerSupportsCancellation = true;
			worker.RunWorkerCompleted += worker_RunWorkerCompleted;
			worker.RunWorkerAsync ();

			progress = new ProgressDialog(this);
			progress.Indeterminate = true;
			progress.SetProgressStyle(ProgressDialogStyle.Spinner);
			progress.SetMessage("Memuatkan data..");
			progress.SetCancelable(false);
			progress.Show();


			productImage = FindViewById<MultiImageView>(Resource.Id.productImage);
			tv_price = FindViewById <TextView> (Resource.Id.tv_price);
			tv_prodTitle = FindViewById <TextView> (Resource.Id.tv_prodTitle);
			wv_prodDesc = FindViewById <WebView> (Resource.Id.wv_prodDesc);
//			btn_addToCart = FindViewById <Button> (Resource.Id.btn_addToCart);
			btn_sellerInfo = FindViewById <Button> (Resource.Id.btn_sellerInfo);

     		var toolbar = FindViewById<V7Toolbar>(Resource.Id.toolbar);
			SetSupportActionBar (toolbar);
			toolbar.SetBackgroundColor (Color.ParseColor ("#9C27B0"));

			SupportActionBar.SetDisplayHomeAsUpEnabled (true);
			SupportActionBar.SetDisplayShowHomeEnabled (true);


			//call addToCart method
//			btn_addToCart.Click += (sender, e) => {
//				addToCart();
//			};

			btn_sellerInfo.Click += btnSellerInfo_click;

		}	
Пример #49
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            _progressDialog = new ProgressDialog(this);
            _progressDialog.SetMessage("Searching.  Please wait...");
            _progressDialog.Show();

            if (Intent.ActionSearch.Equals(Intent.Action))
            {
                string query = Intent.GetStringExtra(SearchManager.Query);

                Task.Factory
                    .StartNew(() =>
                        _productRepository.Search (query))
                    .ContinueWith(task =>
                        RunOnUiThread(() => RenderResults(task.Result)));
            }
        }
Пример #50
0
        public BackgroundJob(MonitoredActivity activity, Action job,
		                     ProgressDialog progressDialog, Handler handler)
		{
			this.activity = activity;
			this.progressDialog = progressDialog;
			this.job = job;			
			this.handler = handler;

			activity.Destroying += (sender, e) =>  {
				// We get here only when the onDestroyed being called before
				// the cleanupRunner. So, run it now and remove it from the queue
				cleanUp();
				handler.RemoveCallbacks(cleanUp);
			};

			activity.Stopping += (sender, e) =>progressDialog.Hide();
			activity.Starting += (sender, e) => progressDialog.Show();
		}
Пример #51
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.courseDetailToolBar);

            courseCode = Intent.GetStringExtra("courseCode") ?? "Data not available";

            //Defines the settings for progress bar
            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();
            try
            {
                await Task.Run(() => CourseListFetcher(courseCode));

                await Task.Run(() => InstructorListFetcher(courseCode));

                progress.Hide();

                //listSample.Add("Getting Instructors");

                InitData();

                FindViews();
                //foreach (var item in listSample)
                //{
                //    Console.WriteLine("ListSample : " + item);
                //}
                //foreach (var item in userID)
                //{
                //    Console.WriteLine("UserIDs : " + item);
                //}
            }
            catch (System.Exception something)
            {
                progress.Hide();
                Console.WriteLine("Something : " + something);
                throw;
            }
        }
Пример #52
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     switch (item.ItemId) {
         case global::Android.Resource.Id.Home:
             var intent = new Intent(this, typeof(MainActivity));
             intent.PutExtra ("defaultTab", 1);
             intent.AddFlags (ActivityFlags.ClearTop);
             StartActivity (intent);
             break;
         case Resource.Id.menuSaveGroup:
             _progressDialog = new ProgressDialog(this);
             _progressDialog.SetMessage("Saving SMS Group.  Please wait...");
             _progressDialog.Show();
             Task.Factory
                 .StartNew(SaveGroup)
                 .ContinueWith(task =>
                     RunOnUiThread(() =>
                             {
                                 _progressDialog.Dismiss ();
                                 var homeIntent = new Intent();
                                 homeIntent.PutExtra ("defaultTab", 1);
                                 homeIntent.AddFlags (ActivityFlags.ClearTop);
                                 homeIntent.SetClass (this, typeof(MainActivity));
                                 StartActivity(homeIntent);
                             }));
             break;
         case Resource.Id.menuCancelEdit:
             new AlertDialog.Builder(this)
                 .SetTitle ("Cancel")
                 .SetMessage ("Are you sure you want to cancel your changes for this SMS Group?")
                 .SetPositiveButton ("Yes", (o, e) => {
                         var homeIntent = new Intent();
                         homeIntent.PutExtra ("defaultTab", 1);
                         homeIntent.AddFlags (ActivityFlags.ClearTop);
                         homeIntent.SetClass (this, typeof(MainActivity));
                         StartActivity(homeIntent);
                     })
                 .SetNegativeButton ("No", (o, e) => { })
                 .Show ();
             break;
     }
     return true;
 }
Пример #53
0
        public async Task getOrgData()
        {
            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 = orgid;

            //   string json = JsonConvert.SerializeObject(value);
            try
            {
                string item = await restservice.OrgnizationList(this, "", location);

                //orgmodel[0].organizationName = "Select Orgnization";
                orgmodel = JsonConvert.DeserializeObject <List <OrgModel> >(item);
                orgmodel[0].organizationName = "Select Organization";
                for (int i = 0; i < orgmodel.Count; i++)
                {
                    OrgModel org = new OrgModel();
                    //org.organizationName=orgmodel[0].
                    org.organizationName = orgmodel[i].organizationName;
                    orgname.Add(org);
                }
                //  db.InsertMarkingList(orgmodel);

                progress.Dismiss();

                spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Selectorg_ItemSelected);
                ArrayAdapter adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, orgname);
                spinner.Adapter = adapter;

                //  getorglist()
            }

            catch (Exception ex)
            {
                progress.Dismiss();
            }
        }
Пример #54
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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

            var ListItemColor = FindViewById <ListView>(Resource.Id.ListItemColor);
            var txview        = FindViewById <TextView>(Resource.Id.txview);


            ListItemColor.Adapter = new CustomAdapters.ColorAdapter(this,

                                                                    Resource.Layout.ListItems,
                                                                    Resource.Id.textView2,
                                                                    Resource.Id.textView3,
                                                                    Resource.Id.imageView1
                                                                    );


            Data = new Complex();
            if (Data.res == null)
            {
                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();

                res = await Validate();

                Data.res = res;
                progress.Cancel();
            }
            else
            {
                res = Data.GetRes();
            }

            txview.Text = res;
        }
Пример #55
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            var groupId = Intent.GetIntExtra ("groupId", -1);
            GroupId = groupId;

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

            Task.Factory
                .StartNew(() =>
                    GetContacts(groupId))
                .ContinueWith(task =>
                    RunOnUiThread(() => {
                        DisplayContacts(task.Result);
                        _progressDialog.Dismiss ();
                    }));
        }
Пример #56
0
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			View view = inflater.Inflate (Resource.Layout.MyShop_ProductDetails, container, false);

			//setup background worker for data loading
			worker = new BackgroundWorker ();
			worker.DoWork += worker_DoWork;
			worker.WorkerSupportsCancellation = true;
			worker.RunWorkerCompleted += worker_RunWorkerCompleted;
			worker.RunWorkerAsync ();

			progress = new ProgressDialog(Activity);
			progress.Indeterminate = true;
			progress.SetProgressStyle(ProgressDialogStyle.Spinner);
			progress.SetMessage("Memuatkan data..");
			progress.SetCancelable(false);
			progress.Show();


			productImage = view.FindViewById<MultiImageView>(Resource.Id.productImage);
			tv_price = view.FindViewById <TextView> (Resource.Id.tv_price);
			tv_prodTitle = view.FindViewById <TextView> (Resource.Id.tv_prodTitle);
			wv_prodDesc = view.FindViewById <WebView> (Resource.Id.wv_prodDesc);
			//			btn_addToCart = FindViewById <Button> (Resource.Id.btn_addToCart);
			btn_sellerInfo = view.FindViewById <Button> (Resource.Id.btn_sellerInfo);

//			var toolbar = FindViewById<V7Toolbar>(Resource.Id.toolbar);
//			SetSupportActionBar (toolbar);
//			SupportActionBar.SetDisplayHomeAsUpEnabled (true);


			//call addToCart method
			//			btn_addToCart.Click += (sender, e) => {
			//				addToCart();
			//			};

			btn_sellerInfo.Click += btnSellerInfo_click;

			return view;
		}
Пример #57
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

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

            // Get our button from the layout resource,
            // and attach an event to it
            EditText txtEmail = FindViewById<EditText> (Resource.Id.txtEmail);
            EditText txtPassword = FindViewById<EditText> (Resource.Id.txtPassword);
            Button loginButton = FindViewById<Button> (Resource.Id.btnLogin);

            mDialog = new ProgressDialog(this);
            mDialog.SetMessage("Logging in...");
            mDialog.SetCancelable(false);

            loginButton.Click += delegate {
                mDialog.Show ();
                Backend.Current.login(txtEmail.Text, txtPassword.Text, OnLoginSuccess, OnLoginFail);
            };
        }
Пример #58
0
    private async Task Initialize()
    {
      if (Initialized) return;
      Initialized = true;

      // create binding manager
      Bindings = new BindingManager(this);

      //ErrorText = FindViewById<TextView>(Resource.Id.ErrorText);

      var saveButton = FindViewById<Button>(Resource.Id.SaveButton);
      saveButton.Click += SaveButton_Click;
      var cancelButton = FindViewById<Button>(Resource.Id.CancelButton);
      cancelButton.Click += CancelButton_Click;
      var deleteButton = FindViewById<Button>(Resource.Id.DeleteButton);
      deleteButton.Click += DeleteButton_Click;

      var dialog = new ProgressDialog(this);
      dialog.SetMessage(Resources.GetString(Resource.String.Loading));
      dialog.SetCancelable(false);
      dialog.Show();

      try
      {
        var customerEdit = await Library.CustomerEdit.GetCustomerEditAsync(1);
        InitializeBindings(customerEdit);
      }
      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();
      }
    }
Пример #59
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Android.Resource.Id.Home:
                OnBackPressed();
                break;
            case Resource.Id.save_image:
                progress = new ProgressDialog (this);
                progress.SetMessage ("Загрузка...");
                progress.Show();
                Task.Factory.StartNew (async () => {
                    try{

                        await WebClient.CreateRealFileAsync(_fileUrl);
                        RunOnUiThread(()=>{
                            progress.Dismiss();
                        });
                    }
                    catch (Exception ex)
                    {
                        RunOnUiThread(()=>{
                            progress.Dismiss();
                            Toast.MakeText(Application.Context,"Ошибка сохранения",ToastLength.Short).Show();
                        });
                    }
                });
                break;
            case Resource.Id.copy_link:
                ClipboardManager clipManager = (ClipboardManager)GetSystemService (ClipboardService);
                ClipData clip = ClipData.NewPlainText ("url", _fileUrl);
                clipManager.PrimaryClip = clip;
                break;
            default:
                return base.OnOptionsItemSelected(item);
            }
            return true;
        }
Пример #60
0
		async void  LogInProcess(object sender, EventArgs e)
		{
			errormsg = FindViewById<TextView> (Resource.Id.errorMSG);
			if (Common.checkNWConnection (this) == true) {
				
				Exception error = null;

				if (!String.IsNullOrEmpty (username.Text) && !String.IsNullOrEmpty (password.Text)) {
					ProgressDialog dialog = new ProgressDialog (this);
					dialog.SetMessage ("Đăng nhập...");
					dialog.Indeterminate = false;
					dialog.SetCancelable (false);
					
					dialog.Show ();
					error=await BUser.CheckAuth(username.Text,password.Text,SQLite_Android.GetConnection());
					if (error==null) {
						Intent myintent = new Intent (this, typeof(DrawerActivity));
						myintent.PutExtra ("FirstLoad", true);
						dialog.SetMessage ("Đang tải dữ liệu....");
						await Common.LoadDataFromSV (this);
						StartActivity (myintent);

						this.Finish ();
					} else {
						dialog.Dismiss ();
						errormsg.Text = error.Message;

					}
				}
				else
				{
					errormsg.Text = "Vui lòng nhập đầy đủ thông tin đăng nhập";
				}
			} else {
				errormsg.Text = "Không có kết nối mạng, vui lòng thử lại sau";
			}
		}