本文整理汇总了C#中Android.App.ProgressDialog类的典型用法代码示例。如果您正苦于以下问题:C# ProgressDialog类的具体用法?C# ProgressDialog怎么用?C# ProgressDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgressDialog类属于Android.App命名空间,在下文中一共展示了ProgressDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Busy
public void Busy()
{
this.busyDlg = new ProgressDialog (this);
this.busyDlg.SetMessage (Resources.GetString (Resource.String.busy_msg));
this.busyDlg.SetCancelable (false);
this.busyDlg.Show ();
}
示例2: OnResume
protected override void OnResume ()
{
base.OnResume ();
Log.Debug (logTag, "ActivityBase.OnCreate.");
if (!App.Current.IsInitialized){
Log.Debug(logTag, "ActivityBase.App is NOT initialized");
// show the loading overlay on the UI thread
progress = ProgressDialog.Show(this, "Loading", "Please Wait...", true);
// when the app has initialized, hide the progress bar and call Finished Initialzing
initializedEventHandler = (s, e) => {
// call finished initializing so that any derived activities have a chance to do work
RunOnUiThread( () => {
this.FinishedInitializing();
// hide the progress bar
if (progress != null)
progress.Dismiss();
});
};
App.Current.Initialized += initializedEventHandler;
} else {
Log.Debug(logTag, "ActivityBase.App is initialized");
}
}
示例3: ProgressDialogHelper
public ProgressDialogHelper(Context context) {
this.progress = new ProgressDialog(context);
progress.SetProgressStyle(ProgressDialogStyle.Spinner);
progress.Indeterminate = false;
progress.Progress = 99;
progress.SetCanceledOnTouchOutside(false);
}
示例4: ShowStatus
public static ProgressDialog ShowStatus(Context cxt, string msg)
{
ProgressDialog status = new ProgressDialog(cxt);
status.SetMessage(msg);
status.Show();
return status;
}
示例5: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
_contentView = inflater.Inflate(Resource.Layout.device_detail, null);
_contentView.FindViewById<Button>(Resource.Id.btn_connect).Click += (sender, args) =>
{
var config = new WifiP2pConfig
{
DeviceAddress = _device.DeviceAddress,
Wps =
{
Setup = WpsInfo.Pbc
}
};
if (_progressDialog != null && _progressDialog.IsShowing)
_progressDialog.Dismiss();
_progressDialog = ProgressDialog.Show(Activity, "Press back to cancel",
"Connecting to: " + _device.DeviceAddress, true, true);
((IDeviceActionListener)Activity).Connect(config);
};
_contentView.FindViewById<Button>(Resource.Id.btn_disconnect).Click += (sender, args) =>
((IDeviceActionListener)Activity).Disconnect();
_contentView.FindViewById<Button>(Resource.Id.btn_start_client).Click += (sender, args) =>
{
var intent = new Intent(Intent.ActionGetContent);
intent.SetType("image/*");
StartActivityForResult(intent, ChooseFileResultCode);
};
return _contentView;
}
示例6: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
Button start = FindViewById<Button>(Resource.Id.startButton);
Button stop = FindViewById<Button>(Resource.Id.stopButton);
ProgressDialog pd = new ProgressDialog(this)
{
Indeterminate = true,
};
pd.SetMessage("Waiting");
pd.SetButton("cancel", (s, e) => Stop(pd));
pd.SetIcon(Resource.Drawable.Icon);
//pd.SetCancelable(false);
Drawable myIcon = Resources.GetDrawable(Resource.Animation.progress_dialog_icon_drawable_animation);
pd.SetIndeterminateDrawable(myIcon);
start.Click += delegate { Start(pd); };
stop.Click += delegate { Stop(pd); };
}
示例7: OnResume
protected async override void OnResume ()
{
try
{
base.OnResume ();
ProgressDialogLogin = ProgressDialog.Show(this, "", "Loading...");
await GetWorkshops();
if (ProgressDialogLogin != null)
{
ProgressDialogLogin.Dismiss();
ProgressDialogLogin = null;
}
}
catch (Exception e)
{
ErrorHandling.LogError (e, this);
}
finally
{
if (ProgressDialogLogin != null)
{
ProgressDialogLogin.Dismiss();
ProgressDialogLogin = null;
}
}
}
示例8: CloseProgressDialog
public static void CloseProgressDialog(Activity context) {
if (!context.IsFinishing && _mProgressDialog != null)
{
_mProgressDialog.Dismiss();
}
_mProgressDialog = null;
}
示例9: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
{
// Console.WriteLine("[{0}] OnCreateView Called: {1}", TAG, DateTime.Now.ToLongTimeString());
View v = inflater.Inflate(Resource.Layout.fragment_photo, container, false);
mImageView = v.FindViewById<ImageView>(Resource.Id.photoView);
photoUrl = Activity.Intent.GetStringExtra(PhotoGalleryFragment.PHOTO_URL_EXTRA);
photoUrl = photoUrl.Substring(0, photoUrl.Length-6) + ".jpg";
photoFilename = new FlickrFetchr().GetFilenameFromUrl(photoUrl);
ProgressDialog pg = new ProgressDialog(Activity);
pg.SetMessage(Resources.GetString(Resource.String.loading_photo_message));
pg.SetTitle(Resources.GetString(Resource.String.loading_photo_title));
pg.SetCancelable(false);
pg.Show();
Task.Run(async () => {
Bitmap image = await new FlickrFetchr().GetImageBitmapAsync(photoUrl, 0, new CancellationTokenSource().Token, photoFilename).ConfigureAwait(false);
Activity.RunOnUiThread(() => {
mImageView.SetImageBitmap(image);
//Console.WriteLine("[{0}] File created: {1}", TAG, photoUrl);
pg.Dismiss();
});
});
return v;
}
示例10: OnViewModelSet
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;
}
}
}
};
}
}
示例11: SaveButton_Click
private async void SaveButton_Click(object sender, EventArgs ea)
{
var dialog = new ProgressDialog(this);
dialog.SetMessage(Resources.GetString(Resource.String.Saving));
dialog.SetCancelable(false);
dialog.Show();
try
{
Bindings.UpdateSourceForLastView();
this.Model.ApplyEdit();
var returnModel = await this.Model.SaveAsync();
InitializeBindings(returnModel);
}
catch (Exception ex)
{
var alert = new AlertDialog.Builder(this);
alert.SetMessage(string.Format(Resources.GetString(Resource.String.Error), ex.Message));
alert.Show();
}
finally
{
dialog.Hide();
}
}
示例12: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate (bundle);
var groupName = Intent.GetStringExtra("name");
Title = groupName;
GroupName = groupName;
_contactRepo = new ContactRepository(this);
_progressDialog = new ProgressDialog(this);
_progressDialog.SetMessage("Loading Contacts. Please wait...");
_progressDialog.Show();
Task.Factory
.StartNew(() =>
_contactRepo.GetAllMobile())
.ContinueWith(task =>
RunOnUiThread(() =>
{
if (task.Result != null)
DisplayContacts(task.Result);
_progressDialog.Dismiss ();
}));
}
示例13: 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();
}
示例14: fnGetProfileInfoFromGoogle
async Task<bool> fnGetProfileInfoFromGoogle()
{
progress = ProgressDialog.Show (this,"","Please wait...");
bool isValid=false;
//Google API REST request
string userInfo = await fnDownloadString (string.Format(googUesrInfoAccessleUrl, access_token ));
if ( userInfo != "Exception" )
{
googleInfo = JsonConvert.DeserializeObject<GoogleInfo> ( userInfo );
isValid = true;
}
else
{
if ( progress != null )
{
progress.Dismiss ();
progress = null;
}
isValid = false;
Toast.MakeText ( this , "Connection failed! Please try again" , ToastLength.Short ).Show ();
}
if ( progress != null )
{
progress.Dismiss ();
progress = null;
}
return isValid;
}
示例15: OnCreate
protected async override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// shows a spinner while it gets polls from database
var progressDialog = new ProgressDialog(this);
progressDialog.Show();
{
try
{
// gets all the polls from the database
polls = await VotingService.MobileService.GetTable<Poll>().ToListAsync();
}
catch (Exception exc)
{
// error dialog that shows if something goes wrong
var errorDialog = new AlertDialog.Builder(this).SetTitle("Oops!").SetMessage("Something went wrong " + exc.ToString()).SetPositiveButton("Okay", (sender1, e1) =>
{
}).Create();
errorDialog.Show();
}
};
// ends spinner on completion
progressDialog.Dismiss();
// created table for polls
ListAdapter = new ArrayAdapter<Poll>(this, Android.Resource.Layout.SimpleListItem1, polls);
}