RegisterFragment - ShutUpPaulo/TecProg_2016-01 GitHub Wiki
Class RegisterFragment
1. Class Attributes
| Name | Type | Description | Default Value |
|---|---|---|---|
| STRING_EMPTY | static final String | Defines an empty string | "" |
| nameField | EditText | Name field of user registration view | null |
| birthDateField | EditText | Birth date field of user registration view | null |
| mailField | EditText | E-mail field of user registration view | null |
| mailConfirmationField | EditText | E-mail confirmation field of user registration view | null |
| usernameField | EditText | Username field of user registration view | null |
| passwordField | EditText | Password field of user registration view | null |
| passwordConfirmationField | EditText | Password confirmation field of user registration view | null |
| name | String | Name of registered user | STRING_EMPTY |
| birthDate | String | Birth date of registered user | STRING_EMPTY |
| username | String | username of registered user | STRING_EMPTY |
| String | E-mail of registered user | STRING_EMPTY | |
| mailConfirmation | String | E-mail confirmation of registered user | STRING_EMPTY |
| password | String | Password of registered user | STRING_EMPTY |
| passwordConfirmation | String | Password confirmation of registered user | STRING_EMPTY |
2. Methods
2.1. RegisterFragment
2.1.1. Description:
- Empty constructor required in RegisterFragment tests
2.1.2. Arguments:
- No arguments
2.1.3. Return:
- Type: Constructor
2.1.4. Variables:
- No other variables
2.2. onCreateView
2.2.1. Description:
- Creates and returns the view hierarchy associated with the fragment
2.2.2. Arguments:
- LayoutInflater inflater: Object used to inflate any views in the fragment
- ViewGroup container: If non-null, is the parent view that the fragment should be attached to
- Bundle savedInstanceState: If non-null, this fragment is being re-constructed from a previous saved state as given here
2.2.3. Return:
- Type: View
- Description: View of the Register fragment
2.2.4. Variables:
| Name | Type | Description | Default Value |
|---|---|---|---|
| view | View | Object of View that receives the Fragment view through the XML | * * * |
| register | Button | Button that saves new registered user | * * * |
2.3. registerUser
2.3.1. Description:
- Registers new user in database
2.3.2. Return:
- Type: Void
2.3.3. Arguments:
- User user: Object that contains information of new user
2.3.4. Variables:
| Name | Type | Description | Default Value |
|---|---|---|---|
| userDAO | UserDAO | Object that comunicates with database | * * * |
2.4. startLoginActivity
2.4.1. Description:
- Starts login activity
2.4.2. Return:
- Type: Void
2.4.3. Arguments:
- No arguments
2.4.4. Variables:
| Name | Type | Description | Default Value |
|---|---|---|---|
| activity | Activity | Activity used in login | * * * |
| loginIntent | Intent | Intent constructed based on activity and LoginActivity class | * * * |
2.5. settingEditText
2.5.1. Description:
- Sets conditions to edit new user information
2.5.2. Return:
- Type: Void
2.5.3. Arguments:
- View view: Current view where the texts will be edited
2.5.4. Variables:
- No other variables
2.6. settingTextTyped
2.6.1. Description:
- Sets the previous typed text of the new user
2.6.2. Return:
- Type: Void
2.6.3. Arguments:
- No arguments
2.6.4. Variables:
- No other variables
2.7. onClick
2.7.1. Description:
- Sets the information typed on registration view on click
2.7.2. Return:
- Type: Void
2.7.3. Arguments:
- View view: Current clicked view
2.7.4. Variables:
- No other variables
2.8. validateUserInformation
2.8.1. Description:
- Validates user information and registers if is valid
2.8.2. Return:
- Type: Void
2.8.3. Arguments:
- No arguments
2.8.4. Variables:
| Name | Type | Description | Default Value |
|---|---|---|---|
| user | User | User to be registered in database | * * * |
| exceptionMessage | String | Exception message from invalid user information | * * * |