示例#1
0
        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);
        }
        private void LogoutStep2()
        {
            ModalPreviewDialog = new Dialog(this, Resource.Style.lightbox_dialog);
            ModalPreviewDialog.SetContentView(Resource.Layout.ModalLogoutModal2);
            if (scroller != null)
                scroller.Stop();
            killed = true;
            wowZapp.LaffOutOut.Singleton.DisableMessageTimer();
            wowZapp.LaffOutOut.Singleton.ReceivedMessages -= AppDelegate_ReceivedMessages;
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnMiddle)).Click += delegate
            {

                DismissModalPreviewDialog();
                LogoutWithClear(true);
            };
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnBottom)).Click += delegate
            {
                DismissModalPreviewDialog();
                LogoutWithClear(false);
            };
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnCancel)).Click += delegate
            {
                if (scroller != null)
                    scroller.Start();
                killed = false;
                wowZapp.LaffOutOut.Singleton.EnableMessageTimer();
                wowZapp.LaffOutOut.Singleton.ReceivedMessages += AppDelegate_ReceivedMessages;
                DismissModalPreviewDialog();
            };

            ModalPreviewDialog.Show();
        }
 public void ShowLightboxDialog(string message)
 {
     LightboxDialog = new Dialog (this, Resource.Style.lightbox_dialog);
     LightboxDialog.SetContentView (Resource.Layout.LightboxDialog);
     ((TextView)LightboxDialog.FindViewById (Resource.Id.dialogText)).Text = message;
     LightboxDialog.Show ();
 }
 public SimpleDialog(Activity a,string tip)
 {
     _progressDialog = new Dialog(a, Resource.Style.progress_dialog);
     _progressDialog.SetContentView(Resource.Layout.SimpleDialog);
     _progressDialog.SetCancelable(true);
     _progressDialog.Window.SetBackgroundDrawableResource(Android.Resource.Color.Transparent);
     TextView msg = (TextView)_progressDialog.FindViewById(Resource.Id.id_tv_loadingmsg);
     msg.Text = tip;
 }
示例#5
0
        private void DisplayModal(string message = "")
        {
            myDialog = new Dialog(this, Resource.Style.lightbox_dialog);
            myDialog.SetContentView(Resource.Layout.ModalView);
            ((TextView)myDialog.FindViewById(Resource.Id.txtMessage)).Text = message;
            var editName = myDialog.FindViewById<EditText>(Resource.Id.editName);
            var editSmell = myDialog.FindViewById<EditText>(Resource.Id.editSmell);
            var editColor = myDialog.FindViewById<EditText>(Resource.Id.editColour);
            var btnDone = myDialog.FindViewById<Button>(Resource.Id.btnDone);

            btnDone.Click += delegate
            {
                txtName.Text = editName.Text;
                txtColour.Text = editColor.Text;
                txtSmell.Text = editSmell.Text;
                myDialog.Dismiss();
            };

            RunOnUiThread(myDialog.Show);
        }
示例#6
0
		void TxtVersion_Click (object sender, EventArgs e)
		{
			Dialog dialog = new Dialog(this);
			dialog.SetContentView(Resource.Layout.CustomDialog);
			dialog.SetTitle("Giới thiệu");



			dialog.FindViewById<TextView> (Resource.Id.txt_d1).Text = UrlHelper.About();

			dialog.Show();
		}
        private void AddDevicesToFilterDialog(Dialog dialog)
        {
            var layout = dialog.FindViewById<LinearLayout> (Resource.Id.SelectDeviceLayout);
            foreach (Device dev in UserDevices) {
                ToggleButton listItem = CreateDeviceSelectionItem (dev);

                LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
                    LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent);
                layoutParams.SetMargins (5, 5, 5, 5);
                layoutParams.Height = 100;

                layout.AddView (listItem, layoutParams);
            }
        }
        //        protected override void OnCreate(Bundle bundle){
        //            base.OnCreate (bundle);
        //            SetContentView (Resource.Layout.AlertDialog);
        //
        //            Button bt = FindViewById<Button> (Resource.Id.button1);
        //
        //            bt.Click += delegate {
        //                CreateAddProjectDialog ();
        //            };
        //
        //            }
        /*
         *Klasa koja otvara prikaz povijesti placenih parkiranja.
         * */
        public static void CreateListDialog(Context context,List<string> lista)
        {
            Dialog dialog = new Dialog (context);
            dialog.SetContentView (Resource.Layout.DialogList);
            ListView lv = (ListView)dialog.FindViewById (Resource.Id.dialogList);
            //List<string> lista = new List<string> ();
            lv.Adapter = new ArrayAdapter<String> (context, Android.Resource.Layout.TestListItem, lista);
            dialog.Window.SetBackgroundDrawableResource (Android.Resource.Color.BackgroundDark);
            //dialog.Window.SetLayout(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
            //dialog.Window.RequestFeature(WindowFeatures.NoTitle);

            dialog.SetCancelable(true);
            dialog.SetTitle ("Povijest poruka.");
            dialog.Show();
        }
        private void btnLogout_Click(object s, EventArgs e)
        {
            ModalPreviewDialog = new Dialog(this, Resource.Style.lightbox_dialog);
            ModalPreviewDialog.SetContentView(Resource.Layout.ModalLogoutModal1);

            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnTop)).Click += delegate
            {
                DismissModalPreviewDialog();
                aboutUs();
            };
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnMiddle)).Click += delegate
            {
                DismissModalPreviewDialog();
            };
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnBottom)).Click += delegate
            {
                DismissModalPreviewDialog();
                LogoutStep2();
            };
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnUserProf)).Click += delegate
            {
                DismissModalPreviewDialog();
                Intent i = new Intent(this, typeof(Contacts.AboutMe));
                StartActivity(i);
            };
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnCancel)).Click += delegate
            {
                DismissModalPreviewDialog();
                if (scroller != null)
                    scroller.Start();
                wowZapp.LaffOutOut.Singleton.EnableMessageTimer();
                wowZapp.LaffOutOut.Singleton.ReceivedMessages += AppDelegate_ReceivedMessages;
            };

            ModalPreviewDialog.Show();
        }
示例#10
0
        void ShowProxySettings ()
        {
            dialog = new Dialog (this);
            dialog.SetContentView (Resource.Layout.Proxy);
            dialog.SetTitle ("Proxy Settings"); 
            dialog.SetCancelable (true);

            dialog.CancelEvent += DialogDismissHandler;

            Button btnProxySave = (Button)dialog.FindViewById (Resource.Id.btnProxySave);
            Button btnProxyCancel = (Button)dialog.FindViewById (Resource.Id.btnProxyCancel);

            btnProxySave.Click += EnableProxy; 
            btnProxyCancel.Click += DisableProxy;
            
            proxyUsername = (EditText)dialog.FindViewById (Resource.Id.proxyUsername);
            proxyPassword = (EditText)dialog.FindViewById (Resource.Id.proxyPassword);
            proxyServer = (EditText)dialog.FindViewById (Resource.Id.proxyServer);
            proxyPort = (EditText)dialog.FindViewById (Resource.Id.proxyPort);
            
            tgProxy = (ToggleButton)dialog.FindViewById (Resource.Id.tbProxy);
            tgProxy.CheckedChange += ProxyCheckedChanged;
            tgProxy.Checked = true;

            if (proxy != null) {
                tgProxy.Checked = true;
                tvProxy.Text = SetProxyText (true);
            } else {
                tgProxy.Checked = false;

                tvProxy.Text = SetProxyText (false);
            }

            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyServer))) {
                proxyServer.Text = proxy.ProxyServer;
            }
            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyPort.ToString ()))) {
                proxyPort.Text = proxy.ProxyPort.ToString ();
            }
            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyUserName))) {
                proxyUsername.Text = proxy.ProxyUserName;
            }
            if ((proxy != null) && (!string.IsNullOrEmpty (proxy.ProxyPassword))) {
                proxyPassword.Text = proxy.ProxyPassword;
            }

            dialog.Show ();
        }
        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 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();
		}
        private void AddNewUsers(List<User> users)
        {
            User user = new User();
            user = users [counter];
            #if DEBUG
            System.Diagnostics.Debug.WriteLine("Users to add : {0}", user.FirstName + " " + user.LastName);
            #endif

            RunOnUiThread(delegate
            {
                ModalNewContact = new Dialog(this, Resource.Style.lightbox_dialog);
                ModalNewContact.SetContentView(Resource.Layout.ModalNewContacts);

                ((Button)ModalNewContact.FindViewById(Resource.Id.btnAccept)).Click += delegate
                {
                    if (user.Picture.Length > 0)
                    {
                        Contacts.ContactsUtil.contactFilenames.Add(user.AccountID.ToString());
                        System.IO.File.WriteAllBytes(System.IO.Path.Combine(wowZapp.LaffOutOut.Singleton.ImageDirectory, user.AccountID.ToString()),
                                                      user.Picture);
                    }
                    DismissModalDialog();
                    counter++;
                    ContactDB contact = new ContactDB();
                    contact.Blocked = false;
                    contact.ContactAccountID = user.AccountID;
                    contact.OwnerAccountID = AndroidData.CurrentUser.AccountID;
                    contact.ContactUser = user;
                    contacts.Add(contact);
                    if (counter < users.Count)
                        AddNewUsers(users);
                    else
                    {
                        DismissModalDialog();
                        returnToSender();
                    }
                };
                ((Button)ModalNewContact.FindViewById(Resource.Id.btnDecline)).Click += delegate
                {
                    DismissModalDialog();
                    counter++;
                    if (counter < users.Count)
                        AddNewUsers(users);
                    else
                    {
                        DismissModalDialog();
                        returnToSender();
                    }
                };
                ((TextView)ModalNewContact.FindViewById(Resource.Id.txtContactName)).Text = user.FirstName + " " + user.LastName;
                modalImage = ((ImageView)ModalNewContact.FindViewById(Resource.Id.imgContact));
                if (Contacts.ContactsUtil.contactFilenames.Contains(user.AccountID.ToString()))
                {
                    Bitmap bm = BitmapFactory.DecodeFile(System.IO.Path.Combine(wowZapp.LaffOutOut.Singleton.ImageDirectory, user.AccountID.ToString()));
                    System.IO.MemoryStream ms = new System.IO.MemoryStream();
                    bm.Compress(Bitmap.CompressFormat.Jpeg, 80, ms);
                    byte[] img = ms.ToArray();
                    displayImage(img, modalImage);
                } else
                {
                    if (user.Picture.Length == 0)
                        RunOnUiThread(() => modalImage.SetBackgroundResource(Resource.Drawable.defaultuserimage));
                    else
                    {
                        if (user.Picture.Length == 0)
                        {
                            LOLConnectClient service = new LOLConnectClient(LOLConstants.DefaultHttpBinding, LOLConstants.LOLConnectEndpoint);
                            service.UserGetImageDataCompleted += Service_UserGetImageDataCompleted;
                            service.UserGetImageDataAsync(AndroidData.CurrentUser.AccountID, user.AccountID, new Guid(AndroidData.ServiceAuthToken));
                        } else
                        {
                            Bitmap bm = BitmapFactory.DecodeResource(this.Resources, Resource.Drawable.defaultuserimage);
                            System.IO.MemoryStream ms = new System.IO.MemoryStream();
                            bm.Compress(Bitmap.CompressFormat.Jpeg, 80, ms);
                            byte[] img = ms.ToArray();
                            displayImage(img, modalImage);
                        }
                    }
                }
                ModalNewContact.Show();
            });
        }
 private void AddEventToDialog(Dialog dialog)
 {
     var layout = dialog.FindViewById<LinearLayout> (Resource.Id.SelectDeviceLayout);
     foreach (Event eve in TowManager.Get(1)) {
         Button listItem = CreateEventItem (eve);
         LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
             LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent);
         layoutParams.SetMargins (5, 5, 5, 5);
         layoutParams.Height = 100;
         layout.AddView (listItem, layoutParams);
     }
 }
示例#15
0
		public override bool OnOptionsItemSelected (IMenuItem item)
		{	
			base.OnOptionsItemSelected (item);
			dialog = new Dialog(this, Resource.Style.CustomDialogThemeTrasparent); 
			dialog.SetContentView (Resource.Layout.dialog);
			dialogButton = (Button) dialog.FindViewById (Resource.Id.BuildRoute);
			textview = (TextView) dialog.FindViewById (Resource.Id.textviewdialog);
			radioGroup = (RadioGroup) dialog.FindViewById (Resource.Id.radioGroupdialog);
			waitTextView = (TextView) dialog.FindViewById (Resource.Id.textwaitdialog);
			dialog.Show();

			radioAll = dialog.FindViewById<RadioButton> (Resource.Id.allPointRoute);
			radioRedRoute = dialog.FindViewById<RadioButton> (Resource.Id.redRoute);
			radioGreenRoute = dialog.FindViewById<RadioButton> (Resource.Id.greenRoute);
			radioYellowRoute = dialog.FindViewById<RadioButton> (Resource.Id.yellowRoute);



			radioAll.Click += RadioButtonClick;
			radioRedRoute.Click += RadioButtonClick;
			radioGreenRoute.Click += RadioButtonClick;
			radioYellowRoute.Click += RadioButtonClick;
			dialogButton.Click += DialogButtonClick;
			return true;
		}
示例#16
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.dialog);

            // Normal Dialog
            Button mbtnAlert = FindViewById<Button> (Resource.Id.btnDialog);
            mbtnAlert.Click += delegate
            {
                new AlertDialog.Builder(this)
                    .SetTitle("Alert!")
                        .SetMessage("This is the content of the alert")
                        .SetPositiveButton("Ok", delegate
                                           {
                            Toast.MakeText(this, "Clicked ok", ToastLength.Short).Show();
                        })
                        .SetNegativeButton("Cancel", delegate
                                           {
                            Toast
                                .MakeText(this, "Clicked cancel", ToastLength.Short)
                                    .Show();
                        })
                        .Show();
            };

            //Progress Dialog
            Button mbtnProgress = FindViewById<Button>(Resource.Id.btnProgress);
            mbtnProgress.Click += delegate
            {
                ProgressDialog progressDialog = ProgressDialog.Show(this, "Running", "Please wait...", true);

                new Thread(new ThreadStart(delegate
                                           {
                    Thread.Sleep(5000);

                    RunOnUiThread(() => progressDialog.Hide());
                })).Start();
            };

            //Custom Dialog
            Button mbtnCustom = FindViewById<Button> (Resource.Id.btnCustom);
            mbtnCustom.Click += delegate
            {
                Dialog dialog = new Dialog(this);
                dialog.SetContentView(Resource.Layout.custom_dialog);
                dialog.SetTitle("This is a custom dialog");
                dialog.SetCancelable(true);
                EditText input = (EditText) dialog.FindViewById (Resource.Id.editTextD);
                TextView txtv = (TextView)dialog.FindViewById(Resource.Id.textView1);
                Button btnOk = (Button)dialog.FindViewById(Resource.Id.btnOk);
                btnOk.Click += delegate
                {
                    if (input.Text.Length>0){
                        Toast.MakeText(this, input.Text, ToastLength.Short).Show();
                    } else {
                        Toast.MakeText(this, "Clicked ok", ToastLength.Short).Show();
                    }

                    dialog.Cancel();
                };
                Button btnCancel = (Button)dialog.FindViewById(Resource.Id.btnCancel);
                btnCancel.Click += delegate
                {
                    dialog.Cancel();
                };

                dialog.Show();
            };

            Button mbackBtn = FindViewById<Button> (Resource.Id.BackBtn5);
            mbackBtn.Click += delegate
            {
                Finish();
            };
        }
示例#17
0
        protected override Dialog OnCreateDialog(int id)
        {
            //return base.OnCreateDialog (id);
            switch (id) {
            case DLG_WORK_TIME_WARNING:
                Dialog dialog = new Dialog (this);
                dialog.SetTitle ("Предупреждение");
                dialog.SetContentView (Resource.Layout.Dialog);
                dialog.FindViewById <Button> (Resource.Id.btnDlgClose).Click += (object sender, EventArgs e) => {
                    this.Finish();
                };

                dialog.SetCancelable (false);
                return dialog;
            }
            return null;
        }
示例#18
0
 /// <summary>
 /// Snaps the specified view in the dialog.
 /// </summary>
 /// <param name="dialog">The dialog.</param>
 /// <param name="resourceId">The resource identifier.</param>
 /// <returns>The screenshot bitmap.</returns>
 public static Bitmap Snap(Dialog dialog, int resourceId)
 {
     return Snap(dialog.FindViewById(resourceId));
 }
        private void ShowModalPreviewDialog(int itemId)
        {
            isPreview = true;
            ProgressBar pb = null;
            ImageButton ib = null;
            ModalPreviewDialog = new Dialog(this, Resource.Style.lightbox_dialog);
            if (packType == LOLCodeLibrary.GenericEnumsContentPackType.Emoticon)
            {
                ModalPreviewDialog.SetContentView(Resource.Layout.ModalPreviewGIFDialog);
                if (wowZapp.LaffOutOut.Singleton.resizeFonts)
                {
                    layouts [0] = ((LinearLayout)ModalPreviewDialog.FindViewById(Resource.Id.linearLayout1));
                    layouts [1] = ((LinearLayout)ModalPreviewDialog.FindViewById(Resource.Id.linearLayout2));
                    layouts [3] = ((LinearLayout)ModalPreviewDialog.FindViewById(Resource.Id.linearLayout3));
                    layouts [2] = ((LinearLayout)ModalPreviewDialog.FindViewById(Resource.Id.linearLayout4));
                    previewWebImage = ((WebView)ModalPreviewDialog.FindViewById(Resource.Id.webPreview));
                }
                ((WebView)ModalPreviewDialog.FindViewById(Resource.Id.webPreview)).VerticalScrollBarEnabled = false;
                ((WebView)ModalPreviewDialog.FindViewById(Resource.Id.webPreview)).HorizontalScrollBarEnabled = false;
                ((WebView)ModalPreviewDialog.FindViewById(Resource.Id.webPreview)).LoadDataWithBaseURL(null,
                "<body style=\"margin:0;padding:0;background:#8e8f8f;\"><div style=\"margin:10px;\">Loading...</div></body>", "text/html", "UTF-8", null);
                LOLConnectClient connect = new LOLConnectClient(LOLConstants.DefaultHttpBinding, LOLConstants.LOLConnectEndpoint);
                connect.ContentPackItemGetDataCompleted += new EventHandler<ContentPackItemGetDataCompletedEventArgs>(connect_ContentPackItemGetDataCompleted);
                connect.ContentPackItemGetDataAsync(result [itemId].ContentPackItemID, ContentPackItem.ItemSize.Small, AndroidData.CurrentUser.AccountID, new Guid(AndroidData.ServiceAuthToken));
            } else
            {
                ModalPreviewDialog.SetContentView(Resource.Layout.ModalPreviewDialog);
                pb = ((ProgressBar)ModalPreviewDialog.FindViewById(Resource.Id.timerBar));
                ib = ((ImageButton)ModalPreviewDialog.FindViewById(Resource.Id.playButton));
                if (packType != LOLCodeLibrary.GenericEnumsContentPackType.Comicon && packType != LOLCodeLibrary.GenericEnumsContentPackType.SoundFX)
                    pb.Visibility = ib.Visibility = ViewStates.Invisible;
                else
                    ib.Click += delegate
                    {
                        playAudio(pb, packType);
                    };

                if (wowZapp.LaffOutOut.Singleton.resizeFonts)
                {
                    layouts [0] = ((LinearLayout)ModalPreviewDialog.FindViewById(Resource.Id.linearLayout1));
                    layouts [1] = ((LinearLayout)ModalPreviewDialog.FindViewById(Resource.Id.linearLayout2));
                    layouts [3] = ((LinearLayout)ModalPreviewDialog.FindViewById(Resource.Id.linearLayout3));
                    layouts [2] = ((LinearLayout)ModalPreviewDialog.FindViewById(Resource.Id.linearLayout4));
                    previewImage = ((ImageView)ModalPreviewDialog.FindViewById(Resource.Id.imgItemPic));
                }
                using (MemoryStream stream = new MemoryStream (result [itemId].ContentPackItemIcon))
                {
                    using (Android.Graphics.Drawables.Drawable draw = Android.Graphics.Drawables.Drawable.CreateFromStream (stream, "Profile"))
                    {
                        ((ImageView)ModalPreviewDialog.FindViewById(Resource.Id.imgItemPic)).SetImageDrawable(draw);
                    }
                }
            }

            ((TextView)ModalPreviewDialog.FindViewById(Resource.Id.txtItemTitle)).Text = result [itemId].ContentItemTitle;

            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnAdd)).Click += delegate
            {
                if (!isAnimation)
                {
                    MessageStep msgStep = new MessageStep();
                    switch (packType)
                    {
                        case LOLCodeLibrary.GenericEnumsContentPackType.Comicon:
                            msgStep.StepType = MessageStep.StepTypes.Comicon;
                            break;
                        case LOLCodeLibrary.GenericEnumsContentPackType.Comix:
                            msgStep.StepType = MessageStep.StepTypes.Comix;
                            break;
                        case LOLCodeLibrary.GenericEnumsContentPackType.Emoticon:
                            msgStep.StepType = MessageStep.StepTypes.Emoticon;
                            break;
                        case LOLCodeLibrary.GenericEnumsContentPackType.SoundFX:
                            msgStep.StepType = MessageStep.StepTypes.SoundFX;
                            break;
                    }
                    ComposeMessageMainUtil.contentPackID [currentStep] = msgStep.ContentPackItemID = ContentPackItemsUtil.contentPackItemID = result [itemId].ContentPackItemID;

                    if (currentStep > ComposeMessageMainUtil.msgSteps.Count)
                    {
                        msgStep.StepNumber = ComposeMessageMainUtil.msgSteps.Count + 1;
                        ComposeMessageMainUtil.msgSteps.Add(msgStep);

                    } else
                    {
                        msgStep.StepNumber = currentStep;
                        ComposeMessageMainUtil.msgSteps [currentStep - 1] = msgStep;
                    }

                    ContentPackItemsUtil.content = result [itemId].ContentPackItemIcon;
                    if (currentStep == 1)
                    {
                        DismissModalPreviewDialog();
                        isSet = true;
                        sendBack();
                    } else
                    {
                        DismissModalPreviewDialog();
                        isSet = true;
                        isPreview = false;
                        sendBack();
                    }
                } else
                {
                    DismissModalPreviewDialog();
                    isSet = true;
                    sendBack();
                }
            };
            ((Button)ModalPreviewDialog.FindViewById(Resource.Id.btnCancel)).Click += delegate
            {
                DismissModalPreviewDialog();
            };

            ModalPreviewDialog.Show();

            if (packType == LOLCodeLibrary.GenericEnumsContentPackType.Comicon ||
                packType == LOLCodeLibrary.GenericEnumsContentPackType.SoundFX)
            {
                LOLConnectClient connect = new LOLConnectClient(LOLConstants.DefaultHttpBinding, LOLConstants.LOLConnectEndpoint);
                connect.ContentPackItemGetDataCompleted += new EventHandler<ContentPackItemGetDataCompletedEventArgs>(connect_ContentPackItemGetDataCompleted);
                connect.ContentPackItemGetDataAsync(result [itemId].ContentPackItemID, ContentPackItem.ItemSize.Small, AndroidData.CurrentUser.AccountID, new Guid(AndroidData.ServiceAuthToken));
            }
        }
示例#20
0
        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();
        }
 private void StrokeStyleDialog()
 {
     var dialog = new Dialog(this);
     dialog.SetTitle("Stroke Style");
     dialog.SetContentView(Resource.Layout.stroke_width);
     var theSpinner = (Spinner)dialog.FindViewById(Resource.Id.StrokeWidth);
     theSpinner.Adapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, Resources.GetStringArray(Resource.Array.stroke_styles));
     dialog.FindViewById(Resource.Id.StrokeOkButton).Click += (sender, args) =>
         {
             var cap = theSpinner.GetItemAtPosition(theSpinner.SelectedItemPosition).ToString();
             switch (cap)
             {
                 case "stroke":
                     m_SignatureCapture.StrokeStyle = StrokeStyle.Stroke;
                     break;
                 case "fill":
                     m_SignatureCapture.StrokeStyle = StrokeStyle.Fill;
                     break;
                 case "fill+stroke":
                     m_SignatureCapture.StrokeStyle = StrokeStyle.FillAndStroke;
                     break;
             }
             dialog.Dismiss();
         };
     dialog.Show();
 }
示例#22
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            SetContentView (Resource.Layout.Menu);
            iniView ();
            Button ajout = FindViewById<Button> (Resource.Id.ajouttournee);

            //TEST
            //editText = FindViewById<EditText>(Resource.Id.passwordfield);

            bodyListView = FindViewById<ListView> (Resource.Id.bodylist);
            bodyItems = new List<TablePosition> ();

            adapter = new ListViewAdapterMenu (this, bodyItems);
            bodyListView.Adapter = adapter;

            initListView ("SELECT * FROM TablePosition");

            ajout.Click += delegate {
                Dialog dialog = new Dialog (this);
                dialog.Window.RequestFeature (WindowFeatures.NoTitle);
                dialog.Window.SetBackgroundDrawableResource (Resource.Drawable.bktransbox);
                dialog.SetContentView (Resource.Layout.Boxajout);
                Button cree = dialog.FindViewById<Button> (Resource.Id.btn_cree);
                EditText codeeditText = dialog.FindViewById<EditText> (Resource.Id.codetournee);
                cree.Click += delegate {
                    ShowProgress (progress => AndHUD.Shared.Show (this, "Création... " + progress + "%", progress, MaskType.Clear));
                    Thread thread = new Thread (() => CreateVoyage (codeeditText.Text));
                    thread.Start ();
                    while (thread.IsAlive) {
                        iniView ();
                    }
                    dialog.Dismiss ();
                };
                cree.LongClick += delegate {
                    DBRepository dbr = new DBRepository ();
                    dbr.DropTableStatut ();
                    initListView("SELECT * FROM TablePosition");
                    iniView ();
                };
                dialog.SetCancelable (true);
                dialog.Show ();
            };

            //SIMULATION D'insert
            Button btntest = FindViewById<Button> (Resource.Id.nomtournee);
            btntest.Click += delegate {
                ShowProgressInsert (progress => AndHUD.Shared.Show (this, "Insertion ... " + progress + "%", progress, MaskType.Clear));
                Thread threadinsert = new Thread (() => GetPosData ("1406026994"));
                threadinsert.Start ();

                //GetPosData (stringbuilder.ToString());

            };
        }
        private void LaunchImagePicker(int step)
        {
            selectDialog = new Dialog (this, Resource.Style.lightbox_dialog);
            selectDialog.SetContentView (Resource.Layout.ModalPoll);
            Photoalbums.PhotoPickerUtil.position = step - 1;
            ((Button)selectDialog.FindViewById (Resource.Id.btnTop)).Click += delegate {
                DismissModalPreviewDialog ();
                ImagePicker (step);
            };

            ((Button)selectDialog.FindViewById (Resource.Id.btnMiddle)).Click += delegate {
                DismissModalPreviewDialog ();
                Intent cameraIntent = new Intent (this, typeof(CameraVideo.CameraTakePictureActivity));
                StartActivityForResult (cameraIntent, step);
            };

            ((Button)selectDialog.FindViewById (Resource.Id.btnBottom)).Click += delegate {
                DismissModalPreviewDialog ();
                ModalPreviewDialog = new Dialog (this, Resource.Style.lightbox_dialog);
                ModalPreviewDialog.SetContentView (Resource.Layout.ModalOnlineSelector);
                ModalPreviewDialog.Show ();
                ((ImageView)ModalPreviewDialog.FindViewById (Resource.Id.imgItemPic)).Click += delegate {
                    RunOnUiThread (() => DismissLightboxDialog ());
                    Intent i = new Intent (this, typeof(Photoalbums.GetPhotoAlbumActivity));
                    i.PutExtra ("media", false);
                    i.PutExtra ("network", 3);
                    Photoalbums.PhotoPickerUtil.fromWhere = 1;
                    StartActivityForResult (i, step);
                };
            };

            ((Button)selectDialog.FindViewById (Resource.Id.btnCancel)).Click += delegate {
                DismissModalPreviewDialog ();
            };

            selectDialog.Show ();
        }
        private void doTheAdding(List<User>contacts)
        {
            foreach (User user in contacts) {
                RunOnUiThread (delegate {
                    ModalNewContact = new Dialog (this, Resource.Style.lightbox_dialog);
                    ModalNewContact.SetContentView (Resource.Layout.ModalNewContact);

                    ((Button)ModalNewContact.FindViewById (Resource.Id.btnAccept)).Click += delegate {
                        if (user.Picture.Length > 0) {
                            Contacts.ContactsUtil.contactFilenames.Add (user.AccountID.ToString ());
                            File.WriteAllBytes (System.IO.Path.Combine (wowZapp.LaffOutOut.Singleton.ImageDirectory, user.AccountID.ToString ()), user.Picture);
                        }
                        dbm.InsertOrUpdateUser (user);
                        DismissModalDialog ();
                    };
                    ((Button)ModalNewContact.FindViewById (Resource.Id.btnDecline)).Click += delegate {
                        DismissModalDialog ();
                    };
                    ((TextView)ModalNewContact.FindViewById (Resource.Id.txtContactName)).Text = user.FirstName + " " + user.LastName;
                    ImageView image = ((ImageView)ModalNewContact.FindViewById (Resource.Id.imgContact));
                    if (user.Picture.Length == 0)
                        image.SetBackgroundResource (Resource.Drawable.defaultuserimage);
                    else {
                        Bitmap bm = BitmapFactory.DecodeResource (this.Resources, Resource.Drawable.defaultuserimage);
                        MemoryStream ms = new MemoryStream ();
                        bm.Compress (Bitmap.CompressFormat.Jpeg, 80, ms);
                        byte[] img = ms.ToArray ();
                        displayImage (img, image);
                    }

                    ModalNewContact.Show ();
                });
            }

            DismissModalDialog ();
        }
示例#25
0
        public void TwitterPermissions()
        {
            if (!twitterBox.Checked)
                return;

            ISharedPreferences prefs = GetSharedPreferences(Global.PREFS_NAME, 0);
            string AccountName = prefs.GetString ("TwitterName", "");

            Dialog dialog = new Dialog(this);
            dialog.SetContentView(Resource.Layout.TwitterPopup);
            EditText twitterNameBox = (EditText)dialog.FindViewById(Resource.Id.twitterNameBox);
            twitterNameBox.Text = AccountName;
            dialog.SetTitle("Twitter");
            dialog.SetCancelable(false);

            dialog.FindViewById(Resource.Id.twitterCancel).Click += delegate {
                twitterBox.Checked = false;
                dialog.Dismiss();
            };
            dialog.FindViewById(Resource.Id.twitterConfirm).Click += delegate {
                AccountName = twitterNameBox.Text;
                ISharedPreferencesEditor editor = prefs.Edit ();
                editor.PutString("TwitterName", AccountName);
                editor.Commit();
                dialog.Dismiss();
                Log.Debug ( TAG, AccountName );
            };
            dialog.Show();
        }
        private void showParticipants(object s, EventArgs e, List<UserDB> contacts)
        {
            contactsDialog = new Dialog (this, Resource.Style.lightbox_dialog);
            contactsDialog.SetContentView (Resource.Layout.ModalContactsConversation);
            LinearLayout mainLayout = ((LinearLayout)contactsDialog.FindViewById (Resource.Id.contactMainLayout));
            Context localContext = mainLayout.Context;
            List<Guid> profilePicsToBeGrabbed = new List<Guid> ();
            RunOnUiThread (delegate {
                for (int n = 0; n < contacts.Count; n++) {
                    LinearLayout layout = new LinearLayout (context);
                    layout.Orientation = Android.Widget.Orientation.Horizontal;
                    layout.LayoutParameters = new ViewGroup.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent);
                    layout.SetPadding ((int)ImageHelper.convertDpToPixel (20f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), (int)ImageHelper.convertDpToPixel (10f, context));

                    ImageView profilepic = new ImageView (context);
                    profilepic.LayoutParameters = new ViewGroup.LayoutParams ((int)ImageHelper.convertDpToPixel (60f, context), (int)ImageHelper.convertDpToPixel (60f, context));
                    profilepic.Tag = new Java.Lang.String ("profilepic_" + contacts [n].AccountID);
                    if (contacts [n].HasProfileImage == true && contacts [n].Picture.Length == 0) {
                        profilePicsToBeGrabbed.Add (contacts [n].AccountID);
                    } else {
                        if (contacts [n].Picture.Length > 0)
                            LoadUserImage (contacts [n], profilepic);
                        else
                            profilepic.SetImageDrawable (Application.Context.Resources.GetDrawable (Resource.Drawable.defaultuserimage));
                    }
                    layout.AddView (profilepic);

                    TextView text = new TextView (context);
                    text.LayoutParameters = new ViewGroup.LayoutParams ((int)ImageHelper.convertDpToPixel (235f, context), (int)ImageHelper.convertDpToPixel (40f, context));
                    text.SetPadding ((int)ImageHelper.convertDpToPixel (10f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), 0);
                    text.Gravity = GravityFlags.CenterVertical;
                    text.TextSize = 16f;
                    text.SetTextColor (Android.Graphics.Color.White);
                    if (contacts [n].FirstName != "" || contacts [n].LastName != "") {
                        text.Text = contacts [n].FirstName + " " + contacts [n].LastName;
                    } else {
                        text.Text = contacts [n].EmailAddress;
                    }
                    layout.AddView (text);

                    mainLayout.AddView (layout);
                }
            });
            ((Button)contactsDialog.FindViewById (Resource.Id.btnCancel)).Click += delegate {
                DismissModalPreviewDialog ();
            };

            if (profilePicsToBeGrabbed.Count > 0) {
                cpUI = 0;
                LOLConnectClient service = new LOLConnectClient (LOLConstants.DefaultHttpBinding, LOLConstants.LOLConnectEndpoint);
                service.UserGetImageDataCompleted += Service_UserGetImageDataCompleted;
                service.UserGetImageDataAsync (AndroidData.CurrentUser.AccountID, profilePicsToBeGrabbed [0], new Guid (AndroidData.ServiceAuthToken));
            }

            contactsDialog.Show ();
        }
        private void ShowModalPreviewDialog(string imgUrl)
        {
            previewDialog = new Dialog (this, Resource.Style.lightbox_dialog);
            previewDialog.SetContentView (Resource.Layout.ModalLargePreviewDialog);

            //string imgUrl = photoList[item].SmallUrl;
            byte[] imgBuff = null;
            ThreadPool.QueueUserWorkItem (delegate {

                try {
                    RunOnUiThread (delegate {
                        imgBuff = PhotoPickerUtil.Provider.GetImage (imgUrl);
                        using (MemoryStream stream = new MemoryStream (imgBuff)) {
                            Android.Graphics.Drawables.Drawable draw = Android.Graphics.Drawables.Drawable.CreateFromStream (stream, "Preview");
                            ((ImageView)previewDialog.FindViewById (Resource.Id.imgItemPic)).SetImageDrawable (draw);
                        }
                    });
                } catch (Exception ex) {
                    #if DEBUG
                    System.Diagnostics.Debug.WriteLine ("Error downloading image {0}. Message {1}-{2}", imgUrl, ex.Message, ex.StackTrace);
                    #endif
                }
            });

            ((Button)previewDialog.FindViewById (Resource.Id.btnAdd)).Click += delegate {
                string filename = Path.GetRandomFileName ();
                filename = Path.Combine (wowZapp.LaffOutOut.Singleton.ContentDirectory, filename);
                File.WriteAllBytes (filename, imgBuff);
                PhotoPickerUtil.names.Insert (PhotoPickerUtil.position, filename);
                EndThis (true);
            };

            ((Button)previewDialog.FindViewById (Resource.Id.btnCancel)).Click += delegate {
                RunOnUiThread (() => DismissModalPreviewDialog ());
                EndThis ();
            };

            previewDialog.Show ();
        }
 private void StrokeWidthDialog()
 {
     var dialog = new Dialog(this);
     dialog.SetTitle("Stroke Width");
     dialog.SetContentView(Resource.Layout.stroke_width);
     var theSpinner = (Spinner) dialog.FindViewById(Resource.Id.StrokeWidth);
     theSpinner.Adapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, Resources.GetStringArray(Resource.Array.stroke_widths));
     dialog.FindViewById(Resource.Id.StrokeOkButton).Click += (sender, args) =>
         {
             var strokeWidth = theSpinner.GetItemAtPosition(theSpinner.SelectedItemPosition);
             m_SignatureCapture.StrokeWidth = int.Parse(strokeWidth.ToString());
             dialog.Dismiss();
         };
     dialog.Show();
 }
        /// <summary>
        /// Open ShowSearchDialog
        /// </summary>
        private void ShowSearchDialog()
        {
            //Create a dialog box without any title
            searchDialog = new Dialog(this, Android.Resource.Style.ThemeDeviceDefaultDialogNoActionBar);
            searchDialog.SetContentView(Resource.Layout.SearchAlertBox);

            var btnSearch = (Button)searchDialog.FindViewById(Resource.Id.btnSearch);

            txtSearch = (EditText)searchDialog.FindViewById(Resource.Id.txtSearch);

            btnSearch.Click += btnSearch_Click;

            //Show Dialogbox
            searchDialog.Show();
        }
 private void StrokeJoinDialog()
 {
     var dialog = new Dialog(this);
     dialog.SetTitle("Stroke Join");
     dialog.SetContentView(Resource.Layout.stroke_width);
     var theSpinner = (Spinner)dialog.FindViewById(Resource.Id.StrokeWidth);
     theSpinner.Adapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleListItem1, Resources.GetStringArray(Resource.Array.stroke_joins));
    
     dialog.FindViewById(Resource.Id.StrokeOkButton).Click += (sender, args) =>
         {
             var cap = theSpinner.GetItemAtPosition(theSpinner.SelectedItemPosition).ToString();
             switch (cap)
             {
                 case "round":
                     m_SignatureCapture.StrokeJoin = StrokeJoin.Round;
                     break;
                 case "miter":
                     m_SignatureCapture.StrokeJoin = StrokeJoin.Miter;
                     break;
                 case "bevel":
                     m_SignatureCapture.StrokeJoin = StrokeJoin.Bevel;
                     break;
             }
             dialog.Dismiss();
         };
     dialog.Show();
 }
示例#31
0
 public Popup(Activity activity)
 {
     Dialog = new Dialog(activity);
      			Dialog.SetContentView(Resource.Layout.Popup);//popup view is the layout you created
     Text1 = (TextView)Dialog.FindViewById(Resource.Id.mbtext1);
     Text2 = (TextView)Dialog.FindViewById(Resource.Id.mbtext2);
     Button4=(Button)Dialog.FindViewById(Resource.Id.mbbtn4);
     Button3=(Button)Dialog.FindViewById(Resource.Id.mbbtn3);
     Button1=(Button)Dialog.FindViewById(Resource.Id.mbbtn1);
     Button2=(Button)Dialog.FindViewById(Resource.Id.mbbtn2);
     CheckBoxSave = (CheckBox)Dialog.FindViewById(Resource.Id.checksave);
     CheckBoxSaveText=(TextView)Dialog.FindViewById(Resource.Id.chvsave);
     Edit1=(EditText)Dialog.FindViewById(Resource.Id.mbedit1);
     Edit2=(EditText)Dialog.FindViewById(Resource.Id.mbedit2);
     ProgressBar=(ProgressBar)Dialog.FindViewById(Resource.Id.mbpbar);
 }