Exemplo n.º 1
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 ();
        }
        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 ();
 }
Exemplo n.º 4
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 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;
 }
Exemplo n.º 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();
		}
Exemplo n.º 7
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);
        }
        //        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.º 9
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.º 11
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.º 12
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.º 13
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.º 14
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();
		}
        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();
        }
Exemplo n.º 16
0
Arquivo: Live.cs Projeto: OML/OML_App
        private void DisplayDialogOkey()
        {
            //Close Keyboard
            InputMethodManager inputMgr = GetSystemService(InputMethodService) as InputMethodManager;
            if (CurrentFocus != null)
                inputMgr.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0);

            //Open Connect Dialog!
            //set the content view to the dialogwindow content
            //outside this contentview we are unable to find our resources
            SetContentView(Resource.Layout.DialogWindow);

            //create a new dialog
            dialog = new Dialog(this);
            dialog.SetContentView(Resource.Layout.DialogWindow);
            dialog.SetTitle("OML");
            dialog.SetCancelable(true);

            //set the dialog text
            dialogTxt = FindViewById<TextView>(Resource.Id.dialogText);

            //set the buttons
            okButton = FindViewById<Button>(Resource.Id.okButton);
            cancelButton = FindViewById<Button>(Resource.Id.cancelButton);

            //Hide Cancel buttom, Only Okey needed
            cancelButton.Visibility = ViewStates.Invisible;

            okButton.Click += delegate
            {
                //change the background, close the dialog and set the contentview back to the live / connection screen
                //so we can continue with our activity
                //Draw Click
                okButton.SetBackgroundResource(Resource.Drawable.okbutton_pressed);
                //Close Dialog
                dialog.Cancel();
                this.OnCreate(bundle);
            };//end delegate
        }
Exemplo n.º 17
0
        void SetupDialog(Context context, MaskType maskType, Func<Context, Dialog, MaskType, View> customSetup)
        {
            Application.SynchronizationContext.Post(state => {

                CurrentDialog = new Dialog(context);

                CurrentDialog.RequestWindowFeature((int)WindowFeatures.NoTitle);

                if (maskType != MaskType.Black)
                    CurrentDialog.Window.ClearFlags(WindowManagerFlags.DimBehind);

                CurrentDialog.Window.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(Android.Graphics.Color.Transparent));

                var customView = customSetup(context, CurrentDialog, maskType);

                CurrentDialog.SetContentView (customView);
                CurrentDialog.SetCancelable (false);

                CurrentDialog.Show ();

            }, null);
        }
 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();
 }
 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();
 }
			public override Dialog OnCreateDialog (Bundle savedInstanceState)
			{
				mDialog = base.OnCreateDialog (savedInstanceState);

				// To optimize for the "lightbox" style layout.  Since we're not actually displaying a
				// title, remove the bar along the top of the fragment where a dialog title would
				// normally go.
				mDialog.Window.RequestFeature (WindowFeatures.NoTitle);
				var imageView = new ImageView (Activity);
				mDialog.SetContentView (imageView);

				// Loading the image is going to require some sort of I/O, which should occur off the UI
				// thread.  Changing the ImageView to display the image must occur ON the UI thread.
				imageView.SetImageBitmap (LoadImageAsync ().Result);

				return mDialog;
			}
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            _flurryClient = new FlurryClient();

            _context = this;
            _loginError = new TextView(this);

            SetContentView(Resource.Layout.loginweblayout);
            _endlogin = new TextView(this);
            //_messageDialogBuilder = new AlertDialog.Builder(this);
            _loginWebView = FindViewById<WebView>(Resource.Id.loginWebView);
            _loginWebView.Settings.SavePassword = false;

            //_loginWebView.Settings.JavaScriptEnabled = true;

            _loginWebView.Settings.PluginsEnabled = true;
            _loginWebView.Settings.JavaScriptCanOpenWindowsAutomatically = true;
            _loginWebView.SaveEnabled = false;
            _loginWebView.SetWebViewClient(new ItsbetaLoginWebViewClient(this));
            _loginWebView.SetWebChromeClient(new ItsbetaLoginWebViewChromeClient());
            // "https://www.facebook.com/dialog/oauth?response_type=token&display=popup&client_id={0}&redirect_uri={1}&scope={2}",
            _loginWebView.LoadUrl(String.Format(
                "https://m.facebook.com/dialog/oauth/?response_type=token&" +
                                                    "client_id={0}"+
                                                    "&redirect_uri={1}" +
                                                    "&scope={2}",
                    //"https://www.facebook.com/dialog/oauth/?response_type=token&display=popup&client_id={0}&redirect_uri={1}&scope={2}",
                    AppInfo._fbAppId, AppInfo._loginRedirectUri, AppInfo._fbScope));

            RelativeLayout progressDialogRelativeLayout = new RelativeLayout(this);
            LayoutInflater progressDialoglayoutInflater = (LayoutInflater)BaseContext.GetSystemService(LayoutInflaterService);
            View progressDialogView = progressDialoglayoutInflater.Inflate(Resource.Layout.progressdialoglayout, null);
            _progressDialogMessage = (TextView)progressDialogView.FindViewById(Resource.Id.progressDialogMessageTextView);
            progressDialogRelativeLayout.AddView(progressDialogView);
            _progressDialog = new ProgressDialog(this, Resource.Style.FullHeightDialog);
            _progressDialog.Show();
            _progressDialog.SetContentView(progressDialogRelativeLayout);
            _progressDialog.Dismiss();

            _progressDialog.Show();
            _progressDialog.SetCanceledOnTouchOutside(false);

            /////

            RelativeLayout errorDialogRelativeLayout = new RelativeLayout(this);
            LayoutInflater errorDialoglayoutInflater = (LayoutInflater)BaseContext.GetSystemService(LayoutInflaterService);
            View errorDialogView = errorDialoglayoutInflater.Inflate(Resource.Layout.wrongcodedialoglayout, null);
            _errorDialogReadyButton = (Button)errorDialogView.FindViewById(Resource.Id.readyButton);
            _errorDialogTitle = (TextView)errorDialogView.FindViewById(Resource.Id.textView1);
            _errorDialogMessage = (TextView)errorDialogView.FindViewById(Resource.Id.textView2);

            errorDialogRelativeLayout.AddView(errorDialogView);
            _errorDialog = new Dialog(this, Resource.Style.FullHeightDialog);
            _errorDialog.SetTitle("");
            _errorDialog.SetContentView(errorDialogRelativeLayout);

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            _endlogin.TextChanged += delegate //здесь инициализировать все необходимое перед запуском...
            {
                Finish();
                StartActivity(typeof(FirstBadgeActivity));
            };
            _loginError.TextChanged += delegate { Finish(); StartActivity(typeof(LoginActivity)); };
        }
Exemplo n.º 22
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;
        }
Exemplo n.º 23
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 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 ();
        }
Exemplo n.º 25
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();
            };
        }
        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 ();
        }
Exemplo n.º 28
0
		void SetupDialog(Context context, MaskType maskType, Action cancelCallback, Func<Context, Dialog, MaskType, View> customSetup)
		{
			Application.SynchronizationContext.Send(state => {

				CurrentDialog = new Dialog(context);

				CurrentDialog.RequestWindowFeature((int)WindowFeatures.NoTitle);

				if (maskType != MaskType.Black)
					CurrentDialog.Window.ClearFlags(WindowManagerFlags.DimBehind);

				if (maskType == MaskType.None)
					CurrentDialog.Window.SetFlags(WindowManagerFlags.NotTouchModal, WindowManagerFlags.NotTouchModal);

				CurrentDialog.Window.SetBackgroundDrawable(new Android.Graphics.Drawables.ColorDrawable(Android.Graphics.Color.Transparent));

				var customView = customSetup(context, CurrentDialog, maskType);

				CurrentDialog.SetContentView (customView);

				CurrentDialog.SetCancelable (cancelCallback != null);	
				if (cancelCallback != null)
					CurrentDialog.CancelEvent += (sender, e) => cancelCallback();

				CurrentDialog.Show ();

			}, null);
		}
Exemplo n.º 29
0
        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 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();
 }
Exemplo n.º 31
0
 private Dialog CreateDeviceDialog()
 {
     Dialog dialog = new Dialog (this);
     dialog.SetTitle ("Select Device or Event");
     dialog.Window.SetLayout (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
     dialog.SetContentView (Resource.Layout.SelectDongles);
     dialog.Window.SetTitleColor (Color.White);
     return dialog;
 }
Exemplo n.º 32
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;
		}
Exemplo n.º 33
0
        /// <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();
        }