当前位置: 首页>>代码示例>>C#>>正文


C# ProgressDialog.Hide方法代码示例

本文整理汇总了C#中Android.App.ProgressDialog.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressDialog.Hide方法的具体用法?C# ProgressDialog.Hide怎么用?C# ProgressDialog.Hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Android.App.ProgressDialog的用法示例。


在下文中一共展示了ProgressDialog.Hide方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConnectToRelay

		private async Task ConnectToRelay()
		{
			bool connected = false;

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

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

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

			Toast.MakeText(this, connected ? "Connected!" : "Unable to connect", ToastLength.Short).Show();
		}
开发者ID:JonathanTLH,项目名称:PanTiltZoomSystem,代码行数:27,代码来源:RemoteActivity.cs

示例2: ChangeStatusPopup

		public ChangeStatusPopup (Activity _activity) : base (_activity)
		{
			this._activity = _activity;
			progress = ProgressDialog.Show (_activity, "", "", true);
			progress.SetContentView(new ProgressBar(_activity));
			progress.Hide ();
			popupNotice = new PopupNoticeInfomation (_activity);
		}
开发者ID:borain89vn,项目名称:demo2,代码行数:8,代码来源:ChangeStatusPopup.cs

示例3: Show

		public void Show(Context context, string content)
		{
			var dialog = new ProgressDialog(context);
			dialog.SetMessage(content);
			dialog.SetCancelable(false);
			dialog.Show();
			System.Threading.Thread.Sleep (2000);
			dialog.Hide ();
		}
开发者ID:kamilkk,项目名称:MyVote,代码行数:9,代码来源:MessageBox.cs

示例4: OnCreate

		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			//RequestWindowFeature (WindowFeatures.NoTitle);
			progressDialogParent = ProgressDialog.Show (this, "", "", true);
			progressDialogParent.SetContentView(new ProgressBar(this));
			progressDialogParent.Hide ();
			LayoutInflater.Factory = new TextFactoryManager();
		}
开发者ID:borain89vn,项目名称:demo2,代码行数:9,代码来源:BaseActivity.cs

示例5: OnCreate

		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
			updateUIButton = FindViewById<Button> (Resource.Id.StartBackgroundTaskUpdateUI);

			updateUIButton.Click += delegate {

				// show the loading overlay on the UI thread
				progress = ProgressDialog.Show(this, "Loading", "Please Wait...", true); 

				// spin up a new thread to do some long running work using StartNew
				Task.Factory.StartNew (
					// tasks allow you to use the lambda syntax to pass work
					() => {
						Console.WriteLine ( "Hello from taskA." );
						LongRunningProcess(4);
					}
				// ContinueWith allows you to specify an action that runs after the previous thread
				// completes
				// 
				// By using TaskScheduler.FromCurrentSyncrhonizationContext, we can make sure that 
				// this task now runs on the original calling thread, in this case the UI thread
				// so that any UI updates are safe. in this example, we want to hide our overlay, 
				// but we don't want to update the UI from a background thread.
				).ContinueWith ( 
					t => {
		                if (progress != null)
		                    progress.Hide();
		                
						Console.WriteLine ( "Finished, hiding our loading overlay from the UI thread." );
					}, TaskScheduler.FromCurrentSynchronizationContext()
				);

				// Output a message from the original thread. note that this executes before
				// the background thread has finished.
				Console.WriteLine("Hello from the calling thread.");
			};


			// the simplest way to start background tasks is to use create a Task, assign
			// some work to it, and call start.
			noupdateUIButton = FindViewById<Button> (Resource.Id.StartBackgroundTaskNoUpdate);
			noupdateUIButton.Click += delegate {
				var TaskA = new Task ( () => { LongRunningProcess (5); } );
				var TaskB = new Task ( () => { LongRunningProcess (4); } );

				TaskA.Start ();
				TaskB.Start ();
			};
		}
开发者ID:ARMoir,项目名称:mobile-samples,代码行数:56,代码来源:MainScreen.cs

示例6: OnCreate

		protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.CrueltyTypes);

            _loadingDialog = DialogManager.ShowLoadingDialog(this, "Retrieving Cruelty Types");

            _crueltySpotCategoriesList = FindViewById<ListView>(Resource.Id.CrueltyTypes);
            _crueltySpotCategoriesList.ItemClick += (sender, e) =>
            {
                var crueltySpotCategory = _crueltySpotCategories[e.Position];
                //var intent = new Intent(this, typeof(ReportCrueltyFragment));
                var intent = new Intent(this, typeof(IntroActivity));
                intent.PutExtra("tab", "report");
                var crueltyType = new CrueltyType();
                crueltyType.Id = crueltySpotCategory.ObjectId;
                crueltyType.Name = crueltySpotCategory.Name;
				CrueltyReport _crueltyReport = ((AfaApplication)ApplicationContext).CrueltyReport; 
                _crueltyReport.CrueltyType = crueltyType;
               
                StartActivity(intent);
            };

            var crueltySpotCategoriesService = new CrueltySpotCategoriesService();

            var crueltySpotCategories = await crueltySpotCategoriesService.GetAllAsync();
            RunOnUiThread(() =>
                {
                    _crueltySpotCategories = crueltySpotCategories;
                    _crueltySpotCategoriesList.Adapter = new CrueltyTypesAdapter(this, _crueltySpotCategories);
                    _loadingDialog.Hide();
                });

			/*SetContentView (Resource.Layout.Test);
			var textView = FindViewById<TextView> (Resource.Id.textView1);
			var query = new ParseQuery<CrueltySpotCategory> ();
			var result = await query.FindAsync ();
			var output = "";
			foreach (var crueltySpotCategory in result) {
				output += "Name: " + crueltySpotCategory.Name;
				output += "\n";
				output += "Description: " + crueltySpotCategory.Description;
				output += "\n";
				output += "Icon: " + crueltySpotCategory.IconName;
				output += "\n";
			}

			RunOnUiThread (() => {
				textView.Text = output;
			});*/
            
        }
开发者ID:America4Animals,项目名称:AFA,代码行数:53,代码来源:CrueltyTypesActivity.cs

示例7: ShowProgressDialog

 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();
 }
开发者ID:HamzaTariq95,项目名称:HELPSProject,代码行数:13,代码来源:MainActivity.cs

示例8: onConnecToServer

        /// <summary>Handles connecting to the server and starting a game.</summary>
        void onConnecToServer()
        {
            EditText serverText = FindViewById<EditText>(Resource.Id.ServerText);
            EditText userText = FindViewById<EditText>(Resource.Id.UserText);
            EditText oppText = FindViewById<EditText> (Resource.Id.OpponentText);

            serverAddr= serverText.Text;
            uname = userText.Text;

            sockInstance = new SocketSingleton (serverAddr, 8080);
            SocketSingleton.initSingleton ();

            // On "Connect" button click, try to connect to a server.
            progress = ProgressDialog.Show(this, "Loading", "Please Wait...", true);

                if (progress != null)
                    progress.Hide();
                if(!sockInstance.isConnected()){
                    setError("Couldn't connect");
                }else{
                    setError("Connected");
                    Intent intent = new Intent(this,typeof(ChessActivity));
                    ChessActions.socket = sockInstance;
                    ChessActivity.username = userText.Text;
                    ChessActivity.opponent = oppText.Text;
                    ChessActivity.actions = new ChessActions (ChessActivity.username, ChessActivity.opponent);

                    ChessActivity.actions.login ();
                    string read = SocketSingleton.getInstance().getIn().ReadLine();
                    if (read == "TRUE"){
                        if (ChessActivity.actions.joinGame()) {
                            ChessActivity.myTurn = false;
                            ChessActivity.newGame = false;
                            StartActivity(intent);
                        } else {
                            if(ChessActivity.actions.newGame ()) {
                                ChessActivity.myTurn = true;
                                ChessActivity.newGame = true;
                                StartActivity(intent);
                            }
                            else
                                setError("Username already in use for a game.");
                        }
                    } else {
                        setError("Could not use username to login.");
                    }
                }
        }
开发者ID:dblanche54,项目名称:Android-Multiplayer-Chess,代码行数:49,代码来源:MainActivity.cs

示例9: BackgroundJob

        public BackgroundJob(MonitoredActivity activity, Action job,
		                     ProgressDialog progressDialog, Handler handler)
		{
			this.activity = activity;
			this.progressDialog = progressDialog;
			this.job = job;			
			this.handler = handler;

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

			activity.Stopping += (sender, e) =>progressDialog.Hide();
			activity.Starting += (sender, e) => progressDialog.Show();
		}
开发者ID:billy-lokal,项目名称:Dateifi_Old,代码行数:18,代码来源:BackgroundJob.cs

示例10: btnLoginOnClick

        public void btnLoginOnClick(Object sender, EventArgs e, String uname, String passwd)
        {
            //Wenn die Logik zugreift und Navision/Windows den Login genehmigt, gehe weiter zur ActOverview
            Activity.RunOnUiThread(() =>
            {
                progress = ProgressDialog.Show(Activity, "Processing...", "Trying to connect and logging into Server", true);
                service._Service.AuthenticationCompleted += delegate { progress.Hide(); };
            });
            try
            {
                if (service.proofUser(uname, passwd))
                {

                    //Übertrage erarbeitete Daten an die GUI
                    Activity.RunOnUiThread(() =>
                    {
                        user = uname;
                        pwd = passwd;
                        progress.Dismiss();
                    });
                }
                else
                {
                    Activity.RunOnUiThread(() =>
                    {
                        progress.Hide();
                        Toast.MakeText(Activity, "Invalid Credentials", ToastLength.Short).Show();
                    });
                }
            }
            catch (Exception err)
            {
                Activity.RunOnUiThread(() =>
                {
                    progress.Hide();
                    Toast.MakeText(Activity, err.Message, ToastLength.Short).Show();
                });
            }
        }
开发者ID:BitStab,项目名称:Monodroid-Custom-Auto-Complete,代码行数:39,代码来源:Dashboard.cs

示例11: btnLoginOnClick

        public void btnLoginOnClick(Object sender, EventArgs e, String uname, String pwd)
        {
            //Wenn die Logik zugreift und Navision/Windows den Login genehmigt, gehe weiter zur ActOverview
            RunOnUiThread(() => {
                progress = ProgressDialog.Show(this, "Processing...", "Trying to connect and logging into Server", true);
                service._Service.AuthenticationCompleted += delegate { progress.Hide(); };
            });
            try{
                if (service.proofUser(tfLogin.Text,tfPwd.Text)){

                    //Übertrage erarbeitete Daten an die GUI
                    RunOnUiThread(() =>
                    {
                        var overview = new Intent(this, typeof(Dashboard));
                        overview.PutExtra("username", this.tfLogin.Text);
                        overview.PutExtra("password", this.tfPwd.Text);

                        //Starte die neue Oberfläche
                        StartActivity(overview);
                        progress.Dismiss();
                    });
                }
                else{
                    RunOnUiThread(() =>
                    {
                        progress.Hide();
                        Toast.MakeText(this,"Invalid Credentials",ToastLength.Short).Show();
                    });
                }
            }
            catch(Exception err){
                RunOnUiThread(() =>
                {
                    progress.Hide();
                    Toast.MakeText(this, err.Message, ToastLength.Short).Show();
                });
            }
        }
开发者ID:BitStab,项目名称:Monodroid-Custom-Auto-Complete,代码行数:38,代码来源:ActLogin.cs

示例12: Initialize

    private async Task Initialize()
    {
      if (Initialized) return;
      Initialized = true;

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

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

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

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

      try
      {
        var customerEdit = await Library.CustomerEdit.GetCustomerEditAsync(1);
        InitializeBindings(customerEdit);
      }
      catch (Exception ex)
      {
        var alert = new AlertDialog.Builder(this);
        alert.SetMessage(string.Format(Resources.GetString(Resource.String.Error), ex.Message));
        alert.Show();
      }
      finally
      {
        dialog.Hide();
      }
    }
开发者ID:RodrigoGT,项目名称:csla,代码行数:38,代码来源:MainActivity.cs

示例13: OnCreate

        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.CrueltySpot);        

            //_loadingDialog = LoadingDialogManager.ShowLoadingDialog(this);
            _loadingDialog = DialogManager.ShowLoadingDialog(this, "Retrieving Cruelty Spot Details");

            // Event Handlers
            IssueButton.Click += (sender, args) => SetViewState(CrueltySpotViewState.TheIssue);
            TakeActionButton.Click += (sender, args) => SetViewState(CrueltySpotViewState.TakeAction);

            var crueltySpotId = Intent.GetStringExtra(AppConstants.CrueltySpotIdKey);
            var crueltySpotsService = new CrueltySpotsService();
            _crueltySpot = await crueltySpotsService.GetByIdAsync(crueltySpotId, true);
            RunOnUiThread(() =>
                {
                    var formattedAddress = String.Format("{0}\n{1}", _crueltySpot.Address, _crueltySpot.CityStateAndZip);
                    FindViewById<TextView>(Resource.Id.Name).Text = _crueltySpot.Name;
                    FindViewById<TextView>(Resource.Id.Address).Text = formattedAddress;
                    var resourceId = ResourceHelper.GetDrawableResourceId(this, _crueltySpot.CrueltySpotCategory.IconName, ResourceSize.Medium);
                    FindViewById<ImageView>(Resource.Id.CrueltyTypeImage).SetImageResource(resourceId);
                    SetViewState(CrueltySpotViewState.TakeAction);
                    _loadingDialog.Hide();

                    var showSuccessAddedAlert = Intent.GetBooleanExtra(AppConstants.ShowCrueltySpotAddedSuccessfullyKey, false);
                    if (showSuccessAddedAlert)
                    {
                        DialogManager.ShowAlertDialog(this, "Thanks!", "...for reporting animal cruelty here. This location is now on the map so others can take action!", true);
                    }

                    FindViewById<TextView>(Resource.Id.issueName).Text = _crueltySpot.CrueltySpotCategory.Name;
                    FindViewById<TextView>(Resource.Id.issueDescription).Text = _crueltySpot.CrueltySpotCategory.Description;
                });
        }
开发者ID:America4Animals,项目名称:AFA,代码行数:36,代码来源:CrueltySpotActivity.cs

示例14: LoadWikiInfo

        /// <summary>
        /// Pulls today's featured wikipedia article
        /// </summary>
        private async void LoadWikiInfo()
        {
            ProgressDialog dialog = new ProgressDialog(this);
            dialog.SetTitle("Please Wait...");
            dialog.SetMessage("Downloading today's content!");
            dialog.SetCancelable(false);
            dialog.Show();

            wiki = await AndroidUtils.GetTodaysWiki(this);

            if (wikiImage != null && wiki.imageURL != null)
            {
                if (!File.Exists(wiki.imageURL))
                {
                    // Force update, file has been deleted somehow
                    wiki = await ServerData.FetchWikiData(AndroidUtils.DecodeHTML);
                }
                wikiImage.SetImageURI(Android.Net.Uri.FromFile(new Java.IO.File(wiki.imageURL)));
                wikiImage.Visibility = ViewStates.Visible;
            }
            else if(wikiImage != null)
            {
                wikiImage.Visibility = ViewStates.Gone;
            }


            string[] sentences = wiki.content.Split(new[] {". "}, StringSplitOptions.RemoveEmptyEntries);

            string finalText = "";
            int charTarget = 400;

            foreach (string sentence in sentences)
            {
                if (finalText.Length < charTarget && finalText.Length + sentence.Length < 570)
                {
                    finalText += sentence + ". ";
                }
                else
                {
                    break;
                }
            }

            wikiText.Text = finalText;

            // If it's longer than expected, reduce the text size!
            if (finalText.Length > 520)
            {
                if ((Resources.Configuration.ScreenLayout & Android.Content.Res.ScreenLayout.SizeMask) <=
                    Android.Content.Res.ScreenLayout.SizeNormal)
                {
                    wikiText.SetTextSize(Android.Util.ComplexUnitType.Sp, 15);
                }
                else
                {
                    wikiText.SetTextSize(Android.Util.ComplexUnitType.Sp, 19);
                }
            }


            SwitchMode(ServerData.TaskType.Loudness);

            dialog.Hide();
        }
开发者ID:GSDan,项目名称:Speeching_Client,代码行数:67,代码来源:WikiPracticeActivity.cs

示例15: FetchBookingData

        private async void FetchBookingData()
        {
            progressDialog = new ProgressDialog(this);

            await FetchWorkshopBookingData();
            await FetchSessionBookingData();

            progressDialog.Hide();

            // Set up the views
            _Landing = new LandingFragment(sessionBookingData, workshopBookingData, studentData);
            _Future = new FutureBookingsFragment(sessionBookingData, workshopBookingData, studentData);
            _Past = new PastBookingsFragment(sessionBookingData, workshopBookingData, studentData);

            // Set up the landing page
            SetView(Resource.Id.fragmentContainer, _Landing, false);

            string helloUser = GetString(Resource.String.hello) + " " + studentData.attributes.studentID + "!";
            TextView helloUserText = FindViewById<TextView>(Resource.Id.textHelloUser);

            helloUserText.Text = helloUser;
        }
开发者ID:HamzaTariq95,项目名称:HELPSProject,代码行数:22,代码来源:MainActivity.cs


注:本文中的Android.App.ProgressDialog.Hide方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。