private void ShowAuthDialogue(bool wrongPw = false)
        {
            var builder = new AlertDialog.Builder(this);

            builder.SetTitle("Passwort");
            var view = LayoutInflater.From(this).Inflate(Resource.Layout.dialog_pw, null);

            if (wrongPw)
            {
                view.FindViewById <TextView>(Resource.Id.description).Text = "Ungültiges Passwort. Versuchen Sie es noch einmal.";
            }
            else
            {
                view.FindViewById <TextView>(Resource.Id.description).Text = VConfig.EnterPw;
            }
            builder.SetView(view);
            builder.SetPositiveButton("Prüfen", ((sender, e) => {
                if (view.FindViewById <EditText>(Resource.Id.password).Text == VConfig.Password)
                {
                    _setti.Write("Teacher", true);
                    ((AlertDialog)sender).Dismiss();
                    _pd = new ProgressDialog(this);
                    _pd.SetMessage("Klassen werden geladen");
                    _pd.Show();

                    _fetcher.GetClasses();
                }
                else
                {
                    ShowAuthDialogue(true);
                }
            }));
            builder.SetCancelable(false);

            var dia = builder.Create();

            dia.Show();
        }
Esempio n. 2
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            if (convertView == null)
            {
                convertView = _mContext.LayoutInflater.Inflate(Resource.Layout.list_row, null);
            }
            Group dataEntry = _data [position];

            _mContext.SetTheme(Resource.Drawable.btn);
            TextView l1 = (TextView)convertView.FindViewById(Resource.Id.firstLine);

            l1.SetTypeface(_type, TypefaceStyle.Normal);
            TextView l2 = (TextView)convertView.FindViewById(Resource.Id.secondLine);

            l1.Text            = dataEntry.ClassName;
            l2.Visibility      = ViewStates.Invisible;
            convertView.Click += (sender, e) => {
                Settings s = new Settings(_mContext);
                s.Write("group", dataEntry.Id);
                _mContext.OnBackPressed();
            };
            return(convertView);
        }