From c8b7f875146afeba86aadbe6b1349d5a80470930 Mon Sep 17 00:00:00 2001 From: kresimirgotovac <133273109+kresimirgotovac@users.noreply.github.com> Date: Sun, 13 Aug 2023 22:44:06 -0400 Subject: [PATCH 1/4] front end match list java docs --- .../java/com/courseproject/tindar/ui/home/HomeFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/courseproject/tindar/ui/home/HomeFragment.java b/app/src/main/java/com/courseproject/tindar/ui/home/HomeFragment.java index 8bfcd1e..339eaf9 100644 --- a/app/src/main/java/com/courseproject/tindar/ui/home/HomeFragment.java +++ b/app/src/main/java/com/courseproject/tindar/ui/home/HomeFragment.java @@ -14,9 +14,11 @@ import com.courseproject.tindar.R; import com.courseproject.tindar.databinding.FragmentHomeBinding; - +/** This class implements the home screen fragment of the app */ public class HomeFragment extends Fragment { + /** FragmentHomeBinding instance to help display home page */ private FragmentHomeBinding binding; + /** ImageView of home screen */ ImageView home; /** From 68fabb718937420d51417aff186d66896563f7ac Mon Sep 17 00:00:00 2001 From: kresimirgotovac <133273109+kresimirgotovac@users.noreply.github.com> Date: Sun, 13 Aug 2023 22:51:24 -0400 Subject: [PATCH 2/4] remaining java docs --- .../ui/home/SecondViewProfileFragment.java | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/courseproject/tindar/ui/home/SecondViewProfileFragment.java b/app/src/main/java/com/courseproject/tindar/ui/home/SecondViewProfileFragment.java index 9833d0f..7dd3d94 100644 --- a/app/src/main/java/com/courseproject/tindar/ui/home/SecondViewProfileFragment.java +++ b/app/src/main/java/com/courseproject/tindar/ui/home/SecondViewProfileFragment.java @@ -39,28 +39,43 @@ import java.util.Locale; import java.util.concurrent.TimeUnit; +/** This class implements a second home view fragment in order to switch between profiles + * to like/unline + */ public class SecondViewProfileFragment extends Fragment { + /** boolean to see if a user does like the other */ boolean doesLike; + /** current user id index */ private int currentViewProfileUserIdIndex; + /** the other users userId*/ private String otherUserId; - + /** the current users userId */ private String userId; + /** a list containing all userIds */ private ArrayList allUserIds; - + /** FragmentHomeBinding instance to help display second view profile screen */ private FragmentSecondViewProfileBinding binding; + /** BlankViewModel instance for a blank view */ private BlankNavViewModel blankNavViewModel; - + /** image of like button */ ImageButton likeButton; + /** text veiw of display name */ TextView displayNameView; + /** text view of preferred gender */ TextView genderView; + /** text view of birthdate */ TextView birthdateView; + /** text view of location */ TextView locationView; + /** text view of about me information*/ TextView aboutMeView; + /** profile photo image */ ImageView profilePic; + /** string link to profile */ String profileLink; - + /** ViewProfilesController instance for methods*/ ViewProfilesController viewProfilesController; - + /** instantiate a DateFormat to have a consistent date format */ private final DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy", Locale.CANADA ); /** From 4ded5c0e6c982fb4760c2d6fadc1609c7038413f Mon Sep 17 00:00:00 2001 From: yiwxng Date: Sun, 13 Aug 2023 23:11:54 -0400 Subject: [PATCH 3/4] added javadoc for login and userlist in usercase --- .../tindar/usecases/login/LoginDsGateway.java | 13 +++++++++++ .../usecases/login/LoginInputBoundary.java | 21 +++++++++++++++++ .../usecases/login/LoginInteractor.java | 23 +++++++++++++++++++ .../usecases/userlist/UserListDsGateway.java | 11 +++++++++ .../userlist/UserListInputBoundary.java | 12 ++++++++++ .../usecases/userlist/UserListInteractor.java | 17 +++++++++++++- 6 files changed, 96 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/courseproject/tindar/usecases/login/LoginDsGateway.java b/app/src/main/java/com/courseproject/tindar/usecases/login/LoginDsGateway.java index a23fa40..a82f03c 100644 --- a/app/src/main/java/com/courseproject/tindar/usecases/login/LoginDsGateway.java +++ b/app/src/main/java/com/courseproject/tindar/usecases/login/LoginDsGateway.java @@ -1,5 +1,18 @@ package com.courseproject.tindar.usecases.login; +/** + * This interface defines the gateway for accessing the data source related to user login + * information. + * It provides methods to read user IDs based on their email and password. + */ public interface LoginDsGateway { + + /** + * Retrieves the user ID associated with the given email and password. + * + * @param email The email address of the user. + * @param password The password of the user. + * @return The user ID if the email and password match; otherwise, null. + */ String readUserId(String email, String password); } diff --git a/app/src/main/java/com/courseproject/tindar/usecases/login/LoginInputBoundary.java b/app/src/main/java/com/courseproject/tindar/usecases/login/LoginInputBoundary.java index 5b47c0a..de6f78f 100644 --- a/app/src/main/java/com/courseproject/tindar/usecases/login/LoginInputBoundary.java +++ b/app/src/main/java/com/courseproject/tindar/usecases/login/LoginInputBoundary.java @@ -1,6 +1,27 @@ package com.courseproject.tindar.usecases.login; +/** + * This interface defines the input boundary for the user login use case. + * It provides methods for checking user credentials and retrieving user IDs based on email + * and password. + */ public interface LoginInputBoundary { + + /** + * Checks whether the provided email and password match a user's credentials. + * + * @param email The email address of the user. + * @param password The password of the user. + * @return boolean True if the provided credentials are valid, otherwise + */ Boolean checkUserPassword(String email, String password); + + /** + * Retrieves the user ID associated with the given email and password. + * + * @param email The email address of the user. + * @param password The password of the user. + * @return The user ID if the email and password are valid, otherwise null + */ String getUserId(String email, String password); } diff --git a/app/src/main/java/com/courseproject/tindar/usecases/login/LoginInteractor.java b/app/src/main/java/com/courseproject/tindar/usecases/login/LoginInteractor.java index fd737e8..a4fa450 100644 --- a/app/src/main/java/com/courseproject/tindar/usecases/login/LoginInteractor.java +++ b/app/src/main/java/com/courseproject/tindar/usecases/login/LoginInteractor.java @@ -1,18 +1,41 @@ package com.courseproject.tindar.usecases.login; +/** + * This class implements the login use case's input boundary. + * It interacts with the data source gateway to authenticate users and retrieve user IDs. + */ public class LoginInteractor implements LoginInputBoundary { final LoginDsGateway loginDsGateway; + /** + * Constructs a new LoginInteractor with the specified LoginDsGateway. + * + * @param loginDsGateway The data source gateway for login-related operations. + */ public LoginInteractor(LoginDsGateway loginDsGateway){ this.loginDsGateway = loginDsGateway; } + /** + * Checks whether the provided email and password match a user's credentials. + * + * @param email The email address of the user. + * @param password The password of the user. + * @return Boolean if the provided credentials are valid, otherwise false + */ @Override public Boolean checkUserPassword(String email, String password){ return !(loginDsGateway.readUserId(email, password) == null); } + /** + * Retrieves the user ID associated with the given email and password. + * + * @param email The email address of the user. + * @param password The password of the user. + * @return The user ID if the email and password are valid, otherwise null + */ @Override public String getUserId(String email, String password){ return loginDsGateway.readUserId(email, password); diff --git a/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListDsGateway.java b/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListDsGateway.java index 08be468..e445c46 100644 --- a/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListDsGateway.java +++ b/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListDsGateway.java @@ -2,6 +2,17 @@ import java.util.ArrayList; +/** + * This interface defines the gateway for accessing the data source related to user lists. + * It provides a method to retrieve a list of user IDs excluding the provided user's ID. + */ public interface UserListDsGateway { + + /** + * Retrieves a list of user IDs excluding the provided user's ID. + * + * @param userId The ID of the user for whom the list is being generated. + * @return An ArrayList containing the user IDs of other users, excluding the provided user's ID. + */ ArrayList getAllOtherUserIds(String userId); } diff --git a/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListInputBoundary.java b/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListInputBoundary.java index 86d02b8..e7a884c 100644 --- a/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListInputBoundary.java +++ b/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListInputBoundary.java @@ -2,6 +2,18 @@ import java.util.ArrayList; +/** + * This interface defines the input boundary for the user list use case. + * It provides a method to retrieve a list of user IDs excluding the provided user's ID. + */ public interface UserListInputBoundary { + + + /** + * Retrieves a list of user IDs excluding the provided user's ID. + * + * @param userId The ID of the user for whom the list is being generated. + * @return An ArrayList containing the user IDs of other users, excluding the provided user's ID. + */ ArrayList getAllOtherUserIds(String userId); } diff --git a/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListInteractor.java b/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListInteractor.java index 4730de8..2de9d2f 100644 --- a/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListInteractor.java +++ b/app/src/main/java/com/courseproject/tindar/usecases/userlist/UserListInteractor.java @@ -1,15 +1,30 @@ package com.courseproject.tindar.usecases.userlist; import java.util.ArrayList; - +/** + * This class implements the user list use case's input boundary. + * It interacts with the data source gateway to retrieve a list of user IDs excluding the + * provided user's ID. + */ public class UserListInteractor implements UserListInputBoundary{ final UserListDsGateway userListDsGateway; + /** + * Constructs a new UserListInteractor with the specified UserListDsGateway. + * + * @param userListDsGateway The data source gateway for user list-related operations. + */ public UserListInteractor(UserListDsGateway userListDsGateway) { this.userListDsGateway = userListDsGateway; } + /** + * Retrieves a list of user IDs excluding the provided user's ID. + * + * @param userId The ID of the user for whom the list is being generated. + * @return An ArrayList containing the user IDs of other users, excluding the provided user's ID. + */ public ArrayList getAllOtherUserIds(String userId){ return userListDsGateway.getAllOtherUserIds(userId); } From 6cbe11016b1801b998c0545aeaf56a5fc25a58bf Mon Sep 17 00:00:00 2001 From: kresimirgotovac <133273109+kresimirgotovac@users.noreply.github.com> Date: Sun, 13 Aug 2023 23:13:09 -0400 Subject: [PATCH 4/4] remaining java docs --- .../ui/home/SecondViewProfileFragment.java | 2 +- .../tindar/ui/home/ViewProfileFragment.java | 26 ++++++++++++++----- .../tindar/ui/login/LoginActivity.java | 8 ++++-- .../ui/settings/ChangeEmailActivity.java | 16 +++++++----- .../ui/settings/ChangePasswordActivity.java | 15 ++++++----- .../tindar/ui/settings/SettingsActivity.java | 12 +++++---- 6 files changed, 51 insertions(+), 28 deletions(-) diff --git a/app/src/main/java/com/courseproject/tindar/ui/home/SecondViewProfileFragment.java b/app/src/main/java/com/courseproject/tindar/ui/home/SecondViewProfileFragment.java index 7dd3d94..a356997 100644 --- a/app/src/main/java/com/courseproject/tindar/ui/home/SecondViewProfileFragment.java +++ b/app/src/main/java/com/courseproject/tindar/ui/home/SecondViewProfileFragment.java @@ -40,7 +40,7 @@ import java.util.concurrent.TimeUnit; /** This class implements a second home view fragment in order to switch between profiles - * to like/unline + * to like/unlike. */ public class SecondViewProfileFragment extends Fragment { /** boolean to see if a user does like the other */ diff --git a/app/src/main/java/com/courseproject/tindar/ui/home/ViewProfileFragment.java b/app/src/main/java/com/courseproject/tindar/ui/home/ViewProfileFragment.java index 04fddc4..5ee0c9b 100644 --- a/app/src/main/java/com/courseproject/tindar/ui/home/ViewProfileFragment.java +++ b/app/src/main/java/com/courseproject/tindar/ui/home/ViewProfileFragment.java @@ -38,29 +38,43 @@ import java.util.ArrayList; import java.util.Locale; import java.util.concurrent.TimeUnit; - +/** This class implements a home view fragment in order to switch between profiles + * to like/unlike. + */ public class ViewProfileFragment extends Fragment { + /** boolean to see if a user does like the other */ boolean doesLike; + /** current user id index */ private int currentViewProfileUserIdIndex; + /** the other users userId*/ private String otherUserId; - + /** the current users userId */ private String userId; + /** a list containing all userIds */ private ArrayList allUserIds; - + /** FragmentHomeBinding instance to help display second view profile screen */ private FragmentViewProfileBinding binding; + /** BlankViewModel instance for a blank view */ private BlankNavViewModel blankNavViewModel; - + /** image of like button */ ImageButton likeButton; + /** text veiw of display name */ TextView displayNameView; + /** text view of preferred gender */ TextView genderView; + /** text view of birthdate */ TextView birthdateView; + /** text view of location */ TextView locationView; + /** text view of about me information*/ TextView aboutMeView; + /** profile photo image */ ImageView profilePic; + /** string link to profile */ String profileLink; - + /** ViewProfilesController instance for methods*/ ViewProfilesController viewProfilesController; - + /** instantiate a DateFormat to have a consistent date format */ private final DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy", Locale.CANADA ); /** diff --git a/app/src/main/java/com/courseproject/tindar/ui/login/LoginActivity.java b/app/src/main/java/com/courseproject/tindar/ui/login/LoginActivity.java index 1871c33..ae34903 100644 --- a/app/src/main/java/com/courseproject/tindar/ui/login/LoginActivity.java +++ b/app/src/main/java/com/courseproject/tindar/ui/login/LoginActivity.java @@ -19,12 +19,16 @@ import com.courseproject.tindar.usecases.login.LoginDsGateway; import com.courseproject.tindar.usecases.login.LoginInteractor; +/** This class implements the Login Activity for the front end. Allows the user to see and manipulate + * the log-in actions */ public class LoginActivity extends AppCompatActivity { - + /** edit email text box */ private EditText emailText; + /** edit password text box */ private EditText passwordText; - + /** string containing the users email */ private String email; + /** string containing the users password */ private String password; /** diff --git a/app/src/main/java/com/courseproject/tindar/ui/settings/ChangeEmailActivity.java b/app/src/main/java/com/courseproject/tindar/ui/settings/ChangeEmailActivity.java index e61df27..6033126 100644 --- a/app/src/main/java/com/courseproject/tindar/ui/settings/ChangeEmailActivity.java +++ b/app/src/main/java/com/courseproject/tindar/ui/settings/ChangeEmailActivity.java @@ -14,23 +14,25 @@ import com.courseproject.tindar.usecases.editaccount.EditAccountDsGateway; import com.courseproject.tindar.usecases.editaccount.EditAccountInteractor; +/** This class implements the ability to change the users long-in email after creating an account + */ public class ChangeEmailActivity extends AppCompatActivity { - // Button that sends user back to the settings screen. + /** Button that sends user back to the settings screen. */ ImageButton changeEmailBackButton; - // Button that submits changes to the email. + /** Button that submits changes to the email.*/ Button submitEmailChangeButton; - // Text box to put in new email. + /** Text box to put in new email.*/ EditText changeEmailText; - // Text box to put in new email again. + /** Text box to put in new email again.*/ EditText changeEmailRetype; - // Text box to put in the current password for validation. + /** Text box to put in the current password for validation.*/ EditText changeEmailPasswordValidation; - // userId of the account. + /*8 userId of the account.*/ String userId; /** * Creates the email change screen for the user to view. - * + * @param savedInstanceState the saved instance state */ @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/app/src/main/java/com/courseproject/tindar/ui/settings/ChangePasswordActivity.java b/app/src/main/java/com/courseproject/tindar/ui/settings/ChangePasswordActivity.java index f13a4fd..bca8a66 100644 --- a/app/src/main/java/com/courseproject/tindar/ui/settings/ChangePasswordActivity.java +++ b/app/src/main/java/com/courseproject/tindar/ui/settings/ChangePasswordActivity.java @@ -13,19 +13,20 @@ import com.courseproject.tindar.ds.DatabaseHelper; import com.courseproject.tindar.usecases.editaccount.EditAccountDsGateway; import com.courseproject.tindar.usecases.editaccount.EditAccountInteractor; - +/** This class implements the ability to change the users password after creating an account + */ public class ChangePasswordActivity extends AppCompatActivity { - // Button that sends the user back to the settings screen. + /** Button that sends the user back to the settings screen.*/ ImageButton changePasswordBackButton; - // Button that submits the changes to the password. + /** Button that submits the changes to the password.*/ Button submitPasswordChangeButton; - // Text box that contains the new password. + /** Text box that contains the new password.*/ EditText changePasswordText; - // Text box to type the new password a second time. + /** Text box to type the new password a second time.*/ EditText changePasswordRetype; - // Text box to type the current password for validation. + /** Text box to type the current password for validation.*/ EditText changePasswordValidation; - // The user id of the account. + /** The user id of the account.*/ String userId; /** diff --git a/app/src/main/java/com/courseproject/tindar/ui/settings/SettingsActivity.java b/app/src/main/java/com/courseproject/tindar/ui/settings/SettingsActivity.java index 25f08c3..c3915a1 100644 --- a/app/src/main/java/com/courseproject/tindar/ui/settings/SettingsActivity.java +++ b/app/src/main/java/com/courseproject/tindar/ui/settings/SettingsActivity.java @@ -7,15 +7,17 @@ import android.os.Bundle; import com.courseproject.tindar.BlankNavActivity; import com.courseproject.tindar.R; - +/** This class implements settings activity that allows the user to change account information + * like email or password. + */ public class SettingsActivity extends AppCompatActivity { - // Button that sends user to change email screen. + /** Button that sends user to change email screen.*/ Button changeEmailButton; - // Button that sends user to change password screen. + /** Button that sends user to change password screen.*/ Button changePasswordButton; - // Button that sends user back to the home screen. + /** Button that sends user back to the home screen.*/ ImageButton settingsBackButton; - // userId of the account. + /** userId of the account.*/ String userId; /**