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

margaux/typing game score #257

Merged
merged 4 commits into from
May 7, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -223,6 +223,8 @@ class TypingGameActivity : GameActivity() {
findViewById<LinearLayout>(R.id.displayGuess).removeAllViews()
findViewById<EditText>(R.id.yourGuessET).text.clear()
findViewById<EditText>(R.id.yourGuessET).isEnabled = true
val score = gameManager.getCorrectSongs().size
findViewById<TextView>(R.id.playerScore).text = "@string/your_score_dot_dot $score"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it shows @string/your_score_dot_dot instead of "your score" when I tried it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
findViewById<TextView>(R.id.playerScore).text = "@string/your_score_dot_dot $score"
findViewById<TextView>(R.id.playerScore).text = "@string/your_score_dot_dot $score"

Great changes 😃
Small comment:

  • Can you change the string name according to the convention here [https://github.com/MaximeZmt/SDP_2022-Vibester/wiki] (We try to keep things ordered for new string like that 😉) It would be typingGame_yourScore (and can also change its place in the string.xml at the top of the file in the section if it exists or create TypingGame)

toggleNextBtnVisibility(false)
gameManager.playSong()
checkRunnable()
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/layout/activity_typing_game.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
android:layout_height="match_parent"
android:orientation="vertical">

<TextView
android:id="@+id/playerScore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="20sp"
android:text="@string/your_score_0"/>

<Space
android:layout_width="match_parent"
android:layout_height="51dp" />
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,6 @@
<string name="r_o_c_k">R O C K</string>
<string name="k_p_o_p">K P O P</string>
<string name="t_o_p_t_r_a_c_k_s">T O P T R A C K S</string>
<string name="your_score_0">Your score: 0</string>
<string name="your_score_dot_dot">\"Your score:\"</string>
</resources>