public ProgressDialogHelper(Context context) { this.progress = new ProgressDialog(context); progress.SetProgressStyle(ProgressDialogStyle.Spinner); progress.Indeterminate = false; progress.Progress = 99; progress.SetCanceledOnTouchOutside(false); }
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; }
private void FindClosestStation () { if (stations != null) { Activity.RunOnUiThread (() => { TaskScheduler scheduler = TaskScheduler.FromCurrentSynchronizationContext (); progressDialog = new ProgressDialog(Activity); progressDialog.SetMessage("Buscando estación cercana..."); progressDialog.Show(); closestStationButton.Enabled = false; progressDialog.SetCanceledOnTouchOutside(false); progressDialog.SetCancelable(false); StationGeolocationUtil.CurrentClosestStation (stations, this, scheduler, new Geolocator(Activity)); }); } }
public void buscaryabrir(string termino) { RunOnUiThread(() => { #pragma warning disable CS0618 // El tipo o el miembro est�n obsoletos alerta = new ProgressDialog(this); #pragma warning restore CS0618 // El tipo o el miembro est�n obsoletos #pragma warning restore CS0618 // El tipo o el miembro est�n obsoletos alerta.SetCanceledOnTouchOutside(false); alerta.SetCancelable(false); alerta.SetTitle("Buscando resultados..."); alerta.SetMessage("Por favor espere"); alerta.Show(); }); try { // RunOnUiThread(() => progreso.Progress = 50); VideoSearch src = new VideoSearch(); var results = src.SearchQuery(termino, 1); if (results.Count > 0) { var listatitulos = results.Select(ax => WebUtility.HtmlDecode(RemoveIllegalPathCharacters(ax.Title.Replace(""", "").Replace("&", "")))).ToList(); var listalinks = results.Select(ax => ax.Url).ToList(); RunOnUiThread(() => { ListView lista = new ListView(this); lista.ItemClick += (o, e) => { var posicion = 0; posicion = e.Position; Intent intentoo = new Intent(this, typeof(customdialogact)); intentoo.PutExtra("index", posicion.ToString()); intentoo.PutExtra("color", "DarkGray"); intentoo.PutExtra("titulo", listatitulos[posicion]); if (!isserver) { intentoo.PutExtra("ipadress", Mainmenu.gettearinstancia().ip); } else { intentoo.PutExtra("ipadress", "localhost"); } intentoo.PutExtra("url", listalinks[posicion]); intentoo.PutExtra("imagen", @"https://i.ytimg.com/vi/" + listalinks[posicion].Split('=')[1] + "/mqdefault.jpg"); StartActivity(intentoo); }; adapterlistaremoto adapt = new adapterlistaremoto(this, listatitulos, listalinks); lista.Adapter = adapt; new Android.App.AlertDialog.Builder(this) .SetTitle("Resultados de la busqueda") .SetView(lista).SetPositiveButton("Cerrar", (dd, fgf) => { }) .Create() .Show(); }); } RunOnUiThread(() => { alerta.Dismiss(); }); } catch (Exception) { RunOnUiThread(() => Toast.MakeText(this, "No se encotraron resultados", ToastLength.Long).Show()); alerta.Dismiss(); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _flurryClient = new FlurryClient(); _context = this; _loginError = new TextView(this); SetContentView(Resource.Layout.loginweblayout); _endlogin = new TextView(this); //_messageDialogBuilder = new AlertDialog.Builder(this); _loginWebView = FindViewById<WebView>(Resource.Id.loginWebView); _loginWebView.Settings.SavePassword = false; //_loginWebView.Settings.JavaScriptEnabled = true; _loginWebView.Settings.PluginsEnabled = true; _loginWebView.Settings.JavaScriptCanOpenWindowsAutomatically = true; _loginWebView.SaveEnabled = false; _loginWebView.SetWebViewClient(new ItsbetaLoginWebViewClient(this)); _loginWebView.SetWebChromeClient(new ItsbetaLoginWebViewChromeClient()); // "https://www.facebook.com/dialog/oauth?response_type=token&display=popup&client_id={0}&redirect_uri={1}&scope={2}", _loginWebView.LoadUrl(String.Format( "https://m.facebook.com/dialog/oauth/?response_type=token&" + "client_id={0}"+ "&redirect_uri={1}" + "&scope={2}", //"https://www.facebook.com/dialog/oauth/?response_type=token&display=popup&client_id={0}&redirect_uri={1}&scope={2}", AppInfo._fbAppId, AppInfo._loginRedirectUri, AppInfo._fbScope)); RelativeLayout progressDialogRelativeLayout = new RelativeLayout(this); LayoutInflater progressDialoglayoutInflater = (LayoutInflater)BaseContext.GetSystemService(LayoutInflaterService); View progressDialogView = progressDialoglayoutInflater.Inflate(Resource.Layout.progressdialoglayout, null); _progressDialogMessage = (TextView)progressDialogView.FindViewById(Resource.Id.progressDialogMessageTextView); progressDialogRelativeLayout.AddView(progressDialogView); _progressDialog = new ProgressDialog(this, Resource.Style.FullHeightDialog); _progressDialog.Show(); _progressDialog.SetContentView(progressDialogRelativeLayout); _progressDialog.Dismiss(); _progressDialog.Show(); _progressDialog.SetCanceledOnTouchOutside(false); ///// RelativeLayout errorDialogRelativeLayout = new RelativeLayout(this); LayoutInflater errorDialoglayoutInflater = (LayoutInflater)BaseContext.GetSystemService(LayoutInflaterService); View errorDialogView = errorDialoglayoutInflater.Inflate(Resource.Layout.wrongcodedialoglayout, null); _errorDialogReadyButton = (Button)errorDialogView.FindViewById(Resource.Id.readyButton); _errorDialogTitle = (TextView)errorDialogView.FindViewById(Resource.Id.textView1); _errorDialogMessage = (TextView)errorDialogView.FindViewById(Resource.Id.textView2); errorDialogRelativeLayout.AddView(errorDialogView); _errorDialog = new Dialog(this, Resource.Style.FullHeightDialog); _errorDialog.SetTitle(""); _errorDialog.SetContentView(errorDialogRelativeLayout); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// _endlogin.TextChanged += delegate //здесь инициализировать все необходимое перед запуском... { Finish(); StartActivity(typeof(FirstBadgeActivity)); }; _loginError.TextChanged += delegate { Finish(); StartActivity(typeof(LoginActivity)); }; }
public ProgressDialog DownloadingProgressDialog(string title, string message) { ProgressDialog progress = new ProgressDialog(context); progress.SetMessage(message); progress.SetTitle(title); progress.SetIcon(Resource.Drawable.Icon); progress.SetButton("Cancel", (sender, args) => { // Close progress dialog progress.Dismiss(); // Stop all downloads client.CancelAsync(); // Remove any language folders that were to be downloaded for (var i = 0; i < downloadQueue.Count; i++) { DeleteLanguagePack(downloadQueue[i]); } // No downloads to be downloaded downloadQueue = new List<string>(); // No files to be download FilesCoutner = 0; // They didn't all download, but set to true anyways allDownloaded = true; if (DownloadedLanguages.Count > 0) { Language = Language; } }); progress.SetProgressStyle(ProgressDialogStyle.Horizontal); progress.SetCancelable(false); progress.SetCanceledOnTouchOutside(false); return progress; }
private ProgressDialog CreateProgressDialog(string message, string title = null, bool indeterminate = true) { ProgressDialog progressDialog = new ProgressDialog(this) {Indeterminate = indeterminate}; if (indeterminate) { progressDialog.SetProgressPercentFormat(new EmptyNumberFormat()); } progressDialog.SetProgressNumberFormat(""); progressDialog.SetCancelable(false); progressDialog.SetCanceledOnTouchOutside(false); progressDialog.SetTitle(title); progressDialog.SetMessage(message); progressDialog.SetProgressStyle(ProgressDialogStyle.Horizontal); return progressDialog; }