diff --git a/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomSuccessTest.java b/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomSuccessTest.java index e5601df6..8c599679 100644 --- a/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomSuccessTest.java +++ b/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomSuccessTest.java @@ -18,6 +18,7 @@ import android.view.ViewParent; import androidx.test.espresso.ViewInteraction; +import androidx.test.espresso.matcher.ViewMatchers; import androidx.test.ext.junit.rules.ActivityScenarioRule; import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.LargeTest; @@ -54,7 +55,7 @@ public void bookCancelStudyRoomSuccessTest() { ViewInteraction ic = onView( allOf(withText("Sign in"), childAtPosition( - allOf(withId(R.id.sign_in_button), + allOf(ViewMatchers.withId(R.id.sign_in_button), childAtPosition( withClassName(is("androidx.constraintlayout.widget.ConstraintLayout")), 0)), diff --git a/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomsFailure2ATest.java b/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomsFailure2ATest.java index 54e167b9..79fa315c 100644 --- a/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomsFailure2ATest.java +++ b/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomsFailure2ATest.java @@ -32,7 +32,6 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; -import org.hamcrest.Matchers; import org.hamcrest.TypeSafeMatcher; import org.junit.Rule; import org.junit.Test; @@ -51,7 +50,7 @@ public void bookStudyRoomFailure2ATest() { ViewInteraction ic = onView( allOf(withText("Sign in"), childAtPosition( - Matchers(ViewMatchers(R.id.sign_in_button), + allOf(ViewMatchers.withId(R.id.sign_in_button), childAtPosition( withClassName(is("androidx.constraintlayout.widget.ConstraintLayout")), 0)), diff --git a/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomsFailure4ATest.java b/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomsFailure4ATest.java index a0ab75b6..25a1e77e 100644 --- a/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomsFailure4ATest.java +++ b/front_end/app/src/androidTest/java/com/javajedis/bookit/book_cancel_study_rooms_use_case/BookCancelStudyRoomsFailure4ATest.java @@ -34,7 +34,6 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; -import org.hamcrest.Matchers; import org.hamcrest.TypeSafeMatcher; import org.hamcrest.core.IsInstanceOf; import org.junit.Rule; @@ -56,7 +55,7 @@ public void bookCancelFailure4ATest() { ViewInteraction ic = onView( allOf(withText("Sign in"), childAtPosition( - Matchers.allOf(ViewMatchers.withId(R.id.sign_in_button), + allOf(ViewMatchers.withId(R.id.sign_in_button), childAtPosition( withClassName(is("androidx.constraintlayout.widget.ConstraintLayout")), 0)), diff --git a/front_end/app/src/androidTest/java/com/javajedis/bookit/confirm_attendance_use_case/ConfirmAttendanceFailure3ATest.java b/front_end/app/src/androidTest/java/com/javajedis/bookit/confirm_attendance_use_case/ConfirmAttendanceFailure3ATest.java index d0d5765b..67db3ba2 100644 --- a/front_end/app/src/androidTest/java/com/javajedis/bookit/confirm_attendance_use_case/ConfirmAttendanceFailure3ATest.java +++ b/front_end/app/src/androidTest/java/com/javajedis/bookit/confirm_attendance_use_case/ConfirmAttendanceFailure3ATest.java @@ -31,7 +31,6 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; -import org.hamcrest.Matchers; import org.hamcrest.TypeSafeMatcher; import org.junit.Rule; import org.junit.Test; @@ -55,7 +54,7 @@ public void confirmAttendanceFailure3ATest() { ViewInteraction ic = onView( allOf(withText("Sign in"), childAtPosition( - Matchers.allOf(ViewMatchers.withId(R.id.sign_in_button), + allOf(ViewMatchers.withId(R.id.sign_in_button), childAtPosition( withClassName(is("androidx.constraintlayout.widget.ConstraintLayout")), 0)), diff --git a/front_end/app/src/androidTest/java/com/javajedis/bookit/confirm_attendance_use_case/ConfirmAttendanceSuccessTest.java b/front_end/app/src/androidTest/java/com/javajedis/bookit/confirm_attendance_use_case/ConfirmAttendanceSuccessTest.java index 3ca143d7..60f7cace 100644 --- a/front_end/app/src/androidTest/java/com/javajedis/bookit/confirm_attendance_use_case/ConfirmAttendanceSuccessTest.java +++ b/front_end/app/src/androidTest/java/com/javajedis/bookit/confirm_attendance_use_case/ConfirmAttendanceSuccessTest.java @@ -30,7 +30,6 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; -import org.hamcrest.Matchers; import org.hamcrest.TypeSafeMatcher; import org.hamcrest.core.IsInstanceOf; import org.junit.Rule; @@ -56,7 +55,7 @@ public void confirmAttendanceSuccessTest() { ViewInteraction ic = onView( allOf(withText("Sign in"), childAtPosition( - Matchers.allOf(ViewMatchers.withId(R.id.sign_in_button), + allOf(ViewMatchers.withId(R.id.sign_in_button), childAtPosition( withClassName(is("androidx.constraintlayout.widget.ConstraintLayout")), 0)), diff --git a/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsFailure8ATest.java b/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsFailure8ATest.java index 24526557..811e6276 100644 --- a/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsFailure8ATest.java +++ b/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsFailure8ATest.java @@ -28,7 +28,6 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; -import org.hamcrest.Matchers; import org.hamcrest.TypeSafeMatcher; import org.junit.Rule; import org.junit.Test; @@ -47,7 +46,7 @@ public void filterStudyRoomsFailure8ATest() { ViewInteraction ic = onView( allOf(withText("Sign in"), childAtPosition( - Matchers.allOf(ViewMatchers.withId(R.id.sign_in_button), + allOf(ViewMatchers.withId(R.id.sign_in_button), childAtPosition( withClassName(is("androidx.constraintlayout.widget.ConstraintLayout")), 0)), diff --git a/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsFailure8BTest.java b/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsFailure8BTest.java index d46ce1c8..bd0f2889 100644 --- a/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsFailure8BTest.java +++ b/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsFailure8BTest.java @@ -33,7 +33,6 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; -import org.hamcrest.Matchers; import org.hamcrest.TypeSafeMatcher; import org.hamcrest.core.IsInstanceOf; import org.junit.Rule; @@ -59,7 +58,7 @@ public void filterStudyRoomsFailure8BTest() { ViewInteraction ic = onView( allOf(withText("Sign in"), childAtPosition( - Matchers.allOf(ViewMatchers.withId(R.id.sign_in_button), + allOf(ViewMatchers.withId(R.id.sign_in_button), childAtPosition( withClassName(is("androidx.constraintlayout.widget.ConstraintLayout")), 0)), diff --git a/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsSuccessTest.java b/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsSuccessTest.java index 6d4aad80..c9bb9d0b 100644 --- a/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsSuccessTest.java +++ b/front_end/app/src/androidTest/java/com/javajedis/bookit/filter_study_rooms_use_case/FilterStudyRoomsSuccessTest.java @@ -35,7 +35,6 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; -import org.hamcrest.Matchers; import org.hamcrest.TypeSafeMatcher; import org.hamcrest.core.IsInstanceOf; import org.junit.Rule; @@ -61,7 +60,7 @@ public void filterStudyRoomsSuccessTest() { ViewInteraction ic = onView( allOf(withText("Sign in"), childAtPosition( - Matchers.allOf(ViewMatchers.withId(R.id.sign_in_button), + allOf(ViewMatchers.withId(R.id.sign_in_button), childAtPosition( withClassName(is("androidx.constraintlayout.widget.ConstraintLayout")), 0)), diff --git a/front_end/app/src/androidTest/java/com/javajedis/bookit/nonfunctional_requirements/AttendanceConfirmationIn3ClicksTest.java b/front_end/app/src/androidTest/java/com/javajedis/bookit/nonfunctional_requirements/AttendanceConfirmationIn3ClicksTest.java index ba13794c..f6f0c8ca 100644 --- a/front_end/app/src/androidTest/java/com/javajedis/bookit/nonfunctional_requirements/AttendanceConfirmationIn3ClicksTest.java +++ b/front_end/app/src/androidTest/java/com/javajedis/bookit/nonfunctional_requirements/AttendanceConfirmationIn3ClicksTest.java @@ -31,7 +31,6 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; -import org.hamcrest.Matchers; import org.hamcrest.TypeSafeMatcher; import org.hamcrest.core.IsInstanceOf; import org.junit.Rule; @@ -57,7 +56,7 @@ public void attendanceConfirmationIn3ClicksTest() { ViewInteraction ic = onView( allOf(withText("Sign in"), childAtPosition( - Matchers.allOf(ViewMatchers.withId(R.id.sign_in_button), + allOf(ViewMatchers.withId(R.id.sign_in_button), childAtPosition( withClassName(is("androidx.constraintlayout.widget.ConstraintLayout")), 0)), diff --git a/front_end/app/src/androidTest/java/com/javajedis/bookit/nonfunctional_requirements/SearchFilterShowsResultsIn1SecondTest.java b/front_end/app/src/androidTest/java/com/javajedis/bookit/nonfunctional_requirements/SearchFilterShowsResultsIn1SecondTest.java index 34942853..549c08b3 100644 --- a/front_end/app/src/androidTest/java/com/javajedis/bookit/nonfunctional_requirements/SearchFilterShowsResultsIn1SecondTest.java +++ b/front_end/app/src/androidTest/java/com/javajedis/bookit/nonfunctional_requirements/SearchFilterShowsResultsIn1SecondTest.java @@ -36,7 +36,6 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; -import org.hamcrest.Matchers; import org.hamcrest.TypeSafeMatcher; import org.hamcrest.core.IsInstanceOf; import org.junit.Rule; @@ -61,7 +60,7 @@ public void filterStudyRoomsSuccessTest() { ViewInteraction ic = onView( allOf(withText("Sign in"), childAtPosition( - Matchers.allOf(ViewMatchers.withId(R.id.sign_in_button), + allOf(ViewMatchers.withId(R.id.sign_in_button), childAtPosition( withClassName(is("androidx.constraintlayout.widget.ConstraintLayout")), 0)), diff --git a/front_end/app/src/main/java/com/javajedis/bookit/SearchActivity.java b/front_end/app/src/main/java/com/javajedis/bookit/SearchActivity.java index 2f2216a7..3c278cf7 100644 --- a/front_end/app/src/main/java/com/javajedis/bookit/SearchActivity.java +++ b/front_end/app/src/main/java/com/javajedis/bookit/SearchActivity.java @@ -41,7 +41,6 @@ public class SearchActivity extends AppCompatActivity implements RecyclerViewInt "IRC", "LASR", "LIFE", "LSK", "MATH", "MATX", "MCLD", "MCML", "ORCH", "OSB1", "PHRM", "PCN", "SCRF", "SOWK", "SPPH", "SWNG", "UCEN", "WESB"}; - private final String[] allBuildingNames = allBuildingCodes; private final ArrayList informalLearningSpaceBuildingCodes = new ArrayList<>(); private final ArrayList informalLearningSpaceBuildingNames = new ArrayList<>(); private final ArrayList lectureHallBuildingCodes = new ArrayList<>(); @@ -50,7 +49,6 @@ public class SearchActivity extends AppCompatActivity implements RecyclerViewInt private final ArrayList studyRoomBuildingNames = new ArrayList<>(); private ArrayList showingBuildingCodes; - private ArrayList showingBuildingNames; private ArrayList showingBuildingList; private String requestBuildingType = ""; private TextView guideText; @@ -151,7 +149,6 @@ private void setButtonListener(Button button, String spaceType) { switch (spaceType) { case "": showingBuildingCodes = new ArrayList<>(); - showingBuildingNames = new ArrayList<>(); informalLearningSpaceButton.setBackgroundResource(R.drawable.bottom_button); lectureHallButton.setBackgroundResource(R.drawable.top_button); @@ -159,7 +156,6 @@ private void setButtonListener(Button button, String spaceType) { break; case "ils": showingBuildingCodes = informalLearningSpaceBuildingCodes; - showingBuildingNames = informalLearningSpaceBuildingNames; // setting button background informalLearningSpaceButton.setBackgroundResource(R.drawable.bottom_button); lectureHallButton.setBackgroundResource(R.drawable.top_button); @@ -167,7 +163,6 @@ private void setButtonListener(Button button, String spaceType) { break; case "lecturehalls": showingBuildingCodes = lectureHallBuildingCodes; - showingBuildingNames = lectureHallBuildingNames; // setting button background informalLearningSpaceButton.setBackgroundResource(R.drawable.top_button); lectureHallButton.setBackgroundResource(R.drawable.bottom_button); @@ -175,7 +170,6 @@ private void setButtonListener(Button button, String spaceType) { break; case "studyrooms": showingBuildingCodes = studyRoomBuildingCodes; - showingBuildingNames = studyRoomBuildingNames; // setting button background informalLearningSpaceButton.setBackgroundResource(R.drawable.top_button); lectureHallButton.setBackgroundResource(R.drawable.top_button); @@ -183,7 +177,9 @@ private void setButtonListener(Button button, String spaceType) { break; default: showingBuildingCodes = new ArrayList<>(Arrays.asList(allBuildingCodes)); - showingBuildingCodes = new ArrayList<>(Arrays.asList(allBuildingNames)); + informalLearningSpaceButton.setBackgroundResource(R.drawable.top_button); + lectureHallButton.setBackgroundResource(R.drawable.top_button); + studyRoomButton.setBackgroundResource(R.drawable.top_button); break; }