protected override async void OnResume() { base.OnResume(); await UpdateEventList(_eventListView); LoadingDialog.Hide(); }
protected override async void OnCreate(Bundle savedInstanceState) { Window.RequestFeature(WindowFeatures.NoTitle); Window.RequestFeature(WindowFeatures.ActionBar); SetContentView(Resource.Layout.EventDetailMainView); SetActionBar(FindViewById <Toolbar>(Resource.Id.EventDetail_Toolbar)); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetHomeButtonEnabled(true); FindViewById <ImageButton>(Resource.Id.EventDetail_CommentButton).Click += AddNewCommentClicked; FindViewById <ImageButton>(Resource.Id.EventDetail_RefreshButton).Click += RefreshComments; var commentTxt = FindViewById <EditText>(Resource.Id.EventDetail_CommentTxt); commentTxt.EditorAction += (sender, args) => { args.Handled = false; if (args.ActionId == ImeAction.Done) { AddNewComment(); args.Handled = true; } }; base.OnCreate(savedInstanceState); await LoadEvent(); LoadingDialog.Hide(); }
protected override void OnCreate(Bundle savedInstanceState) { Window.RequestFeature(WindowFeatures.NoTitle); Window.RequestFeature(WindowFeatures.ActionBar); SetContentView(Resource.Layout.MainActivityMainView); SetActionBar(FindViewById <Toolbar>(Resource.Id.Main_Toolbar)); FindViewById <Button>(Resource.Id.Main_GroupButton).Click += (sender, args) => { StartActivity(typeof(GroupActivity)); }; FindViewById <Button>(Resource.Id.Main_ChatButton).Click += (sender, args) => { StartActivity(typeof(ChatActivity)); }; FindViewById <Button>(Resource.Id.Main_MyEventsButton).Click += (sender, args) => { StartActivity(typeof(MyEvents)); }; FindViewById <Button>(Resource.Id.Main_PartEventsButton).Click += (sender, args) => { StartActivity(typeof(ParticipateEventsActivity)); }; base.OnCreate(savedInstanceState); ActionBar.Title = "Welcome Back !"; LoadingDialog.Hide(); }
//开启协成进行异步加载 IEnumerator OnLoad() { //init float progressValue = 0; float progressMaxValue = (preLoad == null) ? widgets.Length : widgets.Length + preLoad.Length; loadingDialog.UpdateSlide("数据加载中...", progressValue, progressMaxValue); yield return(new WaitForEndOfFrame()); //load widgets里面的数据 ResourceAsyncLoadingRequest <GameObject> request = null; foreach (var widget in widgets) { string title = "正在加载" + ResourceManager.GetFileName(widget); request = ResourceManager.AsyncLoadResourceUI(widget); do { loadingDialog.UpdateSlide(title, progressValue + request.progress + 1, progressMaxValue); yield return(new WaitForEndOfFrame()); } while (!request.isDone); progressValue++; } //load preload里面的数据 GameObjectManager manager = GameObjectManager.GetInstance(); if (preLoad != null) { foreach (var item in preLoad) { string title = "正在加载" + ResourceManager.GetFileName(item.name); loadingDialog.UpdateSlide(title, progressValue + 1, progressMaxValue); yield return(new WaitForEndOfFrame()); manager.StoreObject(item.getObject(), item.name); progressValue++; } } //加载完成 loadingDialog.UpdateSlide("加载完毕...", progressMaxValue, progressMaxValue); yield return(new WaitForEndOfFrame()); ShowWidget(); LoadingDialog.Hide(loadingDialog.gameObject); }
protected override async void OnCreate(Bundle savedInstanceState) { Window.RequestFeature(WindowFeatures.NoTitle); Window.RequestFeature(WindowFeatures.ActionBar); SetContentView(Resource.Layout.ChatMainView); SetActionBar(FindViewById <Toolbar>(Resource.Id.Chat_Toolbar)); ActionBar.Title = "Chat"; ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetHomeButtonEnabled(true); _chatMessagesListView = FindViewById <ListView>(Resource.Id.Chat_MessageList); FindViewById <ImageButton>(Resource.Id.Chat_SendButton).Click += SendMessageClicked; base.OnCreate(savedInstanceState); ReadMessages(); await StartChat(); _activityDestroyed = false; LoadingDialog.Hide(); }
public Task HideLoadingDialogAsync() { loadingDialog?.Hide(); return(Task.CompletedTask); }
/// <summary> /// Hides the previously opened Loading Dialog. /// </summary> public void HideLoadingDialog() { loadingDialog?.Hide(); }
private void OnHideLoadingDialog() { _loadingDialog.Hide(); }
public void EditEntry(int index, bool forceHex = false) { BundleEntry entry = GetEntry(index); if (EntryTypeRegistry.IsRegistered(entry.Type) && !forceHex) { IEntryData data = EntryTypeRegistry.GetHandler(entry.Type); TextureCache.ResetCache(); LoadingDialog loader = new LoadingDialog(); loader.Status = "Loading: " + entry.ID.ToString("X8"); Thread loadInstanceThread = null; bool failure = false; loader.Done += (cancelled, value) => { if (cancelled) { loadInstanceThread?.Abort(); } else { if (failure) { MessageBox.Show(this, "Failed to load Entry", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { loader.Hide(); IEntryEditor editor = data.GetEditor(entry); if (editor != null) { editor.ShowDialog(this); } else { DebugUtil.ShowDebug(this, data); } if (ForceOnlySpecificEntry) { Environment.Exit(0); } } } TextureCache.ResetCache(); }; loadInstanceThread = new Thread(() => { try { try { failure = !data.Read(entry, loader); } catch (ReadFailedError ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); failure = true; throw; } } catch (Exception) { MessageBox.Show("Failed to load Entry", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); failure = true; } loader.IsDone = true; }); loadInstanceThread.Start(); loader.ShowDialog(this); } else { EntryEditor editor = new EntryEditor(); editor.ForceHex = forceHex; Task.Run(() => openEditor(editor, index)); editor.ShowDialog(this); } }