From 5b909f6d1acb3c8854f95a13232711558f851acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Przyby=C5=82a?= Date: Sat, 9 Jan 2021 18:15:51 +0100 Subject: [PATCH 1/2] =?UTF-8?q?POS-44=20Poprawiono=20wy=C5=9Bwietlanie=20b?= =?UTF-8?q?=C5=82=C4=99d=C3=B3w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Klient/Klient/Klient.Android/MainActivity.cs | 39 +++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/Klient/Klient/Klient.Android/MainActivity.cs b/Klient/Klient/Klient.Android/MainActivity.cs index c7a2135..de6d9f5 100644 --- a/Klient/Klient/Klient.Android/MainActivity.cs +++ b/Klient/Klient/Klient.Android/MainActivity.cs @@ -45,16 +45,10 @@ namespace Klient.Droid var Login = FindViewById(Resource.Id.Login).Text; SecureString Password = new NetworkCredential("", FindViewById(Resource.Id.Password).Text).SecurePassword; - if (Login.Length < 3 || Login.Length > 12) + + if (string.IsNullOrWhiteSpace(new NetworkCredential("", Password).Password)) { FindViewById(Resource.Id.ErrorLogIn).Text = "Hasło musi mieć od 3 do 12 znaków!"; - FindViewById(Resource.Id.Login).Text = ""; - FindViewById(Resource.Id.Password).Text = ""; - } - else if (string.IsNullOrWhiteSpace(new NetworkCredential("", Password).Password)) - { - FindViewById(Resource.Id.ErrorLogIn).Text = "Hasło musi mieć od 3 do 12 znaków!"; - FindViewById(Resource.Id.Login).Text = ""; FindViewById(Resource.Id.Password).Text = ""; } else @@ -85,7 +79,6 @@ namespace Klient.Droid { string msg = await response.Content.ReadAsStringAsync(); FindViewById(Resource.Id.ErrorLogIn).Text = msg; - FindViewById(Resource.Id.Login).Text = ""; FindViewById(Resource.Id.Password).Text = ""; } @@ -101,14 +94,35 @@ namespace Klient.Droid var Login = FindViewById(Resource.Id.NewLogin).Text; SecureString Password = new NetworkCredential("", FindViewById(Resource.Id.NewPassword).Text).SecurePassword; SecureString Password2 = new NetworkCredential("", FindViewById(Resource.Id.RepeatPassword).Text).SecurePassword; + + if (Login.Length < 3 || Login.Length > 12) + { + FindViewById(Resource.Id.ErrorRegister).Text = "Login musi mięć od 3 do 12 znaków!"; + FindViewById(Resource.Id.NewPassword).Text = ""; + FindViewById(Resource.Id.RepeatPassword).Text = ""; - if (new NetworkCredential("", Password).Password != new NetworkCredential("", Password2).Password) + } + else if (new NetworkCredential("", Password).Password.Length < 8 || new NetworkCredential("", Password).Password.Length > 20) + { + FindViewById(Resource.Id.ErrorRegister).Text = "Hasło musi mieć od 8 do 20 znaków!"; + FindViewById(Resource.Id.NewPassword).Text = ""; + FindViewById(Resource.Id.RepeatPassword).Text = ""; + + } + + else if (new NetworkCredential("", Password).Password != new NetworkCredential("", Password2).Password) { FindViewById(Resource.Id.ErrorRegister).Text = "Hasła muszą być identyczne!"; - FindViewById(Resource.Id.NewLogin).Text = ""; - FindViewById(Resource.Id.Password).Text = ""; + FindViewById(Resource.Id.NewPassword).Text = ""; FindViewById(Resource.Id.RepeatPassword).Text = ""; } + else if(string.IsNullOrEmpty(FindViewById(Resource.Id.NewLogin).Text) || string.IsNullOrEmpty(FindViewById(Resource.Id.Email).Text) || string.IsNullOrEmpty(FindViewById(Resource.Id.NewPassword).Text) || string.IsNullOrEmpty(FindViewById(Resource.Id.RepeatPassword).Text) || string.IsNullOrEmpty(FindViewById(Resource.Id.Name).Text) || string.IsNullOrEmpty(FindViewById(Resource.Id.Surname).Text)) + { + FindViewById(Resource.Id.ErrorRegister).Text = "Wartości nie mogą być puste!"; + FindViewById(Resource.Id.NewPassword).Text = ""; + FindViewById(Resource.Id.RepeatPassword).Text = ""; + } + else { var values = new Dictionary @@ -131,7 +145,6 @@ namespace Klient.Droid { string msg = await response.Content.ReadAsStringAsync(); FindViewById(Resource.Id.ErrorRegister).Text = msg; - FindViewById(Resource.Id.NewLogin).Text = ""; FindViewById(Resource.Id.Password).Text = ""; FindViewById(Resource.Id.RepeatPassword).Text = ""; } From 6126c2d929e9d104d1abb2223298cc3936066f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Przyby=C5=82a?= Date: Sat, 9 Jan 2021 19:27:00 +0100 Subject: [PATCH 2/2] =?UTF-8?q?POS-39=20Dodanie=20ekranu=20informacji=20do?= =?UTF-8?q?=20g=C5=82=C3=B3wnego=20ekranu.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Klient/Klient/Klient.Android/MainActivity.cs | 8 ++- .../Klient/Klient.Android/Poszukiwacz.csproj | 5 ++ .../Resources/layout/ekranInformacji.xml | 57 +++++++++++++++++++ .../Resources/layout/ekranLogowania.xml | 2 +- .../Resources/layout/ekranPoLogowaniu.xml | 3 +- .../Resources/layout/ekranPoZdjeciu.xml | 9 +++ .../Resources/layout/ekranProfil.xml | 3 +- .../Resources/layout/ekranRejestracji.xml | 2 +- .../Resources/layout/ekranStartowy.xml | 17 +----- 9 files changed, 86 insertions(+), 20 deletions(-) create mode 100644 Klient/Klient/Klient.Android/Resources/layout/ekranInformacji.xml diff --git a/Klient/Klient/Klient.Android/MainActivity.cs b/Klient/Klient/Klient.Android/MainActivity.cs index de6d9f5..e286b2d 100644 --- a/Klient/Klient/Klient.Android/MainActivity.cs +++ b/Klient/Klient/Klient.Android/MainActivity.cs @@ -172,9 +172,13 @@ namespace Klient.Droid [Java.Interop.Export("about")] public void MainScreenAbout(View v) { - SetContentView(Resource.Layout.ekranStartowy); + SetContentView(Resource.Layout.ekranInformacji); + } + [Java.Interop.Export("GoToMainScreenFromInformation")] + public void GoToMainScreenFromInformation(View v) + { + SetContentView(Resource.Layout.ekranStartowy); } - [Java.Interop.Export("LoadFromFolder")] public void LoadFile(View v) { diff --git a/Klient/Klient/Klient.Android/Poszukiwacz.csproj b/Klient/Klient/Klient.Android/Poszukiwacz.csproj index c111326..26b87d0 100644 --- a/Klient/Klient/Klient.Android/Poszukiwacz.csproj +++ b/Klient/Klient/Klient.Android/Poszukiwacz.csproj @@ -149,6 +149,11 @@ Designer + + + Designer + + diff --git a/Klient/Klient/Klient.Android/Resources/layout/ekranInformacji.xml b/Klient/Klient/Klient.Android/Resources/layout/ekranInformacji.xml new file mode 100644 index 0000000..6b6adc4 --- /dev/null +++ b/Klient/Klient/Klient.Android/Resources/layout/ekranInformacji.xml @@ -0,0 +1,57 @@ + + + + + +