public override bool OnOptionsItemSelected(global::Android.Views.IMenuItem item) { if (item.ItemId == Resource.Id.server) { var d = new Dialog(this); d.RequestWindowFeature((int)WindowFeatures.NoTitle); d.SetContentView(Resource.Layout.ServerEdit); var t = d.FindViewById<EditText>(Resource.Id.uri); t.Text = baseUri.ToString(); var b = d.FindViewById<Button>(Resource.Id.okButton); b.Click += (s, a) => { d.Dismiss(); // attempt to parse uri Uri uri; if (Uri.TryCreate(t.Text, UriKind.Absolute, out uri)) baseUri = uri; // recreate tabs CreateTabs(); }; d.Show(); } return base.OnOptionsItemSelected(item); }
public PopupDialogContainer(PopupArguments popupArguments) { _popupArguments = popupArguments; _popup = popupArguments.Popup; _dialog = new Dialog(Forms.Context); _dialog.RequestWindowFeature((int)WindowFeatures.NoTitle); _popup.CloseRequest += OnCloseRequest; }
internal static Android.App.Dialog CreateFullScreenTransparentDialog(View contentView) { var dialog = new Android.App.Dialog(Context, Resource.Style.NoDimDialogFragmentStyle); dialog.RequestWindowFeature((int)WindowFeatures.NoTitle); dialog.SetContentView(contentView); dialog.Window.SetBackgroundDrawable(new ColorDrawable(Android.Graphics.Color.Transparent)); dialog.Window.SetLayout(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); return(dialog); }
public override View GetView(int position, View convertView, ViewGroup parent) { var item = lista[position]; View view = convertView; view = context.LayoutInflater.Inflate(Resource.Layout.layoutFechas, null); view.FindViewById <TextView>(Resource.Id.txtFexcha).Text = item.fecha; view.Click += delegate { Android.App.Dialog alertar = new Android.App.Dialog(context, Resource.Style.ThemeOverlay_AppCompat_Dialog); alertar.RequestWindowFeature(1); alertar.SetCancelable(true); alertar.SetContentView(Resource.Layout.layoutResumen); string concatenar = ""; if (identificador == "0") { var con = new SQLiteConnection(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "baseInterna.sqlite")); var consulta = con.Query <Trabajadores>("select * from trabajadores", (new Trabajadores()).id_pregunta); List <string> preguntas = new List <string>(); foreach (var itemP in consulta) { preguntas.Add(itemP.pregunta); } concatenar = preguntas[0] + "\r\n" + item.pregunta1 + "\r\n" + "\r\n" + preguntas[1] + "\r\n" + item.pregunta2 + "\r\n" + "\r\n" + preguntas[2] + "\r\n" + item.pregunta3 + "\r\n" + "\r\n" + preguntas[3] + "\r\n" + item.pregunta4 + "\r\n" + "\r\n" + preguntas[4] + "\r\n" + item.pregunta5 + "\r\n"; } else { var con = new SQLiteConnection(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "baseInterna.sqlite")); var consulta = con.Query <Areas>("select * from Areas", (new Areas()).id_pregunta); List <string> preguntas = new List <string>(); foreach (var itemP in consulta) { preguntas.Add(itemP.pregunta); } concatenar = preguntas[0] + "\r\n" + item.pregunta1 + "\r\n" + "\r\n" + preguntas[1] + "\r\n" + item.pregunta2 + "\r\n" + "\r\n" + preguntas[2] + "\r\n" + item.pregunta3 + "\r\n" + "\r\n" + preguntas[3] + "\r\n" + item.pregunta4 + "\r\n" + "\r\n" + preguntas[4] + "\r\n" + item.pregunta5 + "\r\n"; } alertar.FindViewById <TextView>(Resource.Id.txtPreguntaR).Text = concatenar; alertar.Show(); }; return(view); }
public void InitializeDialog() { this.dialogView = new DialogView(this); var renderer = dialogView.GetOrCreateRenderer(); nativeView = renderer.View; dialog = new Android.App.Dialog(BaseApplication.MainActivity); dialog.RequestWindowFeature((int)WindowFeatures.NoTitle); dialog.SetCancelable(false); dialog.SetContentView(nativeView); Window window = dialog.Window; window.SetLayout(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); // window.ClearFlags(WindowManagerFlags.DimBehind); window.SetBackgroundDrawable(new ColorDrawable(Android.Graphics.Color.Transparent)); }
public void ShowProgressDialog (string message) { if (_dialog != null) { HideProgressDialog (); } _dialog = new Dialog(Forms.Context); _dialog.RequestWindowFeature((int)WindowFeatures.NoTitle); _dialog.SetCancelable(false); _dialog.SetCanceledOnTouchOutside(false); Window window = _dialog.Window; window.SetLayout(WindowManagerLayoutParams.MatchParent, WindowManagerLayoutParams.MatchParent); window.SetBackgroundDrawable(new ColorDrawable(Android.Graphics.Color.Transparent)); _dialog.SetContentView (Resource.Layout.dialog); var textView = (TextView)_dialog.FindViewById(Resource.Id._textView); textView.SetTypeface (_typeFaceRegular, TypefaceStyle.Normal); textView.Text = message; _dialog.Show(); }
void SetupDialog(Context context, MaskType maskType, Action cancelCallback, Func<Context, Dialog, MaskType, View> customSetup) { Application.SynchronizationContext.Send(state => { CurrentDialog = new Dialog(context); CurrentDialog.RequestWindowFeature((int)WindowFeatures.NoTitle); if (maskType != MaskType.Black) CurrentDialog.Window.ClearFlags(WindowManagerFlags.DimBehind); if (maskType == MaskType.None) CurrentDialog.Window.SetFlags(WindowManagerFlags.NotTouchModal, WindowManagerFlags.NotTouchModal); CurrentDialog.Window.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(Android.Graphics.Color.Transparent)); var customView = customSetup(context, CurrentDialog, maskType); CurrentDialog.SetContentView (customView); CurrentDialog.SetCancelable (cancelCallback != null); if (cancelCallback != null) CurrentDialog.CancelEvent += (sender, e) => cancelCallback(); CurrentDialog.Show (); }, null); }
void MultiChoice(object sender, EventArgs e) { var dialog = new Dialog (this); dialog.RequestWindowFeature(1); dialog.SetContentView (Resource.Layout.multichoice); dialog.Window.SetBackgroundDrawableResource (Resource.Drawable.station_sign_background); dialog.Window.SetFeatureInt (WindowFeatures.NoTitle,0); dialog.SetCancelable (true); var title = (TextView) dialog.FindViewById (Resource.Id.titleDialog); title.Typeface = kalingab; var listView = (ListView) dialog.FindViewById (Resource.Id.multiListView); listView.Clickable = true; listView.ChoiceMode = ChoiceMode.Multiple; listView.ItemClick += (object s, AdapterView.ItemClickEventArgs ev) => { var conn = connections [ev.Position]; conn.Save = !conn.Save; Console.WriteLine ("item clicked {0}", ev.Position); ((XListViewAdapter) listView.Adapter).NotifyDataSetChanged (); }; var listAdapter = new XListViewAdapter (this, connections); listView.Adapter = listAdapter; //XListViewAdapter.CheckHandler += RadioClicked; var btnOk = (Button)dialog.FindViewById(Resource.Id.bOk); btnOk.Click += delegate { foreach (var connection in connections) { if (connection.Save) { Console.WriteLine ("id: {0} Save?:{1}", connection.ID, connection.Save); } } //cCommand.AddConnection (connection); var cCommand = new ConnectionCommands (this); cCommand.Close (); dialog.Cancel (); }; var btnCancel = (Button)dialog.FindViewById(Resource.Id.bCancel); btnCancel.Click += delegate { dialog.Cancel (); }; dialog.Show(); }
void SetupDialog(Context context, MaskType maskType, Func<Context, Dialog, MaskType, View> customSetup) { Application.SynchronizationContext.Post(state => { CurrentDialog = new Dialog(context); CurrentDialog.RequestWindowFeature((int)WindowFeatures.NoTitle); if (maskType != MaskType.Black) CurrentDialog.Window.ClearFlags(WindowManagerFlags.DimBehind); CurrentDialog.Window.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(Android.Graphics.Color.Transparent)); var customView = customSetup(context, CurrentDialog, maskType); CurrentDialog.SetContentView (customView); CurrentDialog.SetCancelable (false); CurrentDialog.Show (); }, null); }
void TimePicker_Dialog(object sender, EventArgs e) { dialog = new Dialog (this); dialog.RequestWindowFeature(1); dialog.SetContentView (Resource.Layout.timedialog); dialog.Window.SetBackgroundDrawableResource (Resource.Drawable.empty); dialog.Window.SetFeatureInt (WindowFeatures.NoTitle,0); dialog.Window.ClearFlags (WindowManagerFlags.DimBehind); dialog.SetCancelable (true); dialog.SetCanceledOnTouchOutside (true); // hour var hourInput = dialog.FindViewById (Resource.Id.hourInput) as EditText; var hourUp = dialog.FindViewById (Resource.Id.hourUp) as Button; var hourDown = dialog.FindViewById (Resource.Id.hourDown) as Button; hourUp.Tag = Resource.Id.hourInput; hourDown.Tag = Resource.Id.hourInput; hourUp.Click += Change_Time; hourDown.Click += Change_Time; // minute var minuteInput = dialog.FindViewById (Resource.Id.minuteInput) as EditText; var minuteUp = dialog.FindViewById (Resource.Id.minuteUp) as Button; var minuteDown = dialog.FindViewById (Resource.Id.minuteDown) as Button; minuteUp.Tag = Resource.Id.minuteInput; minuteDown.Tag = Resource.Id.minuteInput; minuteUp.Click += Change_Time; minuteDown.Click += Change_Time; var time = timeLabel.Text.Split(':'); RunOnUiThread (() => { hourInput.Text = time [0]; minuteInput.Text = time [1]; }); var btnOk = (Button)dialog.FindViewById(Resource.Id.button2); btnOk.Click += delegate { RunOnUiThread (() => timeLabel.Text = String.Format ("{0}:{1}", hourInput.Text, minuteInput.Text)); dialog.Dismiss (); }; var btnCancel = (Button)dialog.FindViewById(Resource.Id.button1); btnCancel.Click += delegate { dialog.Cancel (); }; dialog.Show();; }
void DatePicker_Dialog(object sender, EventArgs e) { dialog = new Dialog (this); dialog.RequestWindowFeature(1); dialog.SetContentView (Resource.Layout.datedialog); dialog.Window.SetBackgroundDrawableResource (Resource.Drawable.empty); dialog.Window.SetFeatureInt (WindowFeatures.NoTitle,0); dialog.Window.ClearFlags (WindowManagerFlags.DimBehind); dialog.SetCancelable (true); dialog.SetCanceledOnTouchOutside (true); // day var dayInput = dialog.FindViewById (Resource.Id.dayInput) as EditText; var dayUp = dialog.FindViewById (Resource.Id.dayUp) as Button; var dayDown = dialog.FindViewById (Resource.Id.dayDown) as Button; dayUp.Tag = Resource.Id.dayInput; dayDown.Tag = Resource.Id.dayInput; dayUp.Click += Change_Date; dayDown.Click += Change_Date; // day var monthInput = dialog.FindViewById (Resource.Id.monthInput) as EditText; var monthUp = dialog.FindViewById (Resource.Id.monthUp) as Button; var monthDown = dialog.FindViewById (Resource.Id.monthDown) as Button; monthUp.Tag = Resource.Id.monthInput; monthDown.Tag = Resource.Id.monthInput; monthUp.Click += Change_Date; monthDown.Click += Change_Date; // year var yearInput = dialog.FindViewById (Resource.Id.yearInput) as TextView; var yearUp = dialog.FindViewById (Resource.Id.yearUp) as Button; var yearDown = dialog.FindViewById (Resource.Id.yearDown) as Button; yearUp.Tag = Resource.Id.yearInput; yearDown.Tag = Resource.Id.yearInput; yearUp.Click += Change_Date; yearDown.Click += Change_Date; var date = dateLabel.Text.Split ('/'); RunOnUiThread (() => { dayInput.Text = date [0]; monthInput.Text = date [1]; yearInput.Text = String.Format ("20{0}", date [2]); }); var btnOk = (Button)dialog.FindViewById(Resource.Id.button2); btnOk.Click += delegate { RunOnUiThread (() => dateLabel.Text = String.Format ("{0}/{1}/{2}", dayInput.Text, monthInput.Text, yearInput.Text.Substring (2))); dialog.Dismiss (); }; var btnCancel = (Button)dialog.FindViewById(Resource.Id.button1); btnCancel.Click += delegate { dialog.Cancel (); }; dialog.Show(); }