Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Summative_Sam_Markey
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sam.markey
Summative_Sam_Markey
Commits
176d5661
Commit
176d5661
authored
Apr 29, 2021
by
Sam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit v9
parent
ab77178b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
register.java
...src/main/java/com/example/museumworld/login/register.java
+19
-5
strings.xml
app/src/main/res/values-fr/strings.xml
+2
-0
strings.xml
app/src/main/res/values/strings.xml
+4
-0
No files found.
app/src/main/java/com/example/museumworld/login/register.java
View file @
176d5661
...
...
@@ -106,6 +106,11 @@ public class register extends AppCompatActivity implements View.OnClickListener
setParams
(
ErrorMessageFirstname
);
ErrorMessageFirstname
.
setText
(
message
);
}
else
if
(!
firstname
.
matches
(
"[a-zA-Z]*"
)){
message
=
getString
(
R
.
string
.
regex_name
);
setParams
(
ErrorMessageFirstname
);
ErrorMessageFirstname
.
setText
(
message
);
}
else
{
ResetParams
(
ErrorMessageFirstname
);
}
...
...
@@ -114,6 +119,11 @@ public class register extends AppCompatActivity implements View.OnClickListener
setParams
(
ErrorMessageLastname
);
ErrorMessageLastname
.
setText
(
message
);
}
else
if
(!
lastname
.
matches
(
"[a-zA-Z]*"
)){
message
=
getString
(
R
.
string
.
regex_name
);
setParams
(
ErrorMessageLastname
);
ErrorMessageLastname
.
setText
(
message
);
}
else
{
ResetParams
(
ErrorMessageLastname
);
}
...
...
@@ -123,11 +133,12 @@ public class register extends AppCompatActivity implements View.OnClickListener
setParams
(
ErrorMessageuserName
);
ErrorMessageuserName
.
setText
(
message
);
}
else
if
(
username
.
length
()
>
30
){
message
=
getString
(
R
.
string
.
re
ister_username
);
else
if
(
!
username
.
matches
(
"[a-zA-Z0-9]*"
)
){
message
=
getString
(
R
.
string
.
re
gex_other
);
setParams
(
ErrorMessageuserName
);
ErrorMessageuserName
.
setText
(
message
);
}
else
{
ResetParams
(
ErrorMessageuserName
);
}
...
...
@@ -136,6 +147,11 @@ public class register extends AppCompatActivity implements View.OnClickListener
setParams
(
ErrorMessagepassword
);
ErrorMessagepassword
.
setText
(
message
);
}
else
if
(!
password
.
matches
(
"[a-zA-Z0-9]*"
)){
message
=
getString
(
R
.
string
.
regex_other
);
setParams
(
ErrorMessagepassword
);
ErrorMessagepassword
.
setText
(
message
);
}
else
{
ResetParams
(
ErrorMessagepassword
);
}
...
...
@@ -174,9 +190,7 @@ public class register extends AppCompatActivity implements View.OnClickListener
password_EditText2
.
setText
(
""
);
}
else
if
(
response
.
equals
(
"special_characters"
)){
snackbarAlert
(
"Please remove special Characters"
,
true
);
}
else
if
(
response
.
equals
(
"failure"
))
{
snackbarAlert
(
"Something Went Wrong!"
,
true
);
}
else
if
(
response
.
equals
(
"username_taken"
))
{
...
...
app/src/main/res/values-fr/strings.xml
View file @
176d5661
...
...
@@ -86,4 +86,6 @@
<string
name=
"bookingConfirm2"
>
Daté:
</string>
<string
name=
"bookingConfirm3"
>
Temps:
</string>
<string
name=
"bookingTitle"
>
Confirmer la réservation
</string>
<string
name=
"regex_name"
>
* Ne peut contenir que des lettres
</string>
<string
name=
"regex_other"
>
* Ne peut contenir que des chiffres et des lettres
</string>
</resources>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
176d5661
...
...
@@ -82,6 +82,8 @@
<string
name=
"login_usernameError"
>
*Name has to be 5 characters long
</string>
<string
name=
"login_passwordError"
>
*Password has to be 7 characters long
</string>
<string
name=
"reister_firstname"
>
*Firstname has to be at least 2 characters long
</string>
<string
name=
"regex_name"
>
*Can only contain letters
</string>
<string
name=
"regex_other"
>
*Can only contain numbers and letters
</string>
<string
name=
"reister_lastname"
>
*Lastname has to be at least 3 characters long
</string>
<string
name=
"reister_username"
>
*Username has to be at least 5 characters long
</string>
<string
name=
"reister_password"
>
*Password has to be at least 7 characters long
</string>
...
...
@@ -90,4 +92,6 @@
<string
name=
"world_museums"
>
World Museums
</string>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment