/// <summary> /// Выбор пароля для просмотра. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SpinPass_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e) { edtPass.InputType = Android.Text.InputTypes.TextVariationPassword | Android.Text.InputTypes.ClassText; if (StatesTheme.IsDark()) { if (listPassw.Count != 0) { ((TextView)spinPass.GetChildAt(0)).SetTextColor(Color.White); } edtPass.SetTextColor(Color.White); } else { if (listPassw.Count != 0) { ((TextView)spinPass.GetChildAt(0)).SetTextColor(Color.Black); } edtPass.SetTextColor(Color.Black); } btnShowPass.Text = "Показать пароль"; int i = spinPass.SelectedItemPosition; edtLogin.Text = listPassw[i].ToString().Split('#')[1]; edtPass.Text = listPassw[i].ToString().Split('#')[2]; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.PageRegest); this.RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait; // Create your application here btnSelect = FindViewById <Button>(Resource.Id.BtnSelect); btnRegORLogOn = FindViewById <Button>(Resource.Id.BtnLogIn); edtLog = FindViewById <EditText>(Resource.Id.EdtExtLogin); edtPass = FindViewById <EditText>(Resource.Id.EdtExtPassw); t1 = FindViewById <TextView>(Resource.Id.textView2); t2 = FindViewById <TextView>(Resource.Id.textView3); l = FindViewById <LinearLayout>(Resource.Id.LRegest); if (StatesTheme.IsDark()) { SetDarkThem(); } btnSelect.Click += BtnSelect_Click; btnRegORLogOn.Click += BtnRegORLogOn_Click; }
/// <summary> /// Выбор темы. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RbWhite_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { if (rbWhite.Checked) { SetWhiteThem(); StatesTheme.SelectWhite(); } else { StatesTheme.SelectDark(); SetDarkThem(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); this.RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait; // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); spinPass = FindViewById <Spinner>(Resource.Id.SpinPass); btnShowPass = FindViewById <Button>(Resource.Id.BtnShowPass); btnAddPass = FindViewById <Button>(Resource.Id.BtnAddPas); btnEditPass = FindViewById <Button>(Resource.Id.BtnEditPass); btnDelPass = FindViewById <Button>(Resource.Id.BtnDelPass); btnPropert = FindViewById <Button>(Resource.Id.BtnPropert); btnExit = FindViewById <Button>(Resource.Id.BtnExit); edtLogin = FindViewById <EditText>(Resource.Id.EdtLogin); edtPass = FindViewById <EditText>(Resource.Id.EdtPass); l = FindViewById <LinearLayout>(Resource.Id.linearLayout1); t1 = FindViewById <TextView>(Resource.Id.textM); t2 = FindViewById <TextView>(Resource.Id.textM2); t3 = FindViewById <TextView>(Resource.Id.textM3); tb = FindViewById <Toolbar>(Resource.Id.toolbar1); //Вызов авторизации. Intent LogOn = new Intent(this, typeof(PeregestPage)); StartActivityForResult(LogOn, 0); spinPass.ItemSelected += SpinPass_ItemSelected; SetPassword(); if (StatesTheme.IsDark()) { SetDarkThem(); } else { SetWhiteThem(); } btnShowPass.Click += BtnShowPass_Click; btnExit.Click += BtnExit_Click; btnDelPass.Click += BtnDelPass_Click; btnAddPass.Click += BtnAddPass_Click; btnEditPass.Click += BtnEditPass_Click; btnPropert.Click += BtnPropert_Click; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.PageProperti); this.RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait; // Create your application here btnEdt = FindViewById <Button>(Resource.Id.BtnEdtUser); btnCansel = FindViewById <Button>(Resource.Id.BtnCanselProper); btnInfo = FindViewById <Button>(Resource.Id.BtnInformation); rbWhite = FindViewById <RadioButton>(Resource.Id.RbWhiteThem); rbDark = FindViewById <RadioButton>(Resource.Id.RbDarkThem); edLogin = FindViewById <EditText>(Resource.Id.EdtLoginProper); edPass = FindViewById <EditText>(Resource.Id.EdtPassProper); edtEmail = FindViewById <EditText>(Resource.Id.EdtEmail); #region Подключение других частей l = FindViewById <LinearLayout>(Resource.Id.LProper); t1 = FindViewById <TextView>(Resource.Id.textView1); t2 = FindViewById <TextView>(Resource.Id.textView2); t3 = FindViewById <TextView>(Resource.Id.textView3); t4 = FindViewById <TextView>(Resource.Id.textView4); t5 = FindViewById <TextView>(Resource.Id.TxtVEma); #endregion if (StatesTheme.IsDark()) { rbDark.Checked = true; SetDarkThem(); } edLogin.Text = Intent.GetStringExtra("Log"); edPass.Text = Intent.GetStringExtra("Pass"); edtEmail.Text = Intent.GetStringExtra("Email"); btnCansel.Click += BtnCansel_Click; btnEdt.Click += BtnEdt_Click; btnInfo.Click += BtnInfo_Click; rbWhite.CheckedChange += RbWhite_CheckedChange; rbDark.CheckedChange += RbWhite_CheckedChange; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.PageAddPasw); this.RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait; // Create your application here btnSave = FindViewById <Button>(Resource.Id.BtnSave); btnCancel = FindViewById <Button>(Resource.Id.BtnCansel); btnShow = FindViewById <Button>(Resource.Id.BtnShowPassAddEdtit); edtName = FindViewById <EditText>(Resource.Id.EdtNameAdd); edtLogin = FindViewById <EditText>(Resource.Id.EdtLoginAdd); edtPass = FindViewById <EditText>(Resource.Id.EdtPassAdd); h = FindViewById <TextView>(Resource.Id.TxtViewH); t1 = FindViewById <TextView>(Resource.Id.textView0); t2 = FindViewById <TextView>(Resource.Id.textView00); t3 = FindViewById <TextView>(Resource.Id.textView000); l = FindViewById <LinearLayout>(Resource.Id.LAdded); if (StatesTheme.IsDark()) { SetDarkThem(); } IsEdit = Intent.GetBooleanExtra("Edt", false); if (IsEdit) { h.Text = "Редактирование пароля:"; edtName.Text = Intent.GetStringExtra("Name"); edtLogin.Text = Intent.GetStringExtra("Log"); edtPass.Text = Intent.GetStringExtra("Pass"); } btnCancel.Click += BtnCancel_Click; btnSave.Click += BtnSave_Click; btnShow.Click += BtnShow_Click; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); this.RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait; SetContentView(Resource.Layout.RegenPasPage); // Create your application here btn = FindViewById <Button>(Resource.Id.BtnNext); edt = FindViewById <EditText>(Resource.Id.EdtEmailRegen); l = FindViewById <LinearLayout>(Resource.Id.LRegen); if (StatesTheme.IsDark()) { SetDarkThem(); } email = Intent.GetStringExtra("e-mail"); Log = Intent.GetStringExtra("Log"); btn.Click += Btn_Click; }
/// <summary> /// Скрытие и показ пароля. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnShowPass_Click(object sender, System.EventArgs e) { if (StatesTheme.IsDark()) { edtPass.SetTextColor(Color.White); } else { edtPass.SetTextColor(Color.Black); } if (btnShowPass.Text == "Показать пароль") { edtPass.InputType = Android.Text.InputTypes.ClassText | Android.Text.InputTypes.Null; btnShowPass.Text = "Скрыть пароль"; } else { edtPass.InputType = Android.Text.InputTypes.TextVariationPassword | Android.Text.InputTypes.ClassText; btnShowPass.Text = "Показать пароль"; } }
/// <summary> /// При закрытии одной из форм. /// </summary> /// <param name="requestCode"></param> /// <param name="resultCode"></param> /// <param name="data"></param> protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data) { base.OnActivityResult(requestCode, resultCode, data); //Закрылась форма регистрации. if (requestCode == 0) { if (resultCode == Result.Ok) { //Регистрация if (data.GetStringExtra("LogIn") == null) { string login = data.GetStringExtra("Rlogin"); string pass = data.GetStringExtra("Rpass"); new Android.App.AlertDialog.Builder(this). SetTitle("Добро пожаловать"). SetMessage("Сверху находятся все необходимые кнопки\n" + "-Добавить пароль(Плюс)\n" + "-Удалить пароль(Корзина)\n" + "-Редактировать пароль(Карандаш)\n" + "-Настройки(Шестеренка)\n" + "-Выход\n\n" + "Рекомендация:\n" + "Укажите свою почту во вкладке Настройки " + "и тогда, если вы забудете пароль от аккаунты," + "вы сможете его восстановить."). SetIcon(Resource.Drawable.information_info_1565). SetPositiveButton("Ок", delegate { }). Show(); try { controlerUser = new ControlerUser(login, pass); } catch { Toast.MakeText(this, "Не удалось создать учетную запись.", ToastLength.Short).Show(); Finish(); } } else//Вход { controlerUser = new ControlerUser(data.GetStringExtra("LogIn")); } SetPassword(); } else { Finish(); } } //Закрылась форма добавления пароля. if (requestCode == 1) { if (resultCode == Result.Ok) { string name = data.GetStringExtra("Name"); string login = data.GetStringExtra("Login"); string pass = data.GetStringExtra("Pass"); controlerUser.AddPassw(name, login, pass); SetPassword(); } } //Закрылась форма редактирования пароля. if (requestCode == 2) { if (resultCode == Result.Ok) { string name = data.GetStringExtra("Name"); string login = data.GetStringExtra("Login"); string pass = data.GetStringExtra("Pass"); controlerUser.EditPassw(spinPass.SelectedItemPosition, name, login, pass); SetPassword(); } } //Закрылась форма с настройками. if (requestCode == 3) { if (resultCode == Result.Ok) { string name = data.GetStringExtra("Login"); string pass = data.GetStringExtra("Pass"); string em = data.GetStringExtra("email"); controlerUser.EditUser(name, Shifrator.Shifrated(pass), Shifrator.Shifrated(em)); } if (StatesTheme.IsDark()) { SetDarkThem(); } else { SetWhiteThem(); } } }