Пример #1
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);
            }
        }
Пример #2
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;
            }
        }
		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;
							}
						}
					}
				};
			}
		}
Пример #4
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();
                }
            };
        }
Пример #5
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;
            }
        }
Пример #6
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();
            };
        }
Пример #7
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();
            }
        }
Пример #8
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();
            };
        }
Пример #9
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();
        }
Пример #10
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();
        }
Пример #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;
        }
		public ProgressDialogHelper(Context context) {
			this.progress = new ProgressDialog(context);
			progress.SetProgressStyle(ProgressDialogStyle.Spinner);
			progress.Indeterminate = false;
			progress.Progress = 99;
			progress.SetCanceledOnTouchOutside(false);
		}
Пример #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 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;
 }
Пример #15
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();
 }
Пример #16
0
 void ShowDialog()
 {
     progress = new ProgressDialog(this);
     progress.Indeterminate = true;
     progress.SetProgressStyle(ProgressDialogStyle.Spinner);
     progress.SetMessage("Please wait...");
     progress.SetCancelable(false);
     progress.Show();
 }
Пример #17
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();
 }
 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();
 }
Пример #19
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();
                }
            }
        }
Пример #20
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();
 }
        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();
            }
        }
Пример #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
 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();
 }
Пример #24
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);
        }
Пример #25
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();
                }
            }
        }
Пример #26
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;
 }
Пример #27
0
 public DownloadFileHelper(Activity parent)
 {
     CallingActivity = parent;
     progress = new ProgressDialog(CallingActivity);
     progress.Indeterminate = false;
     progress.SetProgressStyle(ProgressDialogStyle.Horizontal);
     progress.SetMessage("Downloading. Please wait...");
     progress.SetCancelable(false);
     progress.Max = 100;
     //OnFinishDownloadHandle += new OnFinishDownload (FinishDownload);
 }
 private ProgressDialog CreateProgressDialog()
 {
     var progress = new ProgressDialog(this)
     {
         Indeterminate = true
     };
     progress.SetCancelable(false);
     progress.SetProgressStyle(ProgressDialogStyle.Spinner);
     progress.SetMessage("Contacting server. Please wait...");
     return progress;
 }
Пример #29
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();
        }
Пример #30
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();
        }
Пример #31
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);
                }
            });
        }
Пример #32
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();
	    }
	}
Пример #33
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();
 }
Пример #34
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();
        }
Пример #35
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();
        }
Пример #36
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            base.OnCreateView (inflater, container, savedInstanceState);

            dates = SyncQueueManager.GetAvailableDates ();

            View view = inflater.Inflate (Resource.Layout.SyncFragment, container, false);

            SavedInflater = inflater;

            spnDates = view.FindViewById<Spinner> (Resource.Id.sfSelectedDateSpinner);
            spnDates.Adapter = new ArrayAdapter (Activity, Android.Resource.Layout.SimpleSpinnerItem, SyncQueueManager.DatesToString(dates));
            spnDates.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => {
            //				TextView tv = (TextView) e.View;
                selectedDate = dates[e.Position];
                Toast.MakeText(Activity, selectedDate.ToString(@"d"), ToastLength.Short).Show();
                queue = (List<SyncQueue>) SyncQueueManager.GetSyncQueue(dates[e.Position]);

                RefreshContent();
            };

            llSyncItems = view.FindViewById<LinearLayout> (Resource.Id.sfList);
            ivSync = view.FindViewById<ImageView> (Resource.Id.sfSyncImage);

            ivSync.Click += (object sender, EventArgs e) => {
                progressDialog = ProgressDialog.Show(Activity, "", "Loading rooms...", true);
                progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
                new Thread(new ThreadStart(delegate
                    {
                        //LOAD METHOD TO GET ACCOUNT INFO
                        Activity.RunOnUiThread(() => progressDialog.SetMessage(@"Начало загрузки информации о посещениях"));

                        UpLoadAttendances();
                        UpLoadAttendanceResults();
                        UpLoadAttendancePhotos();

                        //HIDE PROGRESS DIALOG
                        Activity.RunOnUiThread(() => { progressDialog.SetMessage(@"Обновление данных"); RefreshContent(); progressDialog.Dismiss(); }); //progressBar.Visibility = ViewStates.Gone);
                    })).Start();
            };

            Activity.Window.AddFlags (WindowManagerFlags.KeepScreenOn);

            return view;
        }
Пример #37
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;

		}	
Пример #38
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();
            }
        }
Пример #39
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());
            }
        }
Пример #40
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;
            }
        }
Пример #41
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();
            }
        }
Пример #42
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;
        }
Пример #43
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

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

            button.Click += delegate {
                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();
            };
        }
Пример #44
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;
		}
		public void Show (Android.Content.Context context, string messageToShow)
		{
			try {
				string message;

				if (String.IsNullOrEmpty (messageToShow)) {
					message = "Laden...";
				} else {
					message = messageToShow;
				}
				if (progressDialog != null) {
					progressDialog = null;
				}

				progressDialog = new ProgressDialog (context);
				progressDialog.Indeterminate = true;
				progressDialog.SetProgressStyle (ProgressDialogStyle.Spinner);
				progressDialog.SetMessage (message);
				progressDialog.SetCancelable (false);
				progressDialog.Show ();
			} catch (Exception ex){
				Insights.Report(ex);
			}
		}
Пример #46
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            SetContentView (Resource.Layout.AllEigenschappen);

            //Action bar
            InitializeActionBar (SupportActionBar);
            title = ActionBarTitle;
            query = ActionBarQuery;
            search = ActionBarSearch;
            back = ActionBarBack;

            mToastShort = Toast.MakeText (this, "", ToastLength.Short);
            mToastLong = Toast.MakeText (this, "", ToastLength.Long);

            currProfiel = _appController.CurrentProfiel;
            IsProfileNull = (currProfiel == null);
            eigenschappenList = _appController.Eigenschappen;

            //listener to pass to EigenschapAdapter containing context
            mListener = new MyOnCheckBoxClickListener (this);

            eigenschapAdapter = new EigenschapAdapter (this, _appController.Eigenschappen, mListener);
            allEigenschappenListView = FindViewById<ListView> (Resource.Id.all_eigenschappen_list);
            allEigenschappenListView.Adapter = eigenschapAdapter;

            title.Text = IsProfileNull ? "Eigenschappen" : "Selectie";
            query.Hint = "Zoek eigenschap";

            //hide keyboard when scrolling through list
            allEigenschappenListView.SetOnTouchListener(new MyOnTouchListener(this, query));

            //initialize progress dialog used when calculating totemlist
            progress = new ProgressDialog(this);
            progress.SetMessage("Totems zoeken...");
            progress.SetProgressStyle(ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);

            LiveSearch ();

            sharedPrefs = GetSharedPreferences("data", FileCreationMode.Private);

            var vind = FindViewById<LinearLayout> (Resource.Id.vind);
            vind.Click += VindTotem;

            bottomBar = FindViewById<RelativeLayout> (Resource.Id.bottomBar);

            search.Visibility = ViewStates.Visible;
            search.Click += (sender, e) => ToggleSearch ();

            //hide keyboard when enter is pressed
            query.EditorAction += (sender, e) => {
                if (e.ActionId == ImeAction.Search)
                    KeyboardHelper.HideKeyboard(this);
                else
                    e.Handled = false;
            };
        }
Пример #47
0
		protected override async void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);

			SetContentView(Resource.Layout.My_BackgroundReports);

			_progressDialog = new ProgressDialog(this);
			_progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
			_progressDialog.SetMessage("Loading Team . . .");
			_progressDialog.Show();

			//If the device is portrait, then show the RecyclerView in a vertical list,
			//else show it in horizontal list.
			_layoutManager = Resources.Configuration.Orientation == Android.Content.Res.Orientation.Portrait 
				? new LinearLayoutManager(this, LinearLayoutManager.Vertical, false) 
				: new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false);

			//Experiement with a GridLayoutManger! You can create some cool looking UI!
			//This create a gridview with 2 rows that scrolls horizontally.
			//            _layoutManager = new GridLayoutManager(this, 2, GridLayoutManager.Horizontal, false);

			//Create a reference to our RecyclerView and set the layout manager;
			_recyclerView = FindViewById<RecyclerView>(Resource.Id.mainActivity_recyclerView);
			_recyclerView.SetLayoutManager(_layoutManager);

			//Get our crew member data. This could be a web service.
			SharedData.CrewManifest = await BackgroundCheck_List_Data.GetAllCrewAsync();

			//Create the adapter for the RecyclerView with our crew data, and set
			//the adapter. Also, wire an event handler for when the user taps on each
			//individual item.
			_adapter = new BackgroundCheckRecyclerViewAdapter(SharedData.CrewManifest, this.Resources);
			_adapter.ItemClick += OnItemClick;
			_recyclerView.SetAdapter(_adapter);

			_progressDialog.Dismiss();

			mToolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar);
			mDrawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
			mLeftDrawer = FindViewById<ListView>(Resource.Id.left_drawer);
			mRightDrawer = FindViewById<ListView>(Resource.Id.right_drawer);


			mLeftDrawer.Tag = 0;
			mRightDrawer.Tag = 1;

			SetSupportActionBar(mToolbar);


			mLeftDataSet = new List<string>();
			mLeftDataSet.Add(GetString(Resource.String.my_profile));
			mLeftDataSet.Add(GetString(Resource.String.log_out));
			mLeftAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, mLeftDataSet);
			mLeftDrawer.Adapter = mLeftAdapter;

			//this.mLeftDrawer.ItemClick += mLeftDrawer_ItemClick;
			//this.mRightDrawer.ItemClick += mRightDrawer_ItemClick;

			mRightDataSet = new List<string>();
			mRightDataSet.Add(GetString(Resource.String.drawer_faq));
			mRightDataSet.Add(GetString (Resource.String.support));
			mRightDataSet.Add(GetString(Resource.String.rentproof_summary));
			mRightAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, mRightDataSet);
			mRightDrawer.Adapter = mRightAdapter;

			mDrawerToggle = new NavigationBar(
				this,							//Host Activity
				mDrawerLayout,					//DrawerLayout
				Resource.String.openDrawer,		//Opened Message
				Resource.String.closeDrawer		//Closed Message
			);

			mDrawerLayout.SetDrawerListener(mDrawerToggle);
			SupportActionBar.SetDisplayHomeAsUpEnabled (true);
			SupportActionBar.SetDisplayShowTitleEnabled(true);
			mDrawerToggle.SyncState();



			if (bundle != null){
				if (bundle.GetString("DrawerState") == "Opened"){
					SupportActionBar.SetTitle(Resource.String.openDrawer);
				}

				else{
					SupportActionBar.SetTitle(Resource.String.closeDrawer);
				}
			}

			else{
				//This is the first the time the activity is ran
				SupportActionBar.SetTitle(Resource.String.closeDrawer);
			}
		}
 public void ShowProgressDialog(string loadingMessage)
 {
     _progressDialog = new ProgressDialog(this);
     _progressDialog.SetMessage(loadingMessage);
     _progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
     _progressDialog.Show();
 }
Пример #49
0
 protected override void OnPreExecute()
 {
     base.OnPreExecute();
     System.Console.WriteLine ("PostTask PreExec");
     progDialog = new ProgressDialog(activity);
     progDialog.SetMessage("Posting...");
     progDialog.Indeterminate=false;
     progDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
     progDialog.SetCancelable(true);
     progDialog.Show();
 }
Пример #50
0
 private void ShowProgressDialog(ProgressDialog progressDialog, bool show)
 {
     if (show)
     {
         progressDialog.Indeterminate = true;
         progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
         progressDialog.SetMessage("Logging in. Please wait...");
         progressDialog.SetCancelable(false);
         progressDialog.Show();
     }
     else
         progressDialog.Hide();
 }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            gmb = new Gmusicbrowser("macdesktop.orospakr.ca", 8081);

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

            playButton = FindViewById<ImageButton>
                (Resource.Id.PlayButton);
            titleTextView = FindViewById <TextView> (Resource.Id.TitleTextView);
            artistTextView = FindViewById <TextView> (Resource.Id.ArtistTextView);
            ratingBar = FindViewById <RatingBar> (Resource.Id.RatingBar);
            nextButton = FindViewById <ImageButton> (Resource.Id.NextButton);
            prevButton = FindViewById <ImageButton> (Resource.Id.PrevButton);
            volumeSeekBar = FindViewById <SeekBar> (Resource.Id.VolumeSeekBar);
            songSeekBar = FindViewById <SeekBar> (Resource.Id.SongSeekbar);

            playButton.Click += (sender, args) => {
                // button.Text = string.Format ("{0} clicks!", count++);
                gmb.PushNewPlayerState(new Player() { Playing = currentState.Playing == 1 ? 0 : 1 }).ContinueWith((playerResult) => {
                    if(playerResult.IsFaulted) {
                    } else {
                        HandleUpdatedStateFromNetwork(playerResult.Result);
                    }
                });
            };

            ratingBar.RatingBarChange += (sender, e) => {
                if(currentState != null && currentState.Current != null) {
                    var newSong = new Song() { Id = currentState.Current.Id, Rating = (int)(ratingBar.Rating * 20)};
                    gmb.PostUpdatedSong(newSong);
                }
            };

            nextButton.Click += (sender, e) => {
                gmb.Next().ContinueWith((playerResult) => {
                    HandleUpdatedStateFromNetwork(playerResult.Result);
                });
            };

            prevButton.Click += (sender, e) => {
                gmb.Previous ().ContinueWith((playerResult) => {
                    HandleUpdatedStateFromNetwork(playerResult.Result);
                });
            };

            volumeSeekBar.ProgressChanged += (sender, e) => {
                if(!preventSeekBarUpdates) {
                    gmb.PushNewPlayerState (new Player() { Volume = volumeSeekBar.Progress / (float)100 });
                }
            };

            songSeekBar.ProgressChanged += (sender, e) => {
                if(!preventSeekBarUpdates) {
                    gmb.PushNewPlayerState (new Player() { PlayPosition = songSeekBar.Progress });
                }
            };

            prog = new ProgressDialog (this);
            prog.SetProgressStyle(ProgressDialogStyle.Spinner);
            prog.SetMessage(this.GetString(Resource.String.connection_progress));
            prog.Show ();
        }
		async void DeleteAllNotifications()
		{
			ProgressDialog progress = new ProgressDialog(Context);
			progress.Indeterminate = true;
			progress.SetProgressStyle(ProgressDialogStyle.Spinner);
			progress.SetMessage(Strings.clearing_notifications);
			progress.SetCancelable(false);
			progress.Show();

			bool result = false;
			try
			{
				await System.Threading.Tasks.Task.Run(() =>
				{
					result = TenServices.MarkAllNotificatiosAsRead(NotificationFragment.TableItems).Result;
				});
			}
			catch (Exception)
			{

			}
			finally
			{
				if (result)
				{
					NotificationFragment.TableItems.Clear();
					NotificationFragment.ListViewAdapater.NotifyDataSetChanged();
					NotificationFragment.ifFeedEmpty();
					await NotificationFragment.FetchTableData();
					ViewUtils.RemoveNotificaionBubble();
					TenServiceHelper.CheckForNewNotifications();

					toolbarImageFarLeft.Visibility = ViewStates.Invisible;
				}
				progress.Dismiss();
			}
		}
Пример #53
0
        private void StartVolumeCountdown()
        {
            reading = false;
            StopAction(true);

            const string message = " seconds remaining...\nTalk as loudly as possible!";
            const int startNum = 10;
            int remaining = startNum;

            ProgressDialog countDialog = null;

            RunOnUiThread(() =>
            {
                countDialog = new ProgressDialog(this);
                countDialog.SetMessage(remaining + message);
                countDialog.SetProgressStyle(ProgressDialogStyle.Horizontal);
                countDialog.SetCancelable(false);
                countDialog.Indeterminate = false;
                countDialog.Progress = 0;
                countDialog.Max = startNum;
                countDialog.Show();
            });

            audioManager.StartRecording(AppData.TempRecording.Path, 300);
            double[] vols = new double[startNum*5];

            while (remaining > 0)
            {
                if (countDialog == null)
                {
                    // Wait until the GUI thread has created the dialog window
                    Thread.Sleep(10);
                    continue;
                }

                RunOnUiThread(() =>
                {
                    countDialog.SetMessage(remaining + message);
                    countDialog.IncrementProgressBy(1);
                });

                int countStart = (startNum - remaining)*vols.Length/startNum;

                for (int i = countStart; i < countStart + vols.Length/startNum; i++)
                {
                    Thread.Sleep(200);
                    vols[i] = audioManager.GetAmplitude();
                }

                remaining--;
            }

            audioManager.StopRecording();

            double total = 0;

            foreach (double vol in vols)
            {
                total += vol;
            }

            loudTargetVol = (int) (total/vols.Length);

            RunOnUiThread(() => { countDialog.Hide(); });
        }
        private void SendInvites(List<Contact> toContactsList)
        {
            int count = 0;
            RunOnUiThread(delegate
            {
                dialog = new ProgressDialog(context);
                dialog.SetMessage(Application.Context.GetString(Resource.String.invitePBMessage));
                dialog.SetTitle(Application.Context.GetString(Resource.String.invitePBTitle));
                dialog.SetProgressStyle(ProgressDialogStyle.Horizontal);
                dialog.Max = toContactsList.Count;
                dialog.Progress = 0;
                dialog.Show();
            });
            switch (this.networkType)
            {

                case AccountOAuth.OAuthTypes.FaceBook:

                    foreach (Contact eachContact in toContactsList)
                    {
                        try
                        {
                            string oauthID = string.Empty;
                            for (int i = 0; i < eachContact.ContactOAuths.Count; i++)
                            {
                                if (eachContact.ContactOAuths [i].OAuthType == AccountOAuth.OAuthTypes.FaceBook)
                                {
                                    oauthID = eachContact.ContactOAuths [i].OAuthID;
                                    break;
                                }
                            }
            #if(DEBUG)
                            this.Provider.PostToFeed("Testing, nevermind. http://www.example.com", oauthID);
            #else
                        this.Provider.PostToFeed (string.Format (
                            Application.Context.GetString (Resource.String.inviteFacebookPostMessageFormat),
                            LOLConstants.LinkLOLAppWebsiteUrl), oauthID);
            #endif
                            RunOnUiThread(delegate
                            {
                                dialog.Progress = (int)(++count / toContactsList.Count);
                            });
                        } catch (Exception ex)
                        {
            #if(DEBUG)
                            System.Diagnostics.Debug.WriteLine("Exception inviting user: {0} {1}\n{2}--{3}",
                                              eachContact.ContactUser.FirstName,
                                              eachContact.ContactUser.LastName,
                                              ex.Message,
                                              ex.StackTrace);
            #endif
                        }
                    }
                    break;

                case AccountOAuth.OAuthTypes.Google:
                case AccountOAuth.OAuthTypes.YouTube:
                    if (toContactsList.Count > 0)
                    {
                        List<LOLConnectInviteEmail> emailInvites = new List<LOLConnectInviteEmail>();
                        emailInvites =
                            toContactsList
                                .Select(s =>
                        {
                            return new LOLConnectInviteEmail()
                                    {
                                        ContactName = string.Format("{0} {1}", s.ContactUser.FirstName, s.ContactUser.LastName),
                                        EmailAddress = s.ContactUser.EmailAddress,
                                        OAuthType = this.networkType
                                    };
                        })
                                .ToList();

                        //RunOnUiThread(delegate { dialog.Progress = (int)(++count / toContactsList.Count); });
                        RunOnUiThread(() => Toast.MakeText(context, Application.Context.GetString(Resource.String.commonSendInvite), ToastLength.Short).Show());
                        LOLConnectClient service = new LOLConnectClient(LOLConstants.DefaultHttpBinding, LOLConstants.LOLConnectEndpoint);
                        service.ContactsSendInviteEmailCompleted += Service_ContactsSendInviteEmailCompleted;
                        service.ContactsSendInviteEmailAsync(emailInvites);
                    }//end if
                    break;

                case AccountOAuth.OAuthTypes.LinkedIn:
                    if (toContactsList.Count > 0)
                    {
                        try
                        {
                            LLinkedInManager lMan = (LLinkedInManager)this.Provider;
                            lMan.PostToFeed(
                                StringUtils.CreateLinkedInXMLMessage(Application.Context.GetString(Resource.String.inviteLinkedInPostMessage),
                                                                 LOLConstants.LinkLOLAppWebsiteUrl,
                                                                 AndroidData.CurrentUser, lMan.GetUserProfileUrl()), string.Empty);

                            RunOnUiThread(delegate
                            {
                                dialog.Progress = (int)(++count / toContactsList.Count);
                            });

                        } catch (Exception ex)
                        {
            #if(DEBUG)
                            System.Diagnostics.Debug.WriteLine("Exception creating LinkedIn activity: {0}--{1}",
                                              ex.Message,
                                              ex.StackTrace);
            #endif
                        }
                    }
                    break;
            }
            RunOnUiThread(delegate
            {
                if (dialog != null)
                    dialog.Dismiss();
            });
        }
Пример #55
0
 private void ShowLoading()
 {
     progress = new ProgressDialog(this);
     progress.Indeterminate = true;
     progress.SetProgressStyle(ProgressDialogStyle.Spinner);
     progress.SetMessage("Preparing Question Notifications. Please wait...");
     progress.SetCancelable(false);
     progress.Show();
 }
        protected override Dialog OnCreateDialog(int id)
        {
            switch (id) {
                case DIALOG_YES_NO_MESSAGE: {
                        var builder = new AlertDialog.Builder (this);
                        builder.SetIconAttribute (Android.Resource.Attribute.AlertDialogIcon);
                        builder.SetTitle (Resource.String.alert_dialog_two_buttons_title);
                        builder.SetPositiveButton (Resource.String.alert_dialog_ok, OkClicked);
                        builder.SetNegativeButton (Resource.String.alert_dialog_cancel, CancelClicked);

                        return builder.Create ();
                    }
                case DIALOG_YES_NO_OLD_SCHOOL_MESSAGE: {
                        var builder = new AlertDialog.Builder (this, Android.App.AlertDialog.ThemeTraditional);
                        builder.SetIconAttribute (Android.Resource.Attribute.AlertDialogIcon);
                        builder.SetTitle (Resource.String.alert_dialog_two_buttons_title);
                        builder.SetPositiveButton (Resource.String.alert_dialog_ok, OkClicked);
                        builder.SetNegativeButton (Resource.String.alert_dialog_cancel, CancelClicked);

                        return builder.Create ();
                    }
                case DIALOG_YES_NO_HOLO_LIGHT_MESSAGE: {
                        var builder = new AlertDialog.Builder (this, Android.App.AlertDialog.ThemeHoloLight);
                        builder.SetIconAttribute (Android.Resource.Attribute.AlertDialogIcon);
                        builder.SetTitle (Resource.String.alert_dialog_two_buttons_title);
                        builder.SetPositiveButton (Resource.String.alert_dialog_ok, OkClicked);
                        builder.SetNegativeButton (Resource.String.alert_dialog_cancel, CancelClicked);

                        return builder.Create ();
                    }
                case DIALOG_YES_NO_LONG_MESSAGE: {
                        var builder = new AlertDialog.Builder (this);
                        builder.SetIconAttribute (Android.Resource.Attribute.AlertDialogIcon);
                        builder.SetTitle (Resource.String.alert_dialog_two_buttons_msg);
                        builder.SetMessage (Resource.String.alert_dialog_two_buttons_msg);
                        builder.SetPositiveButton (Resource.String.alert_dialog_ok, OkClicked);
                        builder.SetNegativeButton (Resource.String.alert_dialog_cancel, CancelClicked);
                        builder.SetNeutralButton (Resource.String.alert_dialog_something, NeutralClicked);

                        return builder.Create ();
                    }
                case DIALOG_YES_NO_ULTRA_LONG_MESSAGE: {
                        var builder = new AlertDialog.Builder (this);
                        builder.SetIconAttribute (Android.Resource.Attribute.AlertDialogIcon);
                        builder.SetTitle (Resource.String.alert_dialog_two_buttons_msg);
                        builder.SetMessage (Resource.String.alert_dialog_two_buttons2ultra_msg);
                        builder.SetPositiveButton (Resource.String.alert_dialog_ok, OkClicked);
                        builder.SetNegativeButton (Resource.String.alert_dialog_cancel, CancelClicked);
                        builder.SetNeutralButton (Resource.String.alert_dialog_something, NeutralClicked);

                        return builder.Create ();
                    }
                case DIALOG_LIST: {
                        var builder = new AlertDialog.Builder (this);
                        builder.SetTitle (Resource.String.select_dialog);
                        builder.SetItems (Resource.Array.select_dialog_items, ListClicked);

                        return builder.Create ();
                    }
                case DIALOG_PROGRESS: {
                        progress_dialog = new ProgressDialog (this);
                        progress_dialog.SetIconAttribute (Android.Resource.Attribute.AlertDialogIcon);
                        progress_dialog.SetTitle (Resource.String.select_dialog);
                        progress_dialog.SetProgressStyle (ProgressDialogStyle.Horizontal);
                        progress_dialog.Max = MAX_PROGRESS;

                        progress_dialog.SetButton (Android.App.Dialog.InterfaceConsts.ButtonPositive, GetText (Resource.String.alert_dialog_ok), OkClicked);
                        progress_dialog.SetButton (Android.App.Dialog.InterfaceConsts.ButtonNegative, GetText (Resource.String.alert_dialog_cancel), CancelClicked);

                        return progress_dialog;
                    }
                case DIALOG_SINGLE_CHOICE: {
                        var builder = new AlertDialog.Builder (this);
                        builder.SetIconAttribute (Android.Resource.Attribute.AlertDialogIcon);
                        builder.SetTitle (Resource.String.alert_dialog_single_choice);
                        builder.SetSingleChoiceItems (Resource.Array.select_dialog_items2, 0, ListClicked);

                        builder.SetPositiveButton (Resource.String.alert_dialog_ok, OkClicked);
                        builder.SetNegativeButton (Resource.String.alert_dialog_cancel, CancelClicked);

                        return builder.Create ();
                    }
                case DIALOG_MULTIPLE_CHOICE: {
                        var builder = new AlertDialog.Builder (this);
                        builder.SetIcon (Resource.Drawable.ic_popup_reminder);
                        builder.SetTitle (Resource.String.alert_dialog_multi_choice);
                        builder.SetMultiChoiceItems (Resource.Array.select_dialog_items3, new bool[] { false, true, false, true, false, false, false }, MultiListClicked);

                        builder.SetPositiveButton (Resource.String.alert_dialog_ok, OkClicked);
                        builder.SetNegativeButton (Resource.String.alert_dialog_cancel, CancelClicked);

                        return builder.Create ();
                    }
                case DIALOG_MULTIPLE_CHOICE_CURSOR: {
                        var projection = new string[] { BaseColumns.Id, Contacts.PeopleColumns.DisplayName, Contacts.PeopleColumns.SendToVoicemail };
                        var cursor = ManagedQuery (ContactsContract.Contacts.ContentUri, projection, null, null, null);

                        var builder = new AlertDialog.Builder (this);
                        builder.SetIcon (Resource.Drawable.ic_popup_reminder);
                        builder.SetTitle (Resource.String.alert_dialog_multi_choice_cursor);
                        builder.SetMultiChoiceItems (cursor, Contacts.PeopleColumns.SendToVoicemail, Contacts.PeopleColumns.DisplayName, MultiListClicked);

                        return builder.Create ();
                    }
                case DIALOG_TEXT_ENTRY: {
                        // This example shows how to add a custom layout to an AlertDialog
                        var factory = LayoutInflater.From (this);
                        var text_entry_view = factory.Inflate (Resource.Layout.alert_dialog_text_entry, null);

                        var builder = new AlertDialog.Builder (this);
                        builder.SetIconAttribute (Android.Resource.Attribute.AlertDialogIcon);
                        builder.SetTitle (Resource.String.alert_dialog_text_entry);
                        builder.SetView (text_entry_view);
                        builder.SetPositiveButton (Resource.String.alert_dialog_ok, OkClicked);
                        builder.SetNegativeButton (Resource.String.alert_dialog_cancel, CancelClicked);

                        return builder.Create ();
                    }
            }
            return null;
        }
Пример #57
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            // Create your application here
            RequestWindowFeature (WindowFeatures.NoTitle);
            Window.AddFlags (WindowManagerFlags.KeepScreenOn);

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

            //
            dates = SyncQueueManager.GetAvailableDatesDesc ();

            spnDates = FindViewById<Spinner> (Resource.Id.sfSelectedDateSpinner);
            //			spnDates.Adapter = new ArrayAdapter (Activity, Android.Resource.Layout.SimpleSpinnerItem, SyncQueueManager.DatesToString(dates));
            ArrayAdapter adapter = new ArrayAdapter (this, Android.Resource.Layout.SimpleSpinnerItem, SyncQueueManager.DatesToString(dates));
            adapter.SetDropDownViewResource (Resource.Layout.Spinner);
            spnDates.Adapter = adapter;
            spnDates.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) => {
                //				TextView tv = (TextView) e.View;
                selectedDate = dates[e.Position];
                Toast.MakeText(this, selectedDate.ToString(@"d"), ToastLength.Short).Show();
                queue = (List<SyncQueue>) SyncQueueManager.GetSyncQueue(dates[e.Position]);

                RefreshContent();
            };

            llSyncItems = FindViewById<LinearLayout> (Resource.Id.sfList);
            ivSync = FindViewById<ImageView> (Resource.Id.sfSyncImage);

            ivSync.Click += (object sender, EventArgs e) => {
                //progressDialog = ProgressDialog.Show(this, "", "Загрузка информации на сервер", true);
                //progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
                //int i = 0;
            //				foreach (var item in queue) {
            //					if (!item.isSync) {
            //						File.Delete(item.fileLoacation);
            //						SyncQueueManager.DeleteSyncQueue(item);
            //						progressDialog.SetMessage(String.Format(@"Удалено id:{0}", item.id));
            //						i++;
            //					}
            //				}
                //SyncQueueManager.AddToQueue( new Attendance{
            //				progressDialog.SetMessage(String.Format(@"Удалено всего:{0}", i));
            //				Thread.Sleep(3000);
            //				progressDialog.Dismiss();
                progressDialog = ProgressDialog.Show(this, "", "Загрузка информации на сервер", true);
                progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
                new Thread(new ThreadStart(delegate
                    {
                        //LOAD METHOD TO GET ACCOUNT INFO
                        RunOnUiThread(() => progressDialog.SetMessage(@"Начало загрузки информации о посещениях"));

                        UpLoadAttendances();
                        UpLoadAttendanceResults();
                        UpLoadAttendanceGPSPoints();
                        UpLoadAttendancePhotos();
                        SyncQueueManager.SaveSyncQueueToDisk();

                        //HIDE PROGRESS DIALOG
                        RunOnUiThread(() => { progressDialog.SetMessage(@"Обновление данных"); RefreshContent(); progressDialog.Dismiss(); }); //progressBar.Visibility = ViewStates.Gone);
                    })).Start();
            };
        }
Пример #58
0
		/// <summary>
		/// Raises the activity result event.
		/// Connects to a new device from deviceListActivity
		/// </summary>
		/// <param name="requestCode">Request code.</param>
		/// <param name="resultCode">Result code.</param>
		/// <param name="data">Data.</param>
		protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
		{

			switch (requestCode) {
			case REQUEST_CONNECT_DEVICE:
				// When DeviceListActivity returns with a device to connect
				if (resultCode == Result.Ok) {
					// Get the device MAC address
					var address = data.Extras.GetString (DeviceListActivity.EXTRA_DEVICE_ADDRESS);
					// Get the BLuetoothDevice object
					BluetoothDevice device = bluetoothAdapter.GetRemoteDevice (address);
					// Attempt to connect to the device
					service.Connect (device);
				}
				break;
			case REQUEST_ENABLE_BT:
				// When the request to enable Bluetooth returns
				if (resultCode == Result.Ok) {
					// Bluetooth is now enabled, so set up service
					service = new BluetoothChatService (this, handle);
				} else {
				
					// User did not enable Bluetooth or an error occured
					Toast.MakeText (this, Resource.String.bt_not_enabled_leaving, ToastLength.Short).Show ();
					Finish ();
				}
				break;
			}

			dialogSpin = new ProgressDialog (this, 5);
			dialogSpin.SetProgressStyle(ProgressDialogStyle.Spinner);
			dialogSpin.SetMessage("Waiting for Other Devices");
			dialogSpin.Indeterminate = true;

			SetContentView (Resource.Layout.WaitView);

			dialogSpin.Show ();
		}
Пример #59
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			//Initialization
			// Get local Bluetooth adapter
			bluetoothAdapter = BluetoothAdapter.DefaultAdapter;
			DeviceName = bluetoothAdapter.Name;
			handle = new MyHandler (this);

			messagesViewAdapter = new ArrayAdapter<string>(this, Resource.Layout.message);

			// If the adapter is null, then Bluetooth is not supported
			if (bluetoothAdapter == null) {
				Toast.MakeText (this, "Bluetooth is not available", ToastLength.Long).Show ();
				Finish ();
				return;
			}

			BluetoothAdapter adapter = BluetoothAdapter.DefaultAdapter;

			#region Home Screen UI stuff

			//set the content view to the home scree ui
			SetContentView (Resource.Layout.Home);

			//button handler for the only button - Math and Science Extravaganze with friends
			var butt = FindViewById<Button> (Resource.Id.gameButton);
			butt.Click += (object sender, EventArgs e) => {

				//build a dialog to ask for a new game or an exsiting game
				AlertDialog.Builder builder = new AlertDialog.Builder(this, 5);
				builder.SetTitle("Start Game?");
				builder.SetMessage("Do you want to start a new game or connect to an exsiting one?");

				//if new game launch the new game view which will get the number of players and the name of the device
				builder.SetPositiveButton("New Game", (s, ev) => {

					SetContentView(Resource.Layout.TextInput);

					var number = FindViewById<EditText>(Resource.Id.numPlayers);

					var name = FindViewById<EditText>(Resource.Id.editText1);


					var button = FindViewById<Button>(Resource.Id.createButton);

					button.Click += (object sender1, EventArgs e1) => {

						Console.WriteLine(number.Text.ToString());
						Console.WriteLine(name.Text.ToString());

						adapter.SetName(name.Text.ToString());

						maxDevices = Integer.ParseInt(number.Text.ToString());

						//enable discoverability for ever
						EnsureDiscoverable();

						dialogSpin = new ProgressDialog(this, 5);
						dialogSpin.SetProgressStyle(ProgressDialogStyle.Spinner);
						dialogSpin.SetMessage("Waiting for Other Devices");
						dialogSpin.Indeterminate = true;

						SetContentView(Resource.Layout.WaitView);

						dialogSpin.Show();
					};

				});

				//if exsiting game then start the device finding dialog and initiate a connection
				builder.SetNegativeButton("Existing Game", (s, ev) => {

					activeReturn = true;

					Intent serverIntent = new Intent(this, typeof(DeviceListActivity));

					StartActivityForResult(serverIntent, REQUEST_CONNECT_DEVICE);
				});


				//show the dialog
				Dialog dialog = builder.Create();
				dialog.Show();
			};
			#endregion
				
		}
		public void SetDownloadDialog () {
			progressDialog = new ProgressDialog (this);
			progressDialog.SetProgressStyle (ProgressDialogStyle.Horizontal);
			progressDialog.Progress = 0;
			progressDialog.Max = 100;
			progressDialog.SetCancelable (false);
			downloadedOK = false;
		}