File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
java/com/tiansirk/countryquiz/ui Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 12
12
import android .view .View ;
13
13
import android .view .ViewGroup ;
14
14
15
+ import com .tiansirk .countryquiz .R ;
15
16
import com .tiansirk .countryquiz .databinding .FragmentMainMenuBinding ;
16
17
import com .tiansirk .countryquiz .model .Level ;
17
18
import com .tiansirk .countryquiz .model .Question ;
@@ -97,7 +98,8 @@ public void onDetach() {
97
98
/** This method will set the data in member fields to the views */
98
99
private void setDataToViews (){
99
100
binding .tvName .setText (mUser .getUsername ());
100
- binding .tvHighScore .setText (mUser .getTotalPoints ());
101
+ binding .tvLevel .setText (String .format (getString (R .string .level_main_menu_fragment ), mUser .getCompletedLevels ().size ()));
102
+ binding .tvHighScore .setText (String .format (getString (R .string .high_score_main_menu_fragment ), mUser .getTotalPoints ()));
101
103
}
102
104
103
105
/** This method will show the progressbar */
Original file line number Diff line number Diff line change 55
55
app : layout_constraintStart_toStartOf =" parent"
56
56
app : layout_constraintTop_toBottomOf =" @+id/tv_title" />
57
57
58
+ <TextView
59
+ android : id =" @+id/tv_level"
60
+ android : layout_width =" wrap_content"
61
+ android : layout_height =" wrap_content"
62
+ tools : text =" @string/level_main_menu_fragment"
63
+ app : layout_constraintBottom_toTopOf =" @+id/tv_high_score"
64
+ app : layout_constraintEnd_toEndOf =" parent"
65
+ app : layout_constraintHorizontal_bias =" 0.5"
66
+ app : layout_constraintStart_toStartOf =" parent"
67
+ app : layout_constraintTop_toBottomOf =" @+id/tv_name" />
68
+
58
69
<TextView
59
70
android : id =" @+id/tv_high_score"
60
71
android : layout_width =" wrap_content"
61
72
android : layout_height =" wrap_content"
62
73
tools : text =" @string/high_score_main_menu_fragment"
63
-
64
74
app : layout_constraintBottom_toTopOf =" @+id/btn_new_game"
65
75
app : layout_constraintEnd_toEndOf =" parent"
66
76
app : layout_constraintHorizontal_bias =" 0.5"
67
77
app : layout_constraintStart_toStartOf =" parent"
68
- app : layout_constraintTop_toBottomOf =" @+id/tv_name " />
78
+ app : layout_constraintTop_toBottomOf =" @+id/tv_level " />
69
79
</androidx .constraintlayout.widget.ConstraintLayout>
70
80
<ProgressBar
71
81
android : id =" @+id/pb_main_menu_fragment"
Original file line number Diff line number Diff line change 15
15
<string name =" welcome_fragment_2" >Loading data may take a few seconds. Please wait.</string >
16
16
<!-- MainMenuFragment -->
17
17
<string name =" title_main_menu_fragment" >Country Quiz</string >
18
- <string name =" high_score_main_menu_fragment" >High Score: %d</string >
18
+ <string name =" high_score_main_menu_fragment" >High score: %d</string >
19
+ <string name =" level_main_menu_fragment" >Level %d</string >
19
20
<string name =" name_main_menu_fragment" >Player 1</string >
20
21
<string name =" start_main_menu_fragment" >Start Game</string >
21
22
<string name =" continue_main_menu_fragment" >Continue Game</string >
49
50
<string name =" firebase_status_fmt" >Firebase UID: %s</string >
50
51
<string name =" emailpassword_status_fmt" >Email User: %1$s (verified: %2$b)</string >
51
52
53
+
52
54
</resources >
You can’t perform that action at this time.
0 commit comments