Пример #1
0
        public void ShowErrorMessage(string errorMessage)
        {
            AlertDialog.Builder dialog = new AlertDialog.Builder(AppContexWrapper.GetContext());
            AlertDialog         alert  = dialog.Create();

            alert.SetTitle("Error Message");
            alert.SetMessage("errorMessage");
            alert.SetButton("OK", (c, ev) =>
            {
            });
            alert.Show();
        }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.login_activity);


            TextInputLayout loginInput    = FindViewById <TextInputLayout>(Resource.Id.input_login);
            TextInputLayout passwordInput = FindViewById <TextInputLayout>(Resource.Id.input_password);
            EditText        loginText     = FindViewById <EditText>(Resource.Id.edit_login);
            EditText        passwordText  = FindViewById <EditText>(Resource.Id.edit_pass);

            this.loginButton         = FindViewById <Button>(Resource.Id.login_button);
            this.loginButton.Enabled = false;
            this.login         = loginText.Text;
            this.password      = passwordText.Text;
            loginButton.Click += loginButton_Click;

            loginText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
            {
                this.login = loginText.Text;
                if (loginText.Text != string.Empty && passwordText.Text != string.Empty)
                {
                    this.loginButton.Enabled = true;
                }
            };
            passwordText.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
            {
                this.password = passwordText.Text;
                if (loginText.Text != string.Empty && passwordText.Text != string.Empty)
                {
                    this.loginButton.Enabled = true;
                }
            };
            this.restRequester = new RestRequester();
            AppContexWrapper.SetAContext(this);
            mContext = this;
        }