-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finished UI mockups for login page, register page, and user profile (#78
) * Finished UI mockups for login page, register page, and user profile * Pushing this commit because Owen is a soy boy * Changed main startup activity * switch to 1 XML (light mode) for login/register (#82) * Very rough draft of user profile/login/logout * Added unique username check * Updated to use authentication and encryption * moving off branch * Added user authentication with unique usernames * Finished * Added javadocs * Added bug fixes from Lukas * Added Owen's changes --------- Co-authored-by: Owen Cooke <90405643+owencooke@users.noreply.github.com>
- Loading branch information
1 parent
fb00691
commit 3bc765c
Showing
25 changed files
with
1,096 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
app/src/androidTest/java/com/example/househomey/SignInFragmentTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.example.househomey; | ||
import static androidx.test.espresso.Espresso.onView; | ||
import static androidx.test.espresso.action.ViewActions.clearText; | ||
import static androidx.test.espresso.action.ViewActions.click; | ||
import static androidx.test.espresso.action.ViewActions.typeText; | ||
import static androidx.test.espresso.assertion.ViewAssertions.matches; | ||
import static androidx.test.espresso.matcher.ViewMatchers.hasErrorText; | ||
import static androidx.test.espresso.matcher.ViewMatchers.withId; | ||
import static androidx.test.espresso.matcher.ViewMatchers.withText; | ||
|
||
import androidx.test.core.app.ActivityScenario; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
public class SignInFragmentTest { | ||
private ActivityScenario<SignInActivity> activityScenario; | ||
|
||
@Before | ||
public void setUp() { | ||
// Launch the activity before each test | ||
activityScenario = ActivityScenario.launch(SignInActivity.class); | ||
} | ||
|
||
@Test | ||
public void testUsername() { | ||
onView(withId(R.id.signin_username)).perform(typeText("antonio2")); | ||
onView(withId(R.id.signin_username)).perform(clearText()); | ||
onView(withId(R.id.signin_username)).check(matches(hasErrorText("username cannot be empty"))); | ||
onView(withId(R.id.signin_username)).perform(typeText("antonio2$")); | ||
onView(withId(R.id.signin_username)).check(matches(hasErrorText("only alphanumeric, underscore, or period"))); | ||
} | ||
|
||
@Test | ||
public void testPassword() { | ||
onView(withId(R.id.signin_password)).perform(typeText("123456")); | ||
onView(withId(R.id.signin_password)).perform(clearText()); | ||
onView(withId(R.id.signin_password)).check(matches(hasErrorText("password cannot be empty"))); | ||
} | ||
|
||
@Test | ||
public void testLogin() { | ||
|
||
} | ||
|
||
@After | ||
public void tearDown() { | ||
activityScenario.close(); | ||
} | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
app/src/androidTest/java/com/example/househomey/SignUpFragmentTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.example.househomey; | ||
|
||
public class SignUpFragmentTest { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
app/src/main/java/com/example/househomey/SignInActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.example.househomey; | ||
|
||
import static com.example.househomey.utils.FragmentUtils.navigateToFragmentPage; | ||
import static com.google.firebase.appcheck.internal.util.Logger.TAG; | ||
|
||
import android.os.Bundle; | ||
import android.os.Handler; | ||
import android.os.Looper; | ||
import android.text.Editable; | ||
import android.text.TextWatcher; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
import android.widget.TextView; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
import androidx.fragment.app.FragmentManager; | ||
import androidx.fragment.app.FragmentTransaction; | ||
|
||
import com.google.android.gms.tasks.OnCompleteListener; | ||
import com.google.android.gms.tasks.Task; | ||
import com.google.firebase.firestore.CollectionReference; | ||
import com.google.firebase.firestore.DocumentReference; | ||
import com.google.firebase.firestore.DocumentSnapshot; | ||
import com.google.firebase.firestore.FirebaseFirestore; | ||
|
||
import java.util.Objects; | ||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
|
||
/** | ||
* SignInActivity of the application, handles setting up the sign in page | ||
* @author Antonio Lech Martin-Ozimek | ||
*/ | ||
public class SignInActivity extends AppCompatActivity { | ||
|
||
/** | ||
* This launches the SignInActivity which is the basis for both the SignInFragment | ||
* and the SignUpFragment. Once the user has signed in we exit this activity. | ||
* | ||
* @param savedInstanceState A Bundle containing the activity's previously frozen state, or null | ||
* if there was none. | ||
*/ | ||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_signin); | ||
navigateToFragmentPage(this, new SignInFragment(), R.id.fragmentContainerSignIn); | ||
|
||
} | ||
} |
Oops, something went wrong.