Skip to content

Commit

Permalink
fixed Level on MoreBottomSheetFragment
Browse files Browse the repository at this point in the history
  • Loading branch information
neeldoshii committed Dec 1, 2024
1 parent 293cbeb commit 871c0ff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,18 @@ class MoreBottomSheetFragment : BottomSheetDialogFragment() {
private fun setUserName() {
val store = BasicKvStore(requireContext(), getUserName())
val level = store.getString("userAchievementsLevel", "0")
binding?.moreProfile?.text = if (level == "0") {
"${getUserName()} (${getString(R.string.see_your_achievements)})"
if (level == "0"){
binding?.moreProfile?.text = getString(
R.string.profileLevel,
getUserName(),
getString(R.string.see_your_achievements) // Second argument
)
} else {
"${getUserName()} (${getString(R.string.level)} $level)"
binding?.moreProfile?.text = getString(
R.string.profileLevel,
getUserName(),
level
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ class AchievementsFragment : CommonsDaggerSupportFragment(){
)
)
binding.achievementBadgeText.text = levelInfo.levelNumber.toString()
val store = BasicKvStore(this.context, userName)
val store = BasicKvStore(requireContext(), userName)
store.putString("userAchievementsLevel", levelInfo.levelNumber.toString())
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@
<string name="statistics_featured">Featured Images</string>
<string name="statistics_wikidata_edits">Images via \"Nearby Places\"</string>
<string name="level">Level %d</string>
<string name="profileLevel">%s (Level %s)</string>
<string name="images_uploaded">Images Uploaded</string>
<string name="image_reverts">Images Not Reverted</string>
<string name="images_used_by_wiki">Images Used</string>
Expand Down

0 comments on commit 871c0ff

Please sign in to comment.