Exemple #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            //Set our view from the "main" layout resource
            RequestWindowFeature(Android.Views.WindowFeatures.NoTitle);


            SetContentView(Resource.Layout.SignInView);
            emailField     = FindViewById <EditText>(Resource.Id.emailField);
            password       = FindViewById <EditText>(Resource.Id.passwordField);
            forgotPWButton = FindViewById <Button>(Resource.Id.forgotPasswordButton);
            signInButton   = FindViewById <ImageButton>(Resource.Id.signInButton);
            facebookButton = FindViewById <ImageButton>(Resource.Id.facebookButton);
            signUpButton   = FindViewById <ImageButton>(Resource.Id.signUpButton);
            //MapActivity mapActivity = new MapActivity().OnCreate(bundle);
            //InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
            signUpButton.Click += (object sender, EventArgs args) =>
            {
                //Pull up dialog
                FragmentTransaction transaction  = FragmentManager.BeginTransaction();
                DialogSignUp        dialogSignUp = new DialogSignUp();
                dialogSignUp.Show(transaction, "dialog fragment");
                dialogSignUp.OnSignUpComplete += SignUpDialog_mOnSignUpComplete;
            };
            signInButton.Click += (object sender, EventArgs args) =>
            {
                //Get entered field values
                signInEmail    = emailField.Text;
                signInPassword = password.Text;

                if (true)
                {
                    //Dismiss Keybaord
                    InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
                    imm.HideSoftInputFromWindow(signInButton.WindowToken, 0);

                    var list = new Intent(this, typeof(ListViewActivity));

                    StartActivity(list);
                }
                else
                {
                    //Dismiss Keybaord
                    InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
                    //imm.HideSoftInputFromWindow(signInButton.WindowToken, 0);

                    Toast.MakeText(ApplicationContext, "Invalid login", ToastLength.Long).Show();
                }
            };
        }
Exemple #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            //Set our view from the "main" layout resource
            //SetContentView();

            forgotPWButton      = FindViewById <Button>(Resource.Id.forgotPasswordButton);
            signInButton        = FindViewById <Button>(Resource.Id.signInButton);
            facebookButton      = FindViewById <Button>(Resource.Id.facebookButton);
            signUpButton        = FindViewById <Button>(Resource.Id.signUpButton);
            signUpButton.Click += (object sender, EventArgs args) =>
            {
                //Pull up dialog
                FragmentTransaction transaction  = FragmentManager.BeginTransaction();
                DialogSignUp        dialogSignUp = new DialogSignUp();
                dialogSignUp.Show(transaction, "dialog fragment");
                dialogSignUp.OnSignUpComplete += SignUpDialog_mOnSignUpComplete;
            };
            signInButton.Click += (object sender, EventArgs args) =>
            {
                //Sign in view transition
            };
        }