Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Jwen/scoreboard UI fix #230

Merged
merged 4 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,20 @@ class ScoreBoardActivityTest {
@Test
fun rockBtnShouldSetUpRecycleView() {
onView(withId(R.id.rockButton)).perform(click())
onView(withId(R.id.scoreboard)).check(matches(isDisplayed()))
onView(withId(R.id.scoreboard_content_scrolling)).check(matches(isDisplayed()))
}

//TODO fix this test
@Test
fun rockBtnShouldEnableRecycleViewClick() {
onView(withId(R.id.rockButton)).perform(click())

// @Test
// fun rockBtnShouldEnableRecycleViewClick() {
// onView(withId(R.id.rockButton)).perform(click())
//
// onView((withId(R.id.scoreboard)))
// .perform(
// RecyclerViewActions.actionOnItemAtPosition<RecyclerView.ViewHolder>(
// 2, click()
// )
// )
// }
onView((withId(R.id.recycler_view)))
.perform(
RecyclerViewActions.actionOnItemAtPosition<RecyclerView.ViewHolder>(
2, click()
)
)
}

@Test
fun topBtnClick() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.view.View.GONE
import android.view.View.VISIBLE
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.widget.NestedScrollView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import ch.sdp.vibester.R
Expand Down Expand Up @@ -48,7 +49,7 @@ class ScoreBoardActivity : AppCompatActivity() {
}

findViewById<ConstraintLayout>(R.id.genrePerScoreboard).visibility = GONE
findViewById<ConstraintLayout>(R.id.scoreboard).visibility = VISIBLE
findViewById<NestedScrollView>(R.id.scoreboard_content_scrolling).visibility = VISIBLE

loadPlayersSortedBy(sortedBy)
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/genre_for_scoreboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/genrePerScoreboard"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/floral_white">

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/billieEilishButton"
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/layout/scoreboard_content_scrolling.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scoreboard_content_scrolling"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/floral_white"
android:visibility="gone"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<RelativeLayout
Expand All @@ -17,8 +19,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:scrollbars="none" />
android:scrollbars="none"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />

</RelativeLayout>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/scoreboard_item_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
android:layout_height="wrap_content"
android:textSize="30sp"
android:textStyle="bold"
android:textColor="@color/colorBtpn"
android:textColor="@color/colorBtn"
tools:text="54" />
</LinearLayout>

Expand Down
47 changes: 20 additions & 27 deletions app/src/main/res/layout/scoreboard_scoreboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,35 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<include layout="@layout/genre_for_scoreboard" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/scoreboard"
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="none"
app:popupTheme="@style/AppTheme.PopupOverlay">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
<TextView
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="none"
app:popupTheme="@style/AppTheme.PopupOverlay">
android:layout_height="wrap_content"
android:text="@string/scoreboard"
android:textAlignment="center"
android:textColor="#ffffff"
android:textSize="18sp"
android:textStyle="bold" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/scoreboard"
android:textAlignment="center"
android:textColor="#ffffff"
android:textSize="18sp"
android:textStyle="bold" />
</androidx.appcompat.widget.Toolbar>

</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>

</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/genre_for_scoreboard" />

<include layout="@layout/scoreboard_content_scrolling" />
</androidx.constraintlayout.widget.ConstraintLayout>
<include layout="@layout/scoreboard_content_scrolling" />


</androidx.coordinatorlayout.widget.CoordinatorLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<color name="colorPrimaryDark">#b66119</color>
<color name="colorAccent">#FF4081</color>
<color name="colorText">#FF000000</color>
<color name="colorBtpn">#f58220</color>
<color name="colorBtn">#f58220</color>
<color name="light_blue_600">#FF039BE5</color>
<color name="light_blue_900">#FF01579B</color>
<color name="light_blue_A200">#FF40C4FF</color>
Expand Down