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

Commit

Permalink
refactor ScoreBoardFragment.kt and genre_for_scoreboard.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
jiabaow committed May 22, 2022
1 parent 1be3220 commit aaea119
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ScoreBoardFragment : Fragment(), OnItemClickListener, View.OnClickListener
}

private fun selectScoreboard() {
val sortedBy = "scores/" + genre
val sortedBy = "scores/$genre"

requireView().findViewById<ConstraintLayout>(R.id.genrePerScoreboard).visibility = GONE
requireView().findViewById<NestedScrollView>(R.id.scoreboard_content_scrolling).visibility = VISIBLE
Expand Down Expand Up @@ -112,13 +112,13 @@ class ScoreBoardFragment : Fragment(), OnItemClickListener, View.OnClickListener
*/
override fun onItemClick(position: Int) {
val intent = Intent(requireActivity(), PublicProfileActivity::class.java)
intent.putExtra("UserId", players.get(position).uid)
intent.putExtra("UserId", players[position].uid)
intent.putExtra("ScoresOrFollowing", R.string.profile_scores.toString() )
startActivity(intent)
}

override fun onClick(v: View?) {
when(v!!.getId()) {
when(v!!.id) {
R.id.btsButton -> {
genre = "BTS"; selectScoreboard()
}
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/res/layout/genre_for_scoreboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
app:layout_constraintHorizontal_bias="0.066"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.687"></androidx.appcompat.widget.AppCompatButton>
app:layout_constraintVertical_bias="0.687" />

<Space
android:layout_width="wrap_content"
Expand All @@ -56,7 +56,7 @@
app:layout_constraintHorizontal_bias="0.933"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.687"></androidx.appcompat.widget.AppCompatButton>
app:layout_constraintVertical_bias="0.687" />
</LinearLayout>

<Space
Expand All @@ -80,7 +80,7 @@
app:layout_constraintHorizontal_bias="0.065"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.403"></androidx.appcompat.widget.AppCompatButton>
app:layout_constraintVertical_bias="0.403" />

<Space
android:layout_width="wrap_content"
Expand All @@ -99,7 +99,7 @@
app:layout_constraintHorizontal_bias="0.933"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.402"></androidx.appcompat.widget.AppCompatButton>
app:layout_constraintVertical_bias="0.402" />
</LinearLayout>

<Space
Expand All @@ -123,7 +123,7 @@
app:layout_constraintHorizontal_bias="0.074"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.136"></androidx.appcompat.widget.AppCompatButton>
app:layout_constraintVertical_bias="0.136" />

<Space
android:layout_width="wrap_content"
Expand All @@ -142,7 +142,7 @@
app:layout_constraintHorizontal_bias="0.937"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.136"></androidx.appcompat.widget.AppCompatButton>
app:layout_constraintVertical_bias="0.136" />
</LinearLayout>

</LinearLayout>
Expand Down

0 comments on commit aaea119

Please sign in to comment.