Exemplo n.º 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);
        }
        public void DismissModalPreviewDialog()
        {
            if (contactsDialog != null)
                contactsDialog.Dismiss ();

            contactsDialog = null;
        }
Exemplo n.º 3
0
        protected override void OnResume()
        {
            base.OnResume();
            Task startupWork = new Task(() =>
            {
                Thread.Sleep(SplashTimeOut);
            });

            startupWork.ContinueWith(t =>
            {
                if (IsConnecting() == true)
                {
                    var prefs          = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                    string UserName    = prefs.GetString("LoginUserName", null);
                    string Password    = prefs.GetString("Password", null);
                    string tokenValue  = prefs.GetString("Access_Token", null);
                    string userID      = prefs.GetString("UserID", null);
                    bool RegisterEmail = prefs.GetBoolean("RegisterEmail", false);
                    bool RegisterPhone = prefs.GetBoolean("RegisterPhone", false);

                    if (!string.IsNullOrEmpty(UserName) && !string.IsNullOrEmpty(Password))
                    {
                        if (RegisterEmail == true)
                        {
                            StartActivity(new Intent(Application.Context, typeof(AddUserName)));
                            return;
                        }
                        else
                        if (RegisterEmail == true)
                        {
                            StartActivity(new Intent(Application.Context, typeof(AddUserName)));
                            return;
                        }
                        else
                        {
                            new LogInWeClip(UserName, Password, this).Execute();
                        }
                    }
                    else
                    {
                        StartActivity(new Intent(Application.Context, typeof(LoginActivity)));
                    }
                }
                else
                {
                    Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                    alert.SetInverseBackgroundForced(true);
                    alert.SetTitle("No Internet connection");
                    alert.SetMessage("Check your Internet connection");
                    alert.SetPositiveButton("CLOSE", (senderAlert, args) =>
                    {
                        alert.Dispose();
                        this.Finish();
                    });
                    Android.App.Dialog dialog = alert.Create();
                    dialog.Show();
                }
            }, TaskScheduler.FromCurrentSynchronizationContext());
            startupWork.Start();
        }
Exemplo n.º 4
0
		public void HideProgressDialog ()
		{
			if (_dialog != null) {
				_dialog.Hide ();
				_dialog = null;
			}
		}
        public void DismissLightboxDialog()
        {
            if (LightboxDialog != null)
                LightboxDialog.Dismiss ();

            LightboxDialog = null;
        }
 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 void DismissModalPreviewDialog()
        {
            if (previewDialog != null)
                previewDialog.Dismiss ();

            previewDialog = null;
        }
 public void DismissModalPreviewDialog()
 {
     if (ModalPreviewDialog != null)
         ModalPreviewDialog.Dismiss();
     isPreview = false;
     ModalPreviewDialog = null;
 }
Exemplo n.º 9
0
        private void aboutUs()
        {
            ModalPreviewDialog = new Dialog (this, Resource.Style.lightbox_dialog);
            ModalPreviewDialog.SetContentView (Resource.Layout.ModalAboutUsCompany);
            string [] company = Resources.GetStringArray (Resource.Array.aboutusTrendaAddress);
            string [] spork = Resources.GetStringArray (Resource.Array.aboutusSpork);
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textCompany1)).Text = company [0];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textCompany2)).Text = company [1];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textCompany3)).Text = company [2];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textCompany4)).Text = company [3];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textDevelop1)).Text = spork [0];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textDevelop2)).Text = spork [1];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textDevelop3)).Text = spork [2];
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textDevelop4)).Text = spork [3];

            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textPublishDate)).Text = wowZapp.LaffOutOut.Singleton.Published;
            ((TextView)ModalPreviewDialog.FindViewById (Resource.Id.textVersion)).Text = wowZapp.LaffOutOut.Singleton.Version;

            ((Button)ModalPreviewDialog.FindViewById (Resource.Id.btnDevs)).Click += delegate {
                DismissModalPreviewDialog ();
                showDevs ();
            };
            ((Button)ModalPreviewDialog.FindViewById (Resource.Id.btnClose)).Click += delegate {
                DismissModalPreviewDialog ();
                scroller.Start ();
                wowZapp.LaffOutOut.Singleton.EnableMessageTimer ();
                wowZapp.LaffOutOut.Singleton.ReceivedMessages += AppDelegate_ReceivedMessages;
            };

            ModalPreviewDialog.Show ();
        }
Exemplo n.º 10
0
		public void showNoticeDialog(string title, string content){
			var noticeASAPTimeView = LayoutInflater.Inflate (Resource.Layout.popup_notice_layout, null);
			var tvTitle = noticeASAPTimeView.FindViewById<TextView> (Resource.Id.tv_title_notice_popup);
			var tvNotice = noticeASAPTimeView.FindViewById<TextView> (Resource.Id.tv_info_popup_notice);
			var btnOk = noticeASAPTimeView.FindViewById<Button> (Resource.Id.btn_ok_popup_notice);

			tvTitle.Text = title;
			tvNotice.Text = content;
			btnOk.Click += (sender, e) => {
				dialog.Dismiss ();
				if(noticeBeta != null){
					noticeBeta.onOK();
				}
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (noticeASAPTimeView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			dialog.SetCancelable (false);
			try {
				dialog.Show ();
			} catch(Exception e){
				Console.WriteLine (e.Message);
			}
		}
Exemplo n.º 11
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.Splash);
			new Handler ().PostDelayed (() => {
				//LoadActivity();
				var updateManager = new UpdateManager(this,true);
				if (updateManager.CheckUpdate())
				{
					var builder = new AlertDialog.Builder (this).SetTitle ("软件升级").SetMessage ("发现新版本,建议更新使用新版本").SetOnKeyListener(this).SetCancelable(false);
					builder.SetPositiveButton ("下载", (sender, e) => {
						noticeDialog.Dismiss();	
						//显示下载对话框,下载
						updateManager.ShowDownloadDialog();
					});
					builder.SetNegativeButton ("以后再说", (sender, e) => {
						noticeDialog.Dismiss();	
						LoadActivity();
					});
					noticeDialog= builder.Create ();
					noticeDialog.Show();
				}
				else
				{
					LoadActivity();
				}
			},2000);
		
			// Create your application here
		}
        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();
        }
        protected void ShowExitDialog()
        {
            Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);
            alert.SetTitle("Exit");
            alert.SetMessage("Stop tracking and close application?");
            alert.SetPositiveButton("Yes", (senderAlert, args) =>
            {
                try
                {
                    if (AppWrapper.ServiceIntent != null)
                    {
                        StopService(AppWrapper.ServiceIntent);
                    }

                    AppWrapper.ServiceIntent = null;

                    System.Environment.Exit(0);
                }
                catch (Exception ex)
                {
                    Toast.MakeText(this, "Exit operation error: " + ex.ToString(), ToastLength.Short).Show();
                }
            });
            alert.SetNegativeButton("Cancel", (senderAlert, args) =>
            {
            });

            Android.App.Dialog dialog = alert.Create();
            dialog.Show();
        }
Exemplo n.º 14
0
		public void showConfirmDialog(string title, string content, string possitiveTitle, string negativeTitle){
			var confirmDeferView = LayoutInflater.Inflate (Resource.Layout.popup_confirm_layout, null);
			var tvTitle = confirmDeferView.FindViewById<TextView> (Resource.Id.tv_title_confirm_popup);
			var tvConfirm = confirmDeferView.FindViewById<TextView> (Resource.Id.tv_info_popup);
			var btnConfirmTalknow = confirmDeferView.FindViewById<Button> (Resource.Id.btn_confirm_tv_popup);
			var btnDecline = confirmDeferView.FindViewById<Button> (Resource.Id.btn_decline_tv_popup);

			tvTitle.Text = title;
			tvConfirm.Text = content;
			btnDecline.Text = negativeTitle;
			btnConfirmTalknow.Text = possitiveTitle;
			btnConfirmTalknow.Click += (sender, e) => {
				dialog.Dismiss ();
				actionConfirmDelegate.onOkConfirmClick ();
			};

			btnDecline.Click += (sender, e) => {
				dialog.Dismiss ();
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetInverseBackgroundForced (true);
			builder.SetView (confirmDeferView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			try {
				dialog.Show ();
			} catch(Exception e){
				Console.WriteLine (e.Message);
			}
		}
Exemplo n.º 15
0
		public void showEmailDialog(Guid specId){
			var enterEmailView = LayoutInflater.Inflate (Resource.Layout.popup_enter_email, null);

			var edEnterEmail = enterEmailView.FindViewById<EditText> (Resource.Id.edit_enter_email);
			var edMyEmail = enterEmailView.FindViewById<EditText> (Resource.Id.edit_my_email);
			var edMessEmail = enterEmailView.FindViewById<EditText> (Resource.Id.edit_enter_message);
			var btnSend = enterEmailView.FindViewById<Button> (Resource.Id.btnSendEmail);
			var btnCancel = enterEmailView.FindViewById<Button> (Resource.Id.btnCancelSendEmail);

			builder = new AlertDialog.Builder (_activity);
			builder.SetInverseBackgroundForced (true);
			builder.SetView (enterEmailView);
			dialogEquiry = builder.Create ();
			dialogEquiry.SetCanceledOnTouchOutside(false);

			btnSend.Enabled = false;
			edMyEmail.Text = MApplication.getInstance ().sEmailAddress;
			edEnterEmail.TextChanged += (sender, e) => {
				if(edEnterEmail.Text.Count() > 0) {
					btnSend.Enabled = true;
				} else {
					btnSend.Enabled = false;
				}
			};

			btnSend.Click += (sender, e) => {
				if(edMyEmail.Text.Trim().Count() > 0) {
					if(Utils.checkValidateEmail(edMyEmail.Text.Trim())){
						if (edEnterEmail.Text.Trim().Count() <= 0) {
							btnSend.Enabled = false;
							showNoticeEmail(_activity.GetString(Resource.String.title_notice), _activity.GetString(Resource.String.require_email_profile));
						} else {
							emails.Clear();
							emailsInvalid.Clear();

							Utils.getEmailsProfileFromString(edEnterEmail.Text.ToString(), emails, emailsInvalid);
							if(emailsInvalid.Count > 0) {
								showNoticeEmail(_activity.GetString(Resource.String.invalid_email_title), getEmailInvalidFromList(emailsInvalid));
							} else {
								dialogEquiry.Dismiss();
								actionDelegate.onSending();
								sendEmailProfileRequest(specId, edMyEmail.Text.Trim(), edMessEmail.Text.Trim());
							}
						}
					} else{
						showNoticeEmail(_activity.GetString(Resource.String.title_notice), _activity.GetString(Resource.String.invalid_email_reset));	
					}
				} else {
					showNoticeEmail(_activity.GetString(Resource.String.title_notice), _activity.GetString(Resource.String.email_sender_require));
				}
			};

			btnCancel.Click += (sender, e) => {
				dialogEquiry.Dismiss();
			};

			dialogEquiry.Show ();
		}
Exemplo n.º 16
0
        //private void PageNumberEntry_KeyPress(object sender, Android.Views.View.KeyEventArgs e)
        //{
        //    e.Handled = false;
        //    if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter)
        //    {
        //        int pageNumber = 0;
        //        if (int.TryParse((pageNumberEntry.Text), out pageNumber))
        //        {
        //            if ((pageNumber > 0) && (pageNumber <= pdfViewer.PageCount))
        //                pdfViewer.GoToPage(pageNumber);
        //            else
        //            {
        //                DisplayAlertDialog();
        //                pageNumberEntry.Text = pdfViewer.PageNumber.ToString();
        //            }
        //        }
        //        pageNumberEntry.ClearFocus();
        //        InputMethodManager inputMethodManager = (InputMethodManager)pdfMainView.Context.GetSystemService(Context.InputMethodService);
        //        inputMethodManager.HideSoftInputFromWindow(pdfMainView.WindowToken, HideSoftInputFlags.None);
        //    }
        //}

        void DisplayAlertDialog()
        {
            Android.App.AlertDialog.Builder alertDialog = new Android.App.AlertDialog.Builder(pdfMainView.Context);
            alertDialog.SetTitle("Error");
            alertDialog.SetMessage("Please enter the valid page number");
            alertDialog.SetPositiveButton("OK", (senderAlert, args) => { });
            Android.App.Dialog dialog = alertDialog.Create();
            dialog.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;
 }
 protected virtual void RegisterDialogElementEvent(Android.App.Dialog dialog)
 {
     if (_dialogElement != null)
     {
         dialog.ShowEvent    += Dialog_ShowEvent;
         dialog.DismissEvent += DialogDismiss_ElementClose;
     }
     dialog.DismissEvent += DialogDismiss_DisposeFragment;
 }
Exemplo n.º 19
0
        public PopupDialogContainer(PopupArguments popupArguments)
        {
            _popupArguments = popupArguments;
            _popup = popupArguments.Popup;

            _dialog = new Dialog(Forms.Context);
            _dialog.RequestWindowFeature((int)WindowFeatures.NoTitle);

            _popup.CloseRequest += OnCloseRequest;
        }
Exemplo n.º 20
0
        private static void LocalShowDialog(string message, Activity currentActivity)
        {
            CloseDialog(currentActivity);

            var builder = new AlertDialog.Builder(currentActivity);
            builder.SetMessage(message);

            _currentDialog = builder.Create();
            _currentDialog.Show();
        }
Exemplo n.º 21
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();
		}
Exemplo n.º 22
0
        void ShowInstallGooglePlayServicesDialog()
        {
            Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);
            alert.SetTitle("Google Play Services");
            alert.SetMessage(AppResources.GooglePlayServicesNotInstalledMessage);
            alert.SetPositiveButton("OK", (senderAlert, args) =>
            {
            });

            Android.App.Dialog dialog = alert.Create();
            dialog.Show();
        }
        protected void ShowNoSensorsDialog()
        {
            Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);
            alert.SetTitle("No sensors");
            alert.SetMessage("Device sensors invalid");
            alert.SetPositiveButton("Accept", (senderAlert, args) =>
            {
            });

            Android.App.Dialog dialog = alert.Create();
            dialog.Show();
        }
        public void ShowInstallGooglePlayServicesDialog()
        {
            Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);
            alert.SetTitle("Google Play Services");
            alert.SetMessage("Google Play Services not installed.");
            alert.SetPositiveButton("Cancel", (senderAlert, args) =>
            {
            });

            Android.App.Dialog dialog = alert.Create();
            dialog.Show();
        }
Exemplo n.º 25
0
        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 void SetDialogCloseWays(DialogConfig config, Android.App.Dialog dialog)
 {
     if (!config.IsCanCancel)
     {
         dialog.SetCancelable(false);
         return;
     }
     if (!config.IsCloseByTouchMask)
     {
         dialog.SetCancelable(true);
         dialog.SetCanceledOnTouchOutside(false);
     }
 }
        void NewElement_Clicked(object sender, EventArgs e)
        {
            var d = new Dialog(Xamarin.Forms.Forms.Context);
            d.SetTitle((this.Element as ButtonOpenDialog).TitleModal);
            var renderer = RendererFactory.GetRenderer((this.Element as ButtonOpenDialog).ContentModal);
            // TODO : à ajuster
            Android.Widget.LinearLayout.LayoutParams params1 = new Android.Widget.LinearLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
            params1.Height = 300;
            d.AddContentView(renderer.ViewGroup, params1);
            d.Show();

            this.UpdateLayout();
        }
        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();
        }
Exemplo n.º 30
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);
        }
Exemplo n.º 32
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);
 }
Exemplo n.º 33
0
		public void showPopupDefer(BookingInfo bookingInfo, DeferInfo deferInfo){
			var confirmDeferView = LayoutInflater.Inflate (Resource.Layout.popup_confirm_layout, null);
			var tvTitle = confirmDeferView.FindViewById<TextView> (Resource.Id.tv_title_confirm_popup);
			var tvConfirm = confirmDeferView.FindViewById<TextView> (Resource.Id.tv_info_popup);
			var btnConfirmDefer = confirmDeferView.FindViewById<Button> (Resource.Id.btn_confirm_tv_popup);
			var btnDecline = confirmDeferView.FindViewById<Button> (Resource.Id.btn_decline_tv_popup);

			tvConfirm.Gravity = global::Android.Views.GravityFlags.Left;
			tvTitle.SetText (Android.Resource.String.delayed_title);
			btnConfirmDefer.Text = "Accept";
			btnDecline.Text = "Decline";
			if (deferInfo.IsDefer) {
				string strMinute = ((double)bookingInfo.Deferral).ToString ("C0", new CultureInfo ("en-us")).Substring (1) + " minutes.";
				tvConfirm.TextFormatted = Html.FromHtml (String.Format (_activity.GetString (Resource.String.delay_minute_info), bookingInfo.SpecialistName, strMinute));
			} else {
				int iHours = (int)(bookingInfo.Deferral / 60);
				tvConfirm.TextFormatted = Html.FromHtml (String.Format (_activity.GetString (Resource.String.delay_day_info), bookingInfo.SpecialistName, iHours));
			}

			OnTimerSendCancelDefer (bookingInfo.Id, deferInfo, 0);

			btnConfirmDefer.Click += (sender, e) => {
				dialog.Dismiss();
				sendDeferTalkNow(bookingInfo, deferInfo);
				if(timer != null) {
					timer.Stop();
					timer = null;
				}
			};

			btnDecline.Click += (sender, e) => {
				dialog.Dismiss();
				sendCancelDeferTalkNow(bookingInfo.Id, deferInfo);
				if(timer != null) {
					timer.Stop();
					timer = null;
				}
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetInverseBackgroundForced (true);
			builder.SetView (confirmDeferView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside(false);
			dialog.Show ();
		}
Exemplo n.º 34
0
 //string[] values;
 //Dialog dialog;
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate (bundle);
     //string text = Intent.GetStringArrayListExtra ("MyData") ?? "Data not available";
     SetContentView (Resource.Layout.listview);
     FindViewById<Button> (Resource.Id.btnCreate).Click += delegate {
         Console.WriteLine("check{0}","inside btncreate");
         Dialog dialog = new Dialog(this);
         dialog.SetTitle("form");
     //				dialog.SetContentView(Resource.Layout.build);
         //var alert = new AlertDialog.Builder(Forms.Context);
     //				AlertDialog.Builder dialog= new AlertDialog.Builder(this,Android.App.AlertDialog.ThemeHoloLight);
     //				dialog.SetView (FindViewById<View> (Resource.Layout.build));
         //dialog.Create();
         dialog.Show();
     };
 }
Exemplo n.º 35
0
        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));
        }
Exemplo n.º 36
0
		public void ShowStatus(int iStatusIndex){
			_iStatusIndex = iStatusIndex;

			var statusView = LayoutInflater.Inflate (Resource.Layout.popup_priority_sort, null);
			var tvTitle = statusView.FindViewById<TextView> (Resource.Id.sort_title);
			tvTitle.Text = _activity.GetString (Resource.String.availability_title);
			ListView statusLV = statusView.FindViewById<ListView>(Resource.Id.lv_priority_sort);
			StatusAdapter statusAdapter;
			statusAdapter = new StatusAdapter (_activity, _activity.Resources.GetStringArray(Resource.Array.status_expert), iStatusIndex);
			statusLV.Adapter = statusAdapter;
			statusLV.ItemClick += OnListItemClick;

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (statusView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside(false);
			dialog.Show ();
		}
Exemplo n.º 37
0
		public void showPreTimeEnquiry(bool isStandard){
			var bookPreTimeRequestView = LayoutInflater.Inflate (Resource.Layout.popup_request_layout, null);
			var tvTitle = bookPreTimeRequestView.FindViewById<TextView> (Resource.Id.tv_title_request_popup);
			var editDescription = bookPreTimeRequestView.FindViewById<EditText> (Resource.Id.edit_entertext_popup);
			var btnConfirm = bookPreTimeRequestView.FindViewById<Button> (Resource.Id.btn_confirm_entertext_popup);
			var btnCancel = bookPreTimeRequestView.FindViewById<Button> (Resource.Id.btn_cancel_entertext_popup);
			var tvError = bookPreTimeRequestView.FindViewById<TextView> (Resource.Id.tv_enquiry_error);

			this.isStandardHour = isStandard;
			btnConfirm.Enabled = false;

			tvTitle.SetText (Android.Resource.String.titleTalknowRequest);
			btnConfirm.Click += (sender, e) => {
				if (editDescription.Text.Trim().Length <= 0) {
					btnConfirm.Enabled = false;
					tvError.Visibility = ViewStates.Visible;
				} else {
					strEnquiry = editDescription.Text.ToString ();
					dialog.Dismiss();

					Intent intent = new Intent(_activity, typeof(BookPreTimeActivity));
					intent.PutExtra(constants.pIsStandard, isStandardHour);
					intent.PutExtra(constants.pEnquiry, strEnquiry);
					_activity.StartActivity(intent);
				}
			};
			btnCancel.Click += (sender, e) => {
				dialog.Dismiss();
			};
			editDescription.TextChanged += (sender, e) => {
				if(editDescription.Text.Count() <= 0){
					btnConfirm.Enabled = false;
				}else{
					btnConfirm.Enabled = true;
				}
				tvError.Visibility = ViewStates.Gone;
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (bookPreTimeRequestView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			dialog.Show ();
		}
Exemplo n.º 38
0
		private void showNotice(string title, string mess){
			var noticeView = LayoutInflater.Inflate (Resource.Layout.popup_notice_layout, null);
			var tvTitle = noticeView.FindViewById<TextView> (Resource.Id.tv_title_notice_popup);
			var tvNotice = noticeView.FindViewById<TextView> (Resource.Id.tv_info_popup_notice);
			var btnOk = noticeView.FindViewById<Button> (Resource.Id.btn_ok_popup_notice);

			tvTitle.Text = title;
			tvNotice.Text = mess;
			btnOk.Click += (sender, e) => {
				dialog.Dismiss();
				_activity.Finish();
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (noticeView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside (false);
			dialog.SetOnCancelListener (new OnCancelDialogListener (_activity));
			dialog.Show ();
		}
Exemplo n.º 39
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);
        }
Exemplo n.º 40
0
		public void ShowTalkNowEnquiry(){
			var talknowView = LayoutInflater.Inflate (Resource.Layout.popup_request_layout, null);

			var tvTitle = talknowView.FindViewById<TextView> (Resource.Id.tv_title_request_popup);
			var editDescription = talknowView.FindViewById<EditText> (Resource.Id.edit_entertext_popup);
			var btnOK = talknowView.FindViewById<Button> (Resource.Id.btn_confirm_entertext_popup);
			var btnCancel = talknowView.FindViewById<Button> (Resource.Id.btn_cancel_entertext_popup);
			var tvError = talknowView.FindViewById<TextView> (Resource.Id.tv_enquiry_error);

			btnOK.Enabled = false;
			tvTitle.SetText (Android.Resource.String.titleTalknowRequest);
			btnOK.Click += (sender, e) => {
				if (editDescription.Text.Trim().Length <= 0) {
					btnOK.Enabled = false;
					tvError.Visibility = ViewStates.Visible;
				} else {
					strEnquiry = editDescription.Text.ToString ();
					dialog.Dismiss();
					showTalkNowConfirm();
				}
			};

			btnCancel.Click += (sender, e) => {
				dialog.Dismiss();
			};

			editDescription.TextChanged += (sender, e) => {
				if(editDescription.Text.Count() <= 0) {
					btnOK.Enabled = false;
				}else {
					btnOK.Enabled = true;
				}
				tvError.Visibility = ViewStates.Gone;
			};

			builder = new AlertDialog.Builder (_activity);
			builder.SetView (talknowView);
			dialog = builder.Create ();
			dialog.SetCanceledOnTouchOutside(false);
			dialog.Show ();
		}
Exemplo n.º 41
0
		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();
		}
Exemplo n.º 42
0
        protected void ShowConfirmDialog()
        {
            Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);
            alert.SetTitle(AppResources.ChangeZone);
            alert.SetMessage(AppResources.ChangeZoneConfirmMessage);
            alert.SetPositiveButton(AppResources.Yes, (senderAlert, args) =>
            {
                User entity = sqliteManager.GetUser();
                if (entity != null)
                {
                    entity.ActiveParkingId = activeParkingId;

                    sqliteManager.SaveUser(entity);
                }

                Finish();
            });
            alert.SetNegativeButton(AppResources.No, (senderAlert, args) =>
            {
            });

            Android.App.Dialog dialog = alert.Create();
            dialog.Show();
        }
Exemplo n.º 43
0
        protected override void OnPostExecute(Java.Lang.Object result)
        {
            base.OnPostExecute(result);
            //    progressDialog.Dismiss();
            if (result != null && authentication != null && authentication.access_token != null && authentication.Success == true)
            {
                GlobalClass.AccessToken = authentication.access_token;
                GlobalClass.UserEmail   = authentication.EmailID;
                GlobalClass.UserID      = authentication.UserID.ToString();
                Log.Debug("AccessToken", GlobalClass.AccessToken);
                Log.Debug("AccessTokenExpiresIn", authentication.expires_in.ToString());
                var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                var prefEditor = prefs.Edit();
                prefEditor.PutString("Password", password);
                prefEditor.PutString("LoginUserName", authentication.LoginUserName);
                prefEditor.PutString("EmailID", authentication.EmailID);
                prefEditor.PutString("Access_Token", authentication.access_token);
                prefEditor.PutString("UserID", authentication.UserID.ToString());
                prefEditor.PutString("ProfilePic", authentication.ProfilePic.ToString());
                prefEditor.PutString("UserName", authentication.UserName.ToString());
                prefEditor.PutString("IsNotificationEnable", authentication.IsNotificationEnable == null ? "false" : authentication.IsNotificationEnable.ToString());
                prefEditor.PutBoolean("IsPublic", Convert.ToBoolean(authentication.IsPublic));
                prefEditor.PutString("PhoneNumber", authentication.PhoneNumber);
                prefEditor.PutString("Bio", authentication.Bio);
                prefEditor.PutInt("MaxImageForWeClip", authentication.MaxImageForWeClip);
                prefEditor.PutLong("MaxVideoDuration", authentication.MaxVideoDurationInMinute);
                prefEditor.PutInt("MaxVideoForWeclip", authentication.MaxVideoForWeclip);
                prefEditor.PutLong("MaxVideoSize", authentication.MaxVideoSize);

                prefEditor.PutBoolean("RegisterEmail", false);
                prefEditor.PutBoolean("RegisterPhone", false);

                if (authentication.DOB != null)
                {
                    prefEditor.PutString("DOB", string.Format("{0: dd MMM yyyy}", authentication.DOB));
                }
                else
                {
                    prefEditor.PutString("DOB", "N/A");
                }
                prefEditor.Commit();

                var intent = new Intent(context, typeof(GCMRegistrationService));
                context.StartService(intent);

                context.StartActivity(typeof(MainActivity));
                context.Finish();
            }
            else
            {
                if (result != null && authentication != null && authentication.Success == false)
                {
                    if (authentication.status == "verify_account")
                    {
                        Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(context);
                        alert.SetInverseBackgroundForced(true);
                        alert.SetTitle("Verify account");
                        alert.SetMessage(authentication.Message);
                        alert.SetPositiveButton("YES", (senderAlert, args) =>
                        {
                            var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                            var prefEditor = prefs.Edit();
                            prefEditor.PutString("LoginUserName", userName);
                            prefEditor.Commit();
                            context.StartActivity(new Intent(Application.Context, typeof(AddUserName)));
                            context.Finish();
                        });

                        alert.SetNegativeButton("NO", (senderAlert, args) =>
                        {
                            alert.Dispose();
                        });
                        Android.App.Dialog dialog = alert.Create();
                        dialog.Show();
                    }
                    else
                    {
                        AlertBox.Create("Error", authentication.Message, context);
                        var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                        var prefEditor = prefs.Edit();
                        prefEditor.Clear();
                        prefEditor.Commit();
                    }
                }
                else
                {
                    AlertBox.Create("Error", "Error occured", context);
                    var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                    var prefEditor = prefs.Edit();
                    prefEditor.Clear();
                    prefEditor.Commit();
                }
            }
        }
Exemplo n.º 44
0
        private void SelectItem(int position)
        {
            Android.Support.V4.App.Fragment fragment = null;
            string tag = "";

            switch (position)
            {
            case 0:
                fragment = new HomeFragment();
                tag      = "home";
                break;

            case 1:
                fragment = new InviteContacts();
                tag      = "invite";
                break;

            case 2:
                fragment = new SettingFragment();
                tag      = "setting";

                break;
            //case 4:
            //    fragment = new ChangePasswordFragment();
            //    tag = "setting";

            //    break;
            case 4:
                drawerLayout.CloseDrawers();
                Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                alert.SetInverseBackgroundForced(true);
                alert.SetTitle("Logout");
                alert.SetMessage("Are you sure?");
                alert.SetPositiveButton("YES", (senderAlert, args) =>
                {
                    new LogOutFromWeClip(this).Execute();
                });

                alert.SetNegativeButton("No", (s, e) => { alert.Dispose(); });
                Android.App.Dialog dialog = alert.Create();
                dialog.Show();
                break;

            default:
                fragment = new InviteContacts();
                break;
            }

            if (fragment != null)
            {
                Android.Support.V4.App.Fragment containerFragment = SupportFragmentManager.FindFragmentById(Resource.Id.content_frame);
                if (containerFragment.Class.Name.Equals(fragment.Class.Name))
                {
                    drawerLayout.CloseDrawers();
                    return;
                }

                Android.Support.V4.App.Fragment        itemFragement   = fragment;
                Android.Support.V4.App.FragmentManager fragmentManager = SupportFragmentManager;
                fragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, itemFragement, tag).AddToBackStack("my_fragment").Commit();
                drawerLayout.CloseDrawers();
            }
        }