Skip to content

Commit

Permalink
Bug Fixs & Enhancement of Achievement Screen (commons-app#5666)
Browse files Browse the repository at this point in the history
* Rename AchievementFragment from `.java` to `.kt`

* Migrated AchievementFragment to kotlin

* Revamped Achievement Screen

* fixed AchievementFragment Unit Test

* fixed Level on MoreBottomSheetFragment

* Implemented Badge and Minor Code Refactor

* Fixed the badge issue & made the badge clickable

* Removed Redundant XML Code & Converted badges to green color and added values inside it

* Fixed : showSnackBarWithRetry Test

* Fixed : Theme issues on Light Mode

---------

Co-authored-by: Nicolas Raoul <[email protected]>
  • Loading branch information
neeldoshii and nicolas-raoul authored Dec 6, 2024
1 parent ae52267 commit a8387f0
Show file tree
Hide file tree
Showing 9 changed files with 944 additions and 1,132 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies {

implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
implementation "com.google.android.material:material:1.9.0"
implementation "com.google.android.material:material:1.12.0"
implementation 'com.karumi:dexter:5.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

Expand Down
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 @@ -16,7 +16,6 @@
import androidx.core.content.FileProvider;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import com.google.android.material.tabs.TabLayout;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.Utils;
import fr.free.nrw.commons.ViewPagerAdapter;
Expand Down
Loading

0 comments on commit a8387f0

Please sign in to comment.