-
Notifications
You must be signed in to change notification settings - Fork 29
HOS_assign #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
HOS_assign #41
Conversation
samuel-abhishek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test the app thoroughly with all possible user scenarios before commit
| ohos:below="$id:a" | ||
| ohos:orientation="horizontal" | ||
| > | ||
| <RadioButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect way to use the radio button for this use case. This way of implementation will let you select both Male & Female. (Suggestion : Use RadioContainer to group the radio buttons)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented click listener in SignUp class to set other false if pressed
| TextField mobile = (TextField) findComponentById(ResourceTable.Id_mobile); | ||
| RadioButton male = (RadioButton) findComponentById(ResourceTable.Id_gender_male); | ||
| RadioButton female = (RadioButton) findComponentById(ResourceTable.Id_gender_female); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SignupButton validation is missing.. For the signup button, validate if all the above fields are entered properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added SignUp validation
| if (!name.matches("^[a-zA-Z]*$")) { | ||
| //firstname.setText(""); | ||
| Text er1 = (Text) findComponentById(ResourceTable.Id_er1); | ||
| er1.setVisibility(Component.VISIBLE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"er1" must have a null check as setFocusChangedListener is being used.!! [App crash possible scenario : If user clicks on the textfield with setFocusChangedListener and then clicks back button. ] Make sure all the error fields in this class are having the null checks as they are inflated inside the focusChangedListener
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked
| email.setFocusChangedListener((component, isFocused) -> { | ||
| String name = email.getText(); | ||
| if (!isFocused) { | ||
| if (!name.matches("^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use hardcoded string the code. Use Constants
| String name = firstname.getText(); | ||
| if (!isFocused) { | ||
| if (!name.matches("^[a-zA-Z]*$")) { | ||
| //firstname.setText(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete the useless code.(Applies to all files)
|
|
Pull request for HOS assignment