public static void TextViewDialog(Context context, string path, string text = null) { var textView = new TextView(context); textView.SetPadding(10, 10, 10, 10); textView.SetTextSize(ComplexUnitType.Sp, 10f); var scrollView = new ScrollView(context); scrollView.AddView(textView); AlertDialog.Builder dialog = new AlertDialog.Builder(context); dialog.SetView(scrollView); if (text == null) { try { using (StreamReader sr = new StreamReader(path, Encoding.GetEncoding("euc-kr"))) { textView.Text = sr.ReadToEnd(); sr.Close(); } } catch { } } else { textView.Text = text; } dialog.SetPositiveButton("닫기", delegate { }); dialog.Show(); }
private void MaxDownloadClick(object sender, Preference.PreferenceClickEventArgs e) { View pickerView = LayoutInflater.Inflate(Resource.Layout.NumberPicker, null); AlertDialog.Builder builder = new AlertDialog.Builder(Activity, MainActivity.dialogTheme); builder.SetTitle(Resources.GetString(Resource.String.max_download_dialog)); builder.SetView(pickerView); NumberPicker picker = (NumberPicker)pickerView; picker.MinValue = 1; picker.MaxValue = 10; picker.Value = int.Parse(FindPreference("maxDownload").Summary); builder.SetPositiveButton(Resources.GetString(Resource.String.apply), (s, eventArg) => { ISharedPreferences pref = PreferenceManager.GetDefaultSharedPreferences(Application.Context); ISharedPreferencesEditor editor = pref.Edit(); editor.PutInt("maxDownload", picker.Value); editor.Apply(); Preference prefButton = FindPreference("maxDownload"); prefButton.Summary = pref.GetInt("maxDownload", 2).ToString(); if (Downloader.instance != null && Downloader.queue.Count > 0) { Downloader.instance.maxDownload = pref.GetInt("maxDownload", 4); } }); builder.SetNegativeButton(Resources.GetString(Resource.String.cancel), (s, eventArg) => { }); builder.Show(); }
void OnActionSheetRequested(Page sender, ActionSheetArguments arguments) { var builder = new AlertDialog.Builder(this); builder.SetTitle(arguments.Title); string[] items = arguments.Buttons.ToArray(); builder.SetItems(items, (o, args) => arguments.Result.TrySetResult(items[args.Which])); if (arguments.Cancel != null) { builder.SetPositiveButton(arguments.Cancel, (o, args) => arguments.Result.TrySetResult(arguments.Cancel)); } if (arguments.Destruction != null) { builder.SetNegativeButton(arguments.Destruction, (o, args) => arguments.Result.TrySetResult(arguments.Destruction)); } AlertDialog dialog = builder.Create(); builder.Dispose(); //to match current functionality of renderer we set cancelable on outside //and return null dialog.SetCanceledOnTouchOutside(true); dialog.CancelEvent += (o, e) => arguments.SetResult(null); dialog.Show(); }
private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Do you want to delete this payment?"); alert.SetPositiveButton("Yes", (senderAlert, args) => { friendsToPayment.Remove(friendsToPayment[e.Position]); var adapterPayemnt = new PaymentAddAdapter(this, friendsToPayment); listView.Adapter = adapterPayemnt; try { editText.Text = friendsToPayment.Where(s => s.Item2 > 0).Sum(s => s.Item2).ToString(); } catch (Exception) { Toast.MakeText(this, "Sum to big!", ToastLength.Short).Show(); } //apter = new FriendsCustomAdapter(this, users); //tData = FindViewById<ListView>(Resource.Id.listViewFriends); //tData.Adapter = adapter; }); alert.SetNegativeButton("No", (senderAlert, args) => { }); //run the alert in UI thread to display in the screen RunOnUiThread(() => { alert.Show(); }); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.play); //彈出視窗解說: AlertDialog.Builder alert_play = new AlertDialog.Builder(this); // For initial tips dialog if (counter == 0) { alert_play.SetTitle("注意事項"); alert_play.SetMessage("1. 請確認影片畫質是否正常且人臉完全包覆於合理範圍中,若不符合請\u201C返回操作\u201C重新測謊.\n" + "2. 確認無誤後,即可\u201C上傳檔案\u201C進行測謊分析.\n" + "3. 點選\u201C查看結果\u201C觀看測謊結果!!!"); alert_play.SetIcon(Android.Resource.Drawable.IcDialogInfo); alert_play.SetPositiveButton(" ok", new EventHandler <DialogClickEventArgs>((sender, e) => { })); alert_play.Show(); counter++; } // 跑馬燈 TextView play_tv = FindViewById <TextView>(Resource.Id.playtextview); play_tv.Selected = true; FindViewById <Button>(Resource.Id.btn_back).Click += Back_Click; //FindViewById<Button>(Resource.Id.btn_upload).Click += Back_Upload; FindViewById <Button>(Resource.Id.btn_play).Click += Back_Play; FindViewById <Button>(Resource.Id.btn_result).Click += Back_Result; }
private void ShowRetryDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.SetCancelable(false); builder.SetTitle("메시지 분류에 실패했습니다."); builder.SetMessage("다시 시도하시겠습니까?"); builder.SetPositiveButton("예", (senderAlert, args) => { Categorize(); }); builder.SetNegativeButton("아니오", (senderAlert, args) => { AlertDialog.Builder builder2 = new AlertDialog.Builder(this); builder2.SetTitle("메시지를 나중에 분류할 수 있습니다."); builder2.SetMessage("메시지 분류를 미루시겠습니까?"); builder2.SetPositiveButton("예", (senderAlert2, args2) => { MoveToNextScreen(); }); builder2.SetNegativeButton("아니오", (senderAlert2, args2) => { RunOnUiThread(() => { _NextBtn.Clickable = true; }); //버튼 누를 수 있게 풀어줘야 됨. }); RunOnUiThread(() => { Dialog dialog2 = builder2.Create(); dialog2.Show(); }); }); RunOnUiThread(() => { Dialog dialog = builder.Create(); dialog.Show(); }); }
//--------------------------------------------------------------------- // 개인정보취급방침 다이얼로그 private AlertDialog.Builder CreatePrivacyDialog() { string privacyPolicyStr; AssetManager assets = this.Assets; using (StreamReader sr = new StreamReader(assets.Open("PrivacyPolicy.txt"))) { privacyPolicyStr = sr.ReadToEnd(); } AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.SetCancelable(false); builder.SetTitle("개인정보취급방침에 동의하시겠습니까?"); builder.SetMessage(privacyPolicyStr); builder.SetPositiveButton("예", (senderAlert, args) => { MoveToNextScreen(); }); builder.SetNegativeButton("아니오", (senderAlert, args) => { RunOnUiThread(() => { Toast.MakeText(this, "개인정보취급방침에 동의해주셔야 레뜨레를 사용하실 수 있습니다.", ToastLength.Short).Show(); _NextBtn.Clickable = true; //버튼 누를 수 있게 풀어줘야 됨. }); }); return(builder); }
public override bool OnOptionsItemSelected(IMenuItem item) { int id = item.ItemId; switch (id) { case Resource.Id.action_exit: timer.Stop(); AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Confirm EXIT"); alert.SetMessage("Do you want to Exit?"); alert.SetPositiveButton("Yes", (senderAlert, args) => { StartActivity(new Intent(Application.Context, typeof(ScoreviewActivity))); Finish(); }); alert.SetNegativeButton("Cancel", (senderAlert, args) => { timer.Start(); }); Dialog dialog = alert.Create(); dialog.Show(); break; default: break; } return(base.OnOptionsItemSelected(item)); }
void schedule_ScheduleCellTapped(object sender, CellTappedEventArgs args) { var appointment = args.ScheduleAppointment; if (appointment != null) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Confirm delete"); alert.SetMessage(appointment.Subject); alert.SetPositiveButton("Delete", async(senderAlert, arg) => { await apiClient.DeleteWorkplaceOrderAsync((int)appointment.RecurrenceId); Toast.MakeText(this, "Deleted!", ToastLength.Short).Show(); Orders.Remove(appointment); schedule.ItemsSource = Orders; SetContentView(schedule); }); alert.SetNegativeButton("Cancel", (senderAlert, arg) => { Toast.MakeText(this, "Cancelled!", ToastLength.Short).Show(); }); Dialog dialog = alert.Create(); dialog.Show(); } }
/// <summary> /// Shows an alert dialog with two buttons. /// </summary> /// <param name="title"></param> /// <param name="message"></param> /// <param name="okButtonText"></param> /// <param name="cancelButtonText"></param> /// <param name="okCallback"></param> /// <param name="cancelCallback"></param> public void ShowPopup(string title, string message, string okButtonText, string cancelButtonText, Action okCallback, Action cancelCallback, bool dismissable = false, Action dismissCallback = null) { var top = Mvx.Resolve <IMvxAndroidCurrentTopActivity>(); if (top == null) { // may occur if in middle of transition return; } AlertDialog.Builder builder = new AlertDialog.Builder(top.Activity); builder.SetMessage(message); builder.SetTitle(title); builder.SetNegativeButton(cancelButtonText, (o, args) => { cancelCallback?.Invoke(); }); builder.SetPositiveButton(okButtonText, (o, args) => { okCallback?.Invoke(); }); builder.SetCancelable(dismissable); var dialog = builder.Create(); // set the dismiss callback, note that this is not the same as tapping cancel dialog.CancelEvent += (sender, args) => dismissCallback?.Invoke(); top.Activity.RunOnUiThread(() => { dialog.Show(); }); }
protected override void OnStart() { base.OnStart(); active = true; var connectivityManager = (ConnectivityManager)GetSystemService(ConnectivityService); var activeConnection = connectivityManager.ActiveNetworkInfo; if ((activeConnection == null) || !activeConnection.IsConnected) { // brak połączenia z siecią AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Błąd:"); alert.SetMessage("Brak połączenia z internetem!"); alert.SetPositiveButton("Ok", (senderAlert, args) => { // }); alert.Create().Show(); } else { if (viewSwitcher.CurrentView != progressLayout) { viewSwitcher.ShowNext(); } GetData(); } }
public override void OnBackPressed() { if (_isEdited) { var alert = new AlertDialog.Builder(this); alert.SetTitle("Avertisment"); alert.SetMessage("Esti pe cale sa renunti la modificarile facute. Renuntati?"); alert.SetPositiveButton("Da", (senderAlert, args) => { base.OnBackPressed(); }); alert.SetNegativeButton("Nu", (senderAlert, args) => { }); Dialog dialog = alert.Create(); dialog.Show(); } else { //base.OnBackPressed(); var intent = new Intent(this, typeof(MedicineBaseActivity)); intent.AddFlags(ActivityFlags.ClearTop); intent.PutExtra("FromMedicine", true); StartActivity(intent); } }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Android.Resource.Id.Home: startBack(); return(true); case Resource.Id.action_invisible: //Menu de contexto confirmacao AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle(GetString(Resource.String.confirmTitle)); alert.SetMessage(GetString(Resource.String.confirmMSG)); alert.SetPositiveButton(GetString(Resource.String.confirmOk), (senderAlert, args) => { appPreferences.clearPreferences(); SingOutApp(); startBackLogin(); }); alert.SetNegativeButton(GetString(Resource.String.confirmNOk), (senderAlert, args) => { }); Dialog dialog = alert.Create(); dialog.Show(); return(true); default: return(base.OnOptionsItemSelected(item)); } }
public override bool OnOptionsItemSelected(IMenuItem item) { switch (item.ItemId) { case Resource.Id.action_setsource: AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Last.fm username"); var input = new EditText(this); alert.SetView(input); alert.SetNegativeButton("Cancel", (o, ea) => { }); alert.SetPositiveButton("OK", async(o, ea) => { LastFM.SourceUser = input.Text; await LastFM.Reload(); scrobblesView.SetAdapter(LastFM.ReythAdapter); }); alert.Show(); return(true); case Resource.Id.action_reload: RunOnUiThread(async() => { await LastFM.Reload(); scrobblesView.SetAdapter(LastFM.ReythAdapter); }); return(true); } return(false); }
private void TxtWidth_FocusChange(object sender, View.FocusChangeEventArgs e) { var txt = (EditText)sender; if (txt.Text != string.Empty) { var resp = Validartxt(txt); if (resp == false) { alert.Builder adb = new alert.Builder(this); adb.SetTitle("Advertencia?"); adb.SetMessage("Verifique el datos ingresado " + txt.Text + " y corregir!!!"); adb.SetNeutralButton("Mantener Dato", (senderAlert, args) => { }); adb.SetPositiveButton("Borrar Dato Ingresado", (senderAlert, args) => { txt.Text = ""; txt.RequestFocus(); }); alert dialog = adb.Create(); dialog.Show(); } else { txt.Focusable = true; } } }
//Alert handler to improve code cleanliness public AlertDialog CreateAlert(AlertType type, string alertMessage, string alertTitle) { if (type == AlertType.Error) { AlertDialog.Builder dialogConnection = new AlertDialog.Builder(this); dialog = dialogConnection.Create(); dialog.SetTitle(alertTitle); dialog.SetMessage(alertMessage); } else if (type == AlertType.Load) { dialog = new EDMTDialogBuilder() .SetContext(this) .SetMessage(alertMessage) .Build(); } else if (type == AlertType.Info) { AlertDialog.Builder dialogConnection = new AlertDialog.Builder(this); var btnOk = Resources.GetText(Resource.String.btnOk); dialogConnection.SetPositiveButton(btnOk, (senderAlert, args) => { dialogConnection.Dispose(); }); dialog = dialogConnection.Create(); dialog.SetTitle(alertTitle); dialog.SetMessage(alertMessage); dialog.SetCanceledOnTouchOutside(true); } dialog.Show(); return(dialog); }
private void ShowModeConfigurationDialog(int joystickId) { // Build and display the mode configuration dialog AlertDialog modeConfigurationDialog = null; AlertDialog.Builder builder = new AlertDialog.Builder(Activity, Resource.Style.AlertDialogStyle); builder.SetSingleChoiceItems(Resource.Array.JoystickModes, (int)GetRelatedJoystickConfiguration(joystickId).JoystickMode, delegate(object sender, DialogClickEventArgs args) { ConfigureJoystickAxis((JoystickConfiguration.JoystickModes)args.Which, joystickId); // ReSharper disable once AccessToModifiedClosure modeConfigurationDialog?.Dismiss(); }); builder.SetPositiveButton(Resource.String.ControlInterfaceActivity_configureJoystickModeDialogPositive, delegate { // ReSharper disable once AccessToModifiedClosure modeConfigurationDialog?.Dismiss(); }); builder.SetTitle(Resource.String.ControlInterfaceActivity_configureJoystickModeDialogTitle); builder.SetCancelable(false); modeConfigurationDialog = builder.Create(); modeConfigurationDialog.Show(); }
private async void SaveOnClick(object sender, EventArgs eventArgs) { if (RequestStoragePermission()) { View view = (View)sender; EditText editText = new EditText(this); AlertDialog.Builder builder = new AlertDialog.Builder(this); var fileText = await Task.Run(() => ViewModel.ReadTextAsync()); editText.Text = fileText; builder.SetTitle("Save Text"); builder.SetView(editText); builder.SetPositiveButton("Save", (s, args) => { if (String.IsNullOrWhiteSpace(editText.Text)) { Snackbar.Make(view, Resource.String.enter_input, Snackbar.LengthShort) .SetAction("Action", (Android.Views.View.IOnClickListener)null).Show(); return; } else { _ = ViewModel.SaveTextAsync(editText.Text); Snackbar.Make(view, Resource.String.data_saved, Snackbar.LengthShort) .SetAction("Action", (Android.Views.View.IOnClickListener)null).Show(); } }); builder.Show(); } }
private void ListViewClick(object sender, AdapterView.ItemClickEventArgs e) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Do you want add to your friends?"); alert.SetPositiveButton("Yes", async(senderAlert, args) => { FriendItem item = new FriendItem { FriendId = users[e.Position].Id, UserId = HomeActivity1.userItem.Id }; await DatabaseManager.DefaultManager.SaveFriendItemAsync(item); users.Remove(users[e.Position]); adapter = new FriendsCustomAdapter(this, users); lstData = FindViewById <ListView>(Resource.Id.listViewFriends); lstData.Adapter = adapter; }); alert.SetNegativeButton("No", (senderAlert, args) => { }); //run the alert in UI thread to display in the screen RunOnUiThread(() => { alert.Show(); }); }
private void SetDeleteMark() { AlertDialog.Builder quitDialog = new AlertDialog.Builder(this); quitDialog.SetTitle("Вы уверены?"); quitDialog.SetPositiveButton("Да", (senderAlert, args) => { var item = mAdapterDataList.GetItemAtPosition(mSelectedItemPosition); Dictionary <long, ElementData> mCommands = new Dictionary <long, ElementData>(); mCommands.Add(0, new ElementData() { Name = "delete", Data = "delete" }); string output = JsonConvert.SerializeObject(mCommands); DataSetWS dataSetWS = new DataSetWS(); dataSetWS.SetDataCompleted += DataSetWS_SetDataCompleted; dataSetWS.SetDataAsync(mRef, item.Ref, output, AppVariable.Variable.getSessionParametersJSON()); mCommands.Remove(0); }); quitDialog.SetNegativeButton("Нет", (senderAlert, args) => { }); Dialog dialog = quitDialog.Create(); dialog.Show(); }
public void ShowDeleteListAlert() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.SetMessage(Resource.String.areYouSure); builder.SetPositiveButton(Resource.String.yes, (sender, args) => { _presenter.DeleteList(); }); builder.SetNegativeButton(Resource.String.no, (sender, args) => { }); builder.Create().Show(); }
//################################################################################## public DialogCredentialsInput(Context context, EventHandler <DialogCredentialsInputEventArgs> OnLoginEntered) { _context = context; //Dialogcontent erstellen con = new ViewHolder(); LayoutInflater i = LayoutInflater.FromContext(context); View view = i.Inflate(Resource.Layout.dialog_login, null, false); con.TEXT_USERNAME = view.FindViewById <TextInputEditText>(Resource.Id.text_username); con.TEXT_PASSWORD = view.FindViewById <TextInputEditText>(Resource.Id.text_password); con.LAYOUT_USERNAME = view.FindViewById <TextInputLayout>(Resource.Id.layout_username); con.LAYOUT_PASSWORD = view.FindViewById <TextInputLayout>(Resource.Id.layout_password); con.TEXT_USERNAME.Text = TBL.Username; con.TEXT_PASSWORD.Text = TBL.Password; //Dialog erstellen AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.SetTitle(context.Resources.GetString(Resource.String.settings_dialog_cred_title)); builder.SetMessage(context.Resources.GetString(Resource.String.settings_dialog_cred_msg)); builder.SetNegativeButton(_context.Resources.GetString(Resource.String.dialog_cancel), (s, e) => { }); builder.SetPositiveButton(_context.Resources.GetString(Resource.String.dialog_login), (s, e) => { }); builder.SetView(view); con.dialog = builder.Show(); con.dialog.GetButton((int)DialogButtonType.Positive).Click += (s, e) => { string user = con.TEXT_USERNAME.Text.ToLower(); string pass = con.TEXT_PASSWORD.Text; bool valid = true; if (string.IsNullOrWhiteSpace(user) || !user.EndsWith("malteser.org")) { valid = false; con.LAYOUT_USERNAME.Error = context.Resources.GetString(Resource.String.settings_dialog_cred_error_email); } if (string.IsNullOrWhiteSpace(pass)) { valid = false; con.LAYOUT_PASSWORD.Error = context.Resources.GetString(Resource.String.settings_dialog_cred_error_pass); } if (valid) { con.LAYOUT_USERNAME.Error = string.Empty; con.LAYOUT_PASSWORD.Error = string.Empty; } else { return; } OnLoginEntered?.Invoke(this, new DialogCredentialsInputEventArgs(con.TEXT_USERNAME.Text, con.TEXT_PASSWORD.Text)); con.dialog.Dismiss(); }; }
public virtual void Alert(string format, params object[] args) { RunOnUiThread(() => { var alert = new AlertDialog.Builder(this); alert.SetMessage(string.Format(format, args)); alert.SetPositiveButton("OK", (sender, e) => { }); alert.Show(); }); }
protected override void OnStart() { base.OnStart(); Android.Content.Context ctx = this; if (_firstStart) { CheckAndRequestAppReview(); TutorialDialog.ShowTutorial(this, TutorialPart.MainActivity, new TutorialPage[] { new TutorialPage() { imageResourceId = Resource.Drawable.tutorial_compass_calibration, textResourceId = Resource.String.Tutorial_Main_CompassCalibration }, new TutorialPage() { imageResourceId = Resource.Drawable.tutorial_heading_correction, textResourceId = Resource.String.Tutorial_Main_HeadingCorrection }, new TutorialPage() { imageResourceId = Resource.Drawable.tutorial_horizont_correction_simple, textResourceId = Resource.String.Tutorial_Main_HorizontCorrection }, new TutorialPage() { imageResourceId = Resource.Drawable.tutorial_show_poi_data, textResourceId = Resource.String.Tutorial_Main_ShowPoiData }, new TutorialPage() { imageResourceId = Resource.Drawable.tutorial_ar_warning, textResourceId = Resource.String.Tutorial_Main_ARWarning }, }, () => { _firstStart = false; if (!Context.Database.IsAnyDownloadedPois()) { AlertDialog.Builder alert = new AlertDialog.Builder(this).SetCancelable(false); alert.SetPositiveButton(Resources.GetText(Resource.String.Common_Yes), (senderAlert, args) => { Intent downloadActivityIntent = new Intent(ctx, typeof(DownloadActivity)); StartActivity(downloadActivityIntent); //_adapter.NotifyDataSetChanged(); }); alert.SetNegativeButton(Resources.GetText(Resource.String.Common_No), (senderAlert, args) => { }); alert.SetMessage(Resources.GetText(Resource.String.Main_DownloadDataQuestion)); var answer = alert.Show(); } ElevationProfileProvider.Instance().CheckAndReloadElevationProfile(this, MaxDistance, Context); }); } }
private void ShowMotorConfigurationDialog(int joystickId, int joystickAxis) { // Build and display the motor configuration dialog AlertDialog motorConfigurationDialog = null; AlertDialog.Builder builder = new AlertDialog.Builder(Activity, Resource.Style.AlertDialogStyle); builder.SetSingleChoiceItems(GetMotorList(), GetRelatedJoystickConfiguration(joystickId).MotorIndexes[joystickAxis], delegate(object sender, DialogClickEventArgs args) { // When one motor was clicked we set it and display the next dialog SetMotorIndex(joystickId, args.Which, joystickAxis); // ReSharper disable once AccessToModifiedClosure motorConfigurationDialog?.Dismiss(); // If configured the first joystick axis we have to configure the second. // This can be done better but it works :) if (joystickAxis == 0) { ShowMotorConfigurationDialog(joystickId, ++joystickAxis); } }); builder.SetPositiveButton(Resource.String.ControlInterfaceActivity_configureJoystickMotor1DialogPositive, delegate { // ReSharper disable once AccessToModifiedClosure motorConfigurationDialog?.Dismiss(); // If configured the first joystick axis we have to configure the second. if (joystickAxis == 0) { ShowMotorConfigurationDialog(joystickId, ++joystickAxis); } }); if (joystickAxis == 0) { builder.SetTitle(Resource.String.ControlInterfaceActivity_configureJoystickMotor1DialogTitle); } else if (joystickAxis == 1) { builder.SetTitle(Resource.String.ControlInterfaceActivity_configureJoystickMotor2DialogTitle); } builder.SetCancelable(false); motorConfigurationDialog = builder.Create(); motorConfigurationDialog.Show(); }
private void MapOnInfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e) { Marker myMarker = e.Marker; ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(Android.App.Application.Context); ISharedPreferencesEditor editor = prefs.Edit(); KeyValuePair <Building, List <Workplace> > buildingInstance = CompositeMarkers[myMarker.Id]; TextView markerMenu = FindViewById <TextView>(Resource.Id.marker_menu); PopupMenu menu = new PopupMenu(this, markerMenu); foreach (Workplace workplace in buildingInstance.Value) { FindedWorkplace finded = findedWorkplaces.FirstOrDefault(x => x.WorkplaceId == workplace.Id); menu.Menu.Add("Workplace number:" + workplace.Id.ToString() + ",\nWorkplace cost: " + workplace.Cost.ToString() + ",\nAppropriation: " + finded.AppropriationPercentage.ToString() + ",\nCost approp: " + finded.CostColor + ", Address: " + buildingInstance.Key.Country + ", " + buildingInstance.Key.City + ", " + buildingInstance.Key.Street + ", " + buildingInstance.Key.House.ToString() + ", " + buildingInstance.Key.Flat.ToString()); } menu.MenuItemClick += (s1, arg1) => { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Workplace"); alert.SetMessage(arg1.Item.TitleFormatted.ToString()); alert.SetPositiveButton("Visit", async(senderAlert, arg) => { ISharedPreferences prefs1 = PreferenceManager.GetDefaultSharedPreferences(Android.App.Application.Context); ISharedPreferencesEditor editor1 = prefs1.Edit(); string workplId = arg1.Item.TitleFormatted.ToString().Split(':', ',')[1]; editor1.PutString("workplaceId", workplId); editor1.Apply(); var intent = new Intent(this, typeof(WorkplaceActivity)); StartActivity(intent); }); alert.SetNegativeButton("Cancel", (senderAlert, arg) => { Toast.MakeText(this, "Cancelled!", ToastLength.Short).Show(); }); Dialog dialog = alert.Create(); dialog.Show(); }; menu.DismissEvent += (s2, arg2) => { Console.WriteLine("menu dismissed"); }; menu.Show(); //editor.PutString("restaurant", Markers[myMarker.Id].ToString()); //editor.Apply(); //var intent = new Intent(this, typeof(RestaurantActivity)); //StartActivity(intent); }
public void showRegisteredDialog() { AlertDialog.Builder alert = new AlertDialog.Builder(context); alert.SetTitle("Success!"); alert.SetMessage("Registration completed"); alert.SetPositiveButton("Ok!", (sender, args) => { }); Dialog dialog = alert.Create(); dialog.Show(); }
private void DisplayException(Exception exception) { if (exception == null) { throw new ArgumentNullException(nameof(exception)); } AlertDialog.Builder builder = new AlertDialog.Builder(Context, Resource.Style.MyMaterialTheme); builder.SetTitle(Resource.String.ErrorTitle); builder.SetMessage(exception.Message); builder.SetPositiveButton(Android.Resource.String.Ok, (IDialogInterfaceOnClickListener)null); builder.Show(); }
void MGV_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.SetTitle("提示"); builder.SetMessage("是否要删除这张照片"); builder.SetPositiveButton(Resource.String.str_cn_confrim, (ss, ee) => { mImageAdapter.mImageViewer.PathList.RemoveAt(e.Position); mImageAdapter.NotifyDataSetChanged(); }); builder.SetNegativeButton(Resource.String.str_cn_cancel, (ss, ee) => { }); builder.Create().Show(); }
private void ShowDialog(string title, string messaage) { AlertDialog.Builder alertDiag = new AlertDialog.Builder(this); alertDiag.SetTitle(title); alertDiag.SetMessage(messaage); alertDiag.SetPositiveButton("Okay", (senderAlert, args) => { }); Dialog diag = alertDiag.Create(); diag.Show(); }
/// <summary> /// Handles the lesson fragment's lesson finished event /// </summary> /// <param name="sender">sender.</param> /// <param name="e">event args.</param> void LessonFragment_LessonFinished(object sender, EventArgs e) { //Toast.MakeText(this, "Lesson finished!", ToastLength.Short).Show(); var builder = new AlertDialog.Builder(this); builder.SetTitle(Resource.String.lesson_finished); builder.SetMessage(Resource.String.lesson_finished_message); builder.SetCancelable(false); builder.SetPositiveButton(Android.Resource.String.Ok, (s, args) => NextLesson()); builder.Show(); }
private void ShowDialog(ListItemAdapter adapter, int itemPosition, string dialogTitle, bool isPendingDialog, bool isPayment, bool isHistory) { AlertDialog.Builder builder = new AlertDialog.Builder(this.Activity, Resource.Style.AlertDialogStyle); var debtItem = adapter.Items[itemPosition]; builder.SetTitle(dialogTitle); if (isPendingDialog) { builder.SetPositiveButton("Accept", (senderAlert, e) => { if (dialogTitle.ToLower().Contains("debt")) { DatabaseInterface.AcceptDebt(debtItem.Id, _persoon.Id, _persoon.Password); Toast.MakeText(this.Activity, "Debt accepted: " + debtItem.Description, ToastLength.Short).Show(); SwipeRefreshLayout.Refreshing = true; this.Refresh(); } else if (dialogTitle.ToLower().Contains("payment")) { string[] user = debtItem.Name.Split(' '); foreach(int debt in _persoon.KrijgPaymentsVanGebruiker(user[1])) DatabaseInterface.AcceptPayment(debt, _persoon.Id, _persoon.Password); Toast.MakeText(this.Activity, "Payment accepted from: " + debtItem.Name, ToastLength.Short).Show(); SwipeRefreshLayout.Refreshing = true; this.Refresh(); } CreateEnvironments(); }); builder.SetNegativeButton("Decline", (s, e) => { if (dialogTitle.ToLower().Contains("debt")) { DatabaseInterface.DeclineDebt(debtItem.Id, _persoon.Id, _persoon.Password); Toast.MakeText(this.Activity, "Debt declined: " + debtItem.Description, ToastLength.Short).Show(); Gegevens.GetServerData(_persoon.Id, _persoon.Password); ((Payscherm)this.Activity).Restart(); } else if (dialogTitle.ToLower().Contains("payment")) { string[] user = debtItem.Name.Split(' '); foreach(int debt in _persoon.KrijgPaymentsVanGebruiker(user[1])) DatabaseInterface.DeclinePayment(debt, _persoon.Id, _persoon.Password); Toast.MakeText(this.Activity, "Payment declined from: " + debtItem.Name, ToastLength.Short).Show(); Gegevens.GetServerData(_persoon.Id, _persoon.Password); ((Payscherm)this.Activity).Restart(); } CreateEnvironments(); }); builder.SetNeutralButton("Cancel", (s, e) => { // dialog cancelt automatisch }); } View dialogView; if (isPayment) { dialogView = this.Activity.LayoutInflater.Inflate(Resource.Layout.PaymentDialog, null); builder.SetView(dialogView); } else { if (isHistory) { dialogView = this.Activity.LayoutInflater.Inflate(Resource.Layout.HistoryDialog, null); builder.SetView(dialogView); dialogView.FindViewById<TextView>(Resource.Id.dialogItemDate).Text = debtItem.StringValue; } else { dialogView = this.Activity.LayoutInflater.Inflate(Resource.Layout.DebtDialog, null); builder.SetView(dialogView); } List<string> tempList = debtItem.FullDescription.Split('-').ToList(); tempList.RemoveAt(0); if (tempList.Count != 0) // check of er producten zijn toegevoegd { tempList.RemoveAt(tempList.Count - 1); } // maak producten aan op basis van een stringlist List<ListItem> productList = new List<ListItem>(); for(int i = 0; i < tempList.Count; i += 2) { productList.Add(new ListItem(tempList[i], double.Parse(tempList[i+1]) / 100)); } ListItemAdapter dialogAdapter = new ListItemAdapter(ListItem.DialogItem, productList); RecyclerView dialogRecyclerView = dialogView.FindViewById<RecyclerView>(Resource.Id.dialogrecyclerview); dialogRecyclerView.SetLayoutManager(new LinearLayoutManager(this.Activity)); dialogRecyclerView.SetAdapter(dialogAdapter); dialogView.FindViewById<TextView>(Resource.Id.dialogItemDescription).Text = debtItem.Description; } dialogView.FindViewById<TextView>(Resource.Id.dialogItemName).Text = debtItem.Name; dialogView.FindViewById<TextView>(Resource.Id.dialogItemValue).Text = debtItem.Value.ToString("N"); dialogView.FindViewById<ImageView>(Resource.Id.dialogItemImage).SetImageResource(debtItem.ImageId); builder.SetCancelable(true); builder.Show(); }
void OnItemClick(object sender, ListItemEventArgs args) { AlertDialog.Builder builder = new AlertDialog.Builder(this, Resource.Style.AlertDialogStyle); View dialogView = LayoutInflater.Inflate(Resource.Layout.NumberAlertItem, null); EditText Amount = dialogView.FindViewById<EditText> (Resource.Id.EditAmount); Amount.FocusChange += delegate { if(Amount.HasFocus) Amount.Text = ""; }; var tempItem = _adapter.Items[args.Position]; builder.SetTitle("Enter the amount of your payment"); builder.SetPositiveButton("Send", (senderAlert, e) => { Aflossen(tempItem.Name, System.Convert.ToDouble(Amount.Text)); }); builder.SetNeutralButton("Cancel", (senderAlert, e) => { // yay cancel }); builder.SetView(dialogView); builder.SetCancelable(true); builder.Show(); }
private void Alert(string message) { AlertDialog.Builder builder = new AlertDialog.Builder(this, Resource.Style.AlertDialogStyle); builder.SetTitle("Error"); builder.SetMessage(message); builder.SetPositiveButton("OK", (senderAlert, e) => { }); builder.Show(); }
private void ReasonAlert() { AlertDialog.Builder builder = new AlertDialog.Builder(this, Resource.Style.AlertDialogStyle); View dialogView = LayoutInflater.Inflate(Resource.Layout.AlertItem, null); EditText redenedit = dialogView.FindViewById<EditText> (Resource.Id.EditAmount); redenedit.FocusChange += delegate { if(redenedit.HasFocus) redenedit.Text = ""; }; builder.SetTitle("Enter the occasion of your debt"); builder.SetPositiveButton("Confirm", (senderAlert, e) => { CreateDebts(redenedit.Text); }); builder.SetNeutralButton("Cancel", (senderAlert, e) => { //cancelt de dialog }); builder.SetView(dialogView); builder.SetCancelable(true); builder.Show (); }
// Warns user that they will delete this booking and removes the booking if user presses okay private void CancelBooking() { AlertDialog.Builder cancelAlert = new AlertDialog.Builder(this); cancelAlert.SetTitle(GetString(Resource.String.cancelBooking)); cancelAlert.SetMessage(GetString(Resource.String.areYouSureCancel)); cancelAlert.SetPositiveButton("YES", delegate { if(_Booking.GetType() == typeof(SessionBooking)) { SessionController sessionController = new SessionController(); if (!sessionController.CancelSession(_Booking.ID())) { //show error, stay on page } else { //show dialog saying canceled var SuccesDialog = new AlertDialog.Builder(this); SuccesDialog.SetMessage("Booking has been Canceled!"); SuccesDialog.SetNeutralButton("OK", delegate { Finish(); }); SuccesDialog.Show(); if (bookingType.Equals("Session")) Server.sessionBookingsAltered = true; else Server.workshopBookingsAltered = true; } } else if (_Booking.GetType() == typeof(WorkshopBooking)) { // Code to cancel booking. WorkshopController workshopController = new WorkshopController(); if (!workshopController.CancelBooking(_Booking.ID())) { //show error, stay on page; } else { //show dialog saying cancled var SuccesDialog = new AlertDialog.Builder(this); SuccesDialog.SetMessage("Booking has been Canceled!"); SuccesDialog.SetNeutralButton("OK", delegate { Finish(); }); SuccesDialog.Show(); if (bookingType.Equals("Session")) Server.sessionBookingsAltered = true; else Server.workshopBookingsAltered = true; } } }); cancelAlert.SetNegativeButton("NO", delegate { }); cancelAlert.Show(); }
private void FabWcd_Click(object sender, EventArgs e) { if (snackbar != null) { snackbar.Dismiss(); snackbar = null; } if (wcdListAdapter.Count == 0) { Refresh(); if (wcdListAdapter.Count == 0) Show("항목이 없습니다"); return; } List<int> positions = new List<int>(); try { SparseBooleanArray checkedList = listView.CheckedItemPositions; for (int i = 0; i < checkedList.Size(); i++) { if (checkedList.ValueAt(i)) { positions.Add(checkedList.KeyAt(i)); } } if (positions.Count == 0) lastPosition = 0; } catch { return; } View dialogView = LayoutInflater.From(Context).Inflate(Resource.Layout.weld_condition_editor, null); AlertDialog.Builder dialog = new AlertDialog.Builder(Context); dialog.SetView(dialogView); // 에디트텍스트 IList<EditText> etList = new List<EditText>(); etList.Add(dialogView.FindViewById<EditText>(Resource.Id.etOutputData)); etList.Add(dialogView.FindViewById<EditText>(Resource.Id.etOutputType)); etList.Add(dialogView.FindViewById<EditText>(Resource.Id.etSqueezeForce)); etList.Add(dialogView.FindViewById<EditText>(Resource.Id.etMoveTipClearance)); etList.Add(dialogView.FindViewById<EditText>(Resource.Id.etFixedTipClearance)); etList.Add(dialogView.FindViewById<EditText>(Resource.Id.etPannelThickness)); etList.Add(dialogView.FindViewById<EditText>(Resource.Id.etCommandOffset)); int[] etMax = { 2000, 100, 350, 500, 500, 500, 500, 1000, 1000 }; // 임계치 InputMethodManager imm = (InputMethodManager)Context.GetSystemService(Context.InputMethodService); for (int i = 0; i < etList.Count; i++) { EditText et = etList[i]; if (i == 0) // outputData et.Text = wcdListAdapter[lastPosition][i]; // 기본선택된 자료값 가져오기 int maxValue = etMax[i]; // 임계치 설정 et.FocusChange += (object sender1, View.FocusChangeEventArgs e1) => { int n; if (Int32.TryParse(et.Text, out n)) { if (n > maxValue) { n = maxValue; et.Text = n.ToString(); } } }; et.KeyPress += (object sender1, View.KeyEventArgs e1) => { // KeyEventArgs.Handled // 라우트된 이벤트를 처리된 것으로 표시하려면 true이고, // 라우트된 이벤트를 처리되지 않은 것으로 두어 이벤트가 추가로 라우트되도록 허용하려면 false입니다. // 기본값은 false입니다. e1.Handled = false; if (e1.KeyCode == Keycode.Enter || e1.KeyCode == Keycode.Back || e1.KeyCode == Keycode.Escape) { imm.HideSoftInputFromWindow(et.WindowToken, 0); et.ClearFocus(); e1.Handled = true; } }; } var statusText = dialogView.FindViewById<TextView>(Resource.Id.statusText); statusText.Text = wcdListAdapter[lastPosition][0]; if (positions.Count > 0) { StringBuilder sb = new StringBuilder(); foreach (int pos in positions) { sb.Append(pos + 1); sb.Append(" "); } statusText.Text = "수정 항목: " + sb.ToString().TrimEnd(); } else { statusText.Text = "수정 항목: " + (lastPosition + 1).ToString(); } var sampleSeekBar = dialogView.FindViewById<SeekBar>(Resource.Id.sampleSeekBar); sampleSeekBar.Max = wcdListAdapter.Count - 1; sampleSeekBar.Progress = Convert.ToInt32(wcdListAdapter[lastPosition][0]) - 1; sampleSeekBar.ProgressChanged += (object sender1, SeekBar.ProgressChangedEventArgs e1) => { for (int i = 0; i < wcdListAdapter[sampleSeekBar.Progress].Count; i++) { if (etList[i].Text != "") etList[i].Text = wcdListAdapter[sampleSeekBar.Progress][i]; } if (positions.Count == 0) { lastPosition = sampleSeekBar.Progress; statusText.Text = "수정 항목: " + (lastPosition + 1).ToString(); } }; // 선택 시작 var beginSeekBar = dialogView.FindViewById<SeekBar>(Resource.Id.sbBegin); beginSeekBar.Max = wcdListAdapter.Count - 1; beginSeekBar.Progress = 0; // 선택 끝 var endSeekBar = dialogView.FindViewById<SeekBar>(Resource.Id.sbEnd); endSeekBar.Max = wcdListAdapter.Count - 1; endSeekBar.Progress = endSeekBar.Max; beginSeekBar.ProgressChanged += (object sender1, SeekBar.ProgressChangedEventArgs e1) => { if (e1.FromUser) { int sb1Progress = beginSeekBar.Progress; int sb2Progress = endSeekBar.Max - endSeekBar.Progress; if (sb1Progress > sb2Progress) { sb2Progress = sb1Progress; endSeekBar.Progress = endSeekBar.Max - sb1Progress; } if (sb1Progress == 0 && sb2Progress == 0 || sb1Progress == beginSeekBar.Max && sb2Progress == endSeekBar.Max) { if (positions.Count > 0) { StringBuilder sb = new StringBuilder(); foreach (int pos in positions) { sb.Append(pos + 1); sb.Append(" "); } statusText.Text = "수정 항목: " + sb.ToString().TrimEnd(); } else { statusText.Text = "수정 항목: " + (lastPosition + 1).ToString(); } } else { statusText.Text = "수정 범위: " + string.Format("{0}", sb1Progress + 1) + " ~ " + string.Format("{0}", sb2Progress + 1); } } }; endSeekBar.ProgressChanged += (object sender2, SeekBar.ProgressChangedEventArgs e2) => { if (e2.FromUser) { int sb1Progress = beginSeekBar.Progress; int sb2Progress = endSeekBar.Max - endSeekBar.Progress; if (sb2Progress < sb1Progress) { sb1Progress = sb2Progress; beginSeekBar.Progress = sb2Progress; } if (sb1Progress == 0 && sb2Progress == 0 || sb1Progress == beginSeekBar.Max && sb2Progress == endSeekBar.Max) { if (positions.Count > 0) { StringBuilder sb = new StringBuilder(); foreach (int pos in positions) { sb.Append(pos + 1); sb.Append(" "); } statusText.Text = "수정 항목: " + sb.ToString().TrimEnd(); } else { statusText.Text = "수정 항목: " + (lastPosition + 1).ToString(); } } else { statusText.Text = "수정 범위: " + string.Format("{0}", sb1Progress + 1) + " ~ " + string.Format("{0}", sb2Progress + 1); } } }; dialog.SetNegativeButton("취소", delegate { CheckListItem(false); }); dialog.SetPositiveButton("저장", async delegate { int seekBegin = beginSeekBar.Progress + 1; int seekEnd = endSeekBar.Max - endSeekBar.Progress + 1; bool isSeek = !((seekBegin == 1 && seekEnd == 1) || (seekBegin == beginSeekBar.Max + 1 && seekEnd == endSeekBar.Max + 1)); bool isUpdate = false; if (positions.Count == 0) positions.Add(lastPosition); if (isSeek) { positions.Clear(); for (int rowNum = seekBegin - 1; rowNum < seekEnd; rowNum++) { positions.Add(rowNum); } } foreach (int rowNum in positions) { for (int colNum = 1; colNum < wcdListAdapter[rowNum].Count; colNum++) { if (etList[colNum].Text != "") { wcdListAdapter[rowNum][colNum] = etList[colNum].Text; isUpdate = true; } } listView.SetItemChecked(rowNum, false); wcdListAdapter[rowNum].ItemChecked = false; } if (isUpdate) { wcdListAdapter.NotifyDataSetChanged(); await UpdateFileAsync(robotPath, wcdListAdapter); } else { CheckListItem(false); } try { if (wcdListAdapter.Count == 0) fabWcd.SetImageResource(Resource.Drawable.ic_refresh_white); else if (listView.CheckedItemCount == 0) fabWcd.SetImageResource(Resource.Drawable.ic_subject_white); else fabWcd.SetImageResource(Resource.Drawable.ic_edit_white); } catch { } }); dialog.Show(); }
private void ListView_Click(int position) { if (adapter.Count == 0) { Refresh(); if (adapter.Count == 0) Show("항목이 없습니다"); return; } var jobFile = adapter.GetItem(position); if (jobFile.JobCount.Total == 0) { Show("CN 항목이 없습니다"); return; } InputMethodManager imm = (InputMethodManager)Context.GetSystemService(Context.InputMethodService); View dialogView = LayoutInflater.From(Context).Inflate(Resource.Layout.weld_count_editor, null); AlertDialog.Builder dialog = new AlertDialog.Builder(Context); dialog.SetView(dialogView); var statusText = dialogView.FindViewById<TextView>(Resource.Id.statusText); statusText.Text = "계열 수정 (CN: " + jobFile.JobCount.Total.ToString() + "개)"; var linearLayout = dialogView.FindViewById<LinearLayout>(Resource.Id.linearLayout); var etBeginNumber = dialogView.FindViewById<EditText>(Resource.Id.etBeginNumber); var sbBeginNumber = dialogView.FindViewById<SeekBar>(Resource.Id.sampleSeekBar); var etList = new List<EditText>(); for (int i = 0; i < jobFile.Count; i++) { if (jobFile[i].RowType == Job.RowTypes.Spot) { var textInputLayout = new TextInputLayout(Context); var etCN = new EditText(Context); etCN.SetSingleLine(); etCN.SetTextSize(ComplexUnitType.Dip, 12); etCN.InputType = etBeginNumber.InputType; etCN.SetSelectAllOnFocus(true); etCN.Hint = "CN[" + jobFile[i].RowNumber + "]"; etCN.Text = jobFile[i].CN; etCN.Gravity = GravityFlags.Center; etCN.Tag = jobFile[i]; etCN.FocusChange += (object sender1, View.FocusChangeEventArgs e1) => { int beginNumber; if (Int32.TryParse(etCN.Text, out beginNumber)) { if (beginNumber > 255) { beginNumber = 255; etCN.Text = beginNumber.ToString(); } } }; etCN.KeyPress += (object sender1, View.KeyEventArgs e1) => { e1.Handled = false; if (e1.KeyCode == Keycode.Enter || e1.KeyCode == Keycode.Back || e1.KeyCode == Keycode.Escape) { imm.HideSoftInputFromWindow(etCN.WindowToken, 0); etCN.ClearFocus(); e1.Handled = true; } }; textInputLayout.AddView(etCN); linearLayout.AddView(textInputLayout); etList.Add(etCN); } } etBeginNumber.FocusChange += (object sender1, View.FocusChangeEventArgs e1) => { int beginNumber; if (int.TryParse(etBeginNumber.Text, out beginNumber)) { if (beginNumber > 255) { beginNumber = 255; etBeginNumber.Text = beginNumber.ToString(); } sbBeginNumber.Progress = beginNumber - 1; foreach (var et in etList) { et.Text = beginNumber++.ToString(); if (beginNumber > 255) beginNumber = 255; } } }; etBeginNumber.KeyPress += (object sender1, View.KeyEventArgs e1) => { e1.Handled = false; if (e1.KeyCode == Keycode.Enter || e1.KeyCode == Keycode.Back || e1.KeyCode == Keycode.Escape) { imm.HideSoftInputFromWindow(etBeginNumber.WindowToken, 0); etBeginNumber.ClearFocus(); e1.Handled = true; } }; sbBeginNumber.Max = 254; sbBeginNumber.Progress = 0; sbBeginNumber.ProgressChanged += (object sender1, SeekBar.ProgressChangedEventArgs e1) => { int beginNumber = sbBeginNumber.Progress + 1; etBeginNumber.Text = beginNumber.ToString(); }; sbBeginNumber.StopTrackingTouch += (object sender1, SeekBar.StopTrackingTouchEventArgs e1) => { int beginNumber = sbBeginNumber.Progress + 1; etBeginNumber.Text = beginNumber.ToString(); foreach (var et in etList) { et.Text = beginNumber++.ToString(); if (beginNumber > 255) beginNumber = 255; } }; dialog.SetNegativeButton("취소", delegate { }); dialog.SetPositiveButton("저장", delegate { foreach (var et in etList) { var job = (Job)et.Tag; job.CN = et.Text; } if (jobFile.JobCount.Total > 0) { jobFile.SaveFile(); adapter.NotifyDataSetChanged(); listView.RefreshDrawableState(); this.Show((string)("저장 완료: " + jobFile.JobCount.fi.Name)); } }); dialog.Show(); }
/// <summary> /// Switches to the next lesson if available /// </summary> private void NextLesson() { var nextLesson = DataHolder.Current.CurrentModule.GetNextLesson(DataHolder.Current.CurrentLesson); if (nextLesson != null) { DataHolder.Current.CurrentLesson = nextLesson; DataHolder.Current.CurrentIteration = nextLesson.Iterations.First(); InitLesson(); } else { var builder = new AlertDialog.Builder(this); builder.SetTitle(Resource.String.module_finished); builder.SetMessage(Resource.String.module_finished_message); builder.SetCancelable(false); builder.SetPositiveButton(Android.Resource.String.Ok, (s, args) => Finish()); builder.Show(); } }