Skip to content

Commit

Permalink
Fixed the badge issue & made the badge clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
neeldoshii committed Dec 1, 2024
1 parent 21af5b4 commit eef23f0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 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 @@ -68,9 +68,9 @@ class AchievementsFragment : CommonsDaggerSupportFragment(){
binding.imagesUploadInfoIcon.setOnClickListener { showUploadInfo() }
binding.imagesRevertedInfoIcon.setOnClickListener { showRevertedInfo() }
binding.imagesUsedByWikiInfoIcon.setOnClickListener { showUsedByWikiInfo() }
//binding.imagesNearbyInfoIcon.setOnClickListener { showImagesViaNearbyInfo() }
//binding.imagesFeaturedInfoIcon.setOnClickListener { showFeaturedImagesInfo() }
//binding.thanksReceivedInfoIcon.setOnClickListener { showThanksReceivedInfo() }
binding.wikidataEditsIcon.setOnClickListener { showImagesViaNearbyInfo() }
binding.featuredImageIcon.setOnClickListener { showFeaturedImagesInfo() }
binding.thanksImageIcon.setOnClickListener { showThanksReceivedInfo() }
binding.qualityImageIcon.setOnClickListener { showQualityImagesInfo() }

// DisplayMetrics used to fetch the size of the screen
Expand Down Expand Up @@ -345,7 +345,6 @@ class AchievementsFragment : CommonsDaggerSupportFragment(){
* and assign badge and level. Also stores the achievements level of the user in BasicKvStore to display in menu
* @param achievements
*/
// @OptIn(ExperimentalBadgeUtils::class)
private fun inflateAchievements(achievements: Achievements) {

// Thanks Received Badge
Expand Down Expand Up @@ -412,7 +411,7 @@ class AchievementsFragment : CommonsDaggerSupportFragment(){
badgeDrawable.badgeGravity = badgeGravity
badgeDrawable.badgeTextColor = badgeTextColor
badgeDrawable.backgroundColor = backgroundColor
BadgeUtils.attachBadgeDrawable(badgeDrawable, binding.wikidataEditsIcon)
BadgeUtils.attachBadgeDrawable(badgeDrawable, view)
view.getViewTreeObserver().removeOnGlobalLayoutListener(this)
}
})
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/fragment_achievements.xml
Original file line number Diff line number Diff line change
Expand Up @@ -396,23 +396,23 @@
android:id="@+id/wikidata_edits_icon"
android:layout_width="@dimen/dimen_40"
android:layout_height="@dimen/dimen_40"
android:layout_marginEnd="@dimen/medium_width"
android:layout_marginEnd="@dimen/large_gap"
app:srcCompat="@drawable/ic_custom_map_marker" />

<!--Featured Image Statistics-->
<ImageView
android:id="@+id/featured_image_icon"
android:layout_width="@dimen/dimen_40"
android:layout_height="@dimen/dimen_40"
android:layout_marginEnd="@dimen/medium_width"
android:layout_marginEnd="@dimen/large_gap"
app:srcCompat="@drawable/featured" />

<!--Quality Image Statistics-->
<ImageView
android:id="@+id/quality_image_icon"
android:layout_width="@dimen/dimen_40"
android:layout_height="@dimen/dimen_40"
android:layout_marginEnd="@dimen/medium_width"
android:layout_marginEnd="@dimen/large_gap"
app:srcCompat="@drawable/ic_quality_images_logo" />

<!--Thank Image Statistics-->
Expand All @@ -421,7 +421,7 @@
android:layout_width="@dimen/dimen_40"
android:layout_height="@dimen/dimen_40"

android:layout_marginEnd="@dimen/medium_width"
android:layout_marginEnd="@dimen/large_gap"
app:srcCompat="@drawable/ic_thanks" />


Expand Down

0 comments on commit eef23f0

Please sign in to comment.