mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Implemented Badge and Minor Code Refactor
This commit is contained in:
		
							parent
							
								
									871c0ffb94
								
							
						
					
					
						commit
						21af5b4627
					
				
					 4 changed files with 268 additions and 223 deletions
				
			
		|  | @ -6,10 +6,14 @@ import android.util.DisplayMetrics | ||||||
| import android.view.LayoutInflater | import android.view.LayoutInflater | ||||||
| import android.view.View | import android.view.View | ||||||
| import android.view.ViewGroup | import android.view.ViewGroup | ||||||
|  | import android.view.ViewTreeObserver | ||||||
| import android.widget.Toast | import android.widget.Toast | ||||||
| import androidx.appcompat.view.ContextThemeWrapper | import androidx.appcompat.view.ContextThemeWrapper | ||||||
| import androidx.constraintlayout.widget.ConstraintLayout | import androidx.constraintlayout.widget.ConstraintLayout | ||||||
| import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat | import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat | ||||||
|  | import com.google.android.material.badge.BadgeDrawable | ||||||
|  | import com.google.android.material.badge.BadgeUtils | ||||||
|  | import com.google.android.material.badge.ExperimentalBadgeUtils | ||||||
| import fr.free.nrw.commons.R | import fr.free.nrw.commons.R | ||||||
| import fr.free.nrw.commons.Utils | import fr.free.nrw.commons.Utils | ||||||
| import fr.free.nrw.commons.auth.SessionManager | import fr.free.nrw.commons.auth.SessionManager | ||||||
|  | @ -64,9 +68,9 @@ class AchievementsFragment : CommonsDaggerSupportFragment(){ | ||||||
|         binding.imagesUploadInfoIcon.setOnClickListener { showUploadInfo() } |         binding.imagesUploadInfoIcon.setOnClickListener { showUploadInfo() } | ||||||
|         binding.imagesRevertedInfoIcon.setOnClickListener { showRevertedInfo() } |         binding.imagesRevertedInfoIcon.setOnClickListener { showRevertedInfo() } | ||||||
|         binding.imagesUsedByWikiInfoIcon.setOnClickListener { showUsedByWikiInfo() } |         binding.imagesUsedByWikiInfoIcon.setOnClickListener { showUsedByWikiInfo() } | ||||||
|         binding.imagesNearbyInfoIcon.setOnClickListener { showImagesViaNearbyInfo() } |         //binding.imagesNearbyInfoIcon.setOnClickListener { showImagesViaNearbyInfo() } | ||||||
|         binding.imagesFeaturedInfoIcon.setOnClickListener { showFeaturedImagesInfo() } |         //binding.imagesFeaturedInfoIcon.setOnClickListener { showFeaturedImagesInfo() } | ||||||
|         binding.thanksReceivedInfoIcon.setOnClickListener { showThanksReceivedInfo() } |         //binding.thanksReceivedInfoIcon.setOnClickListener { showThanksReceivedInfo() } | ||||||
|         binding.qualityImageIcon.setOnClickListener { showQualityImagesInfo() } |         binding.qualityImageIcon.setOnClickListener { showQualityImagesInfo() } | ||||||
| 
 | 
 | ||||||
|         // DisplayMetrics used to fetch the size of the screen |         // DisplayMetrics used to fetch the size of the screen | ||||||
|  | @ -84,9 +88,6 @@ class AchievementsFragment : CommonsDaggerSupportFragment(){ | ||||||
|         binding.progressBar.visibility = View.VISIBLE |         binding.progressBar.visibility = View.VISIBLE | ||||||
| 
 | 
 | ||||||
|         setHasOptionsMenu(true) |         setHasOptionsMenu(true) | ||||||
| 
 |  | ||||||
|         // Set the initial value of WikiData edits to 0 |  | ||||||
|         binding.wikidataEdits.text = "0" |  | ||||||
|         if (sessionManager.userName == null || sessionManager.userName == userName) { |         if (sessionManager.userName == null || sessionManager.userName == userName) { | ||||||
|             binding.tvAchievementsOfUser.visibility = View.GONE |             binding.tvAchievementsOfUser.visibility = View.GONE | ||||||
|         } else { |         } else { | ||||||
|  | @ -94,14 +95,7 @@ class AchievementsFragment : CommonsDaggerSupportFragment(){ | ||||||
|             binding.tvAchievementsOfUser.text = getString(R.string.achievements_of_user, userName) |             binding.tvAchievementsOfUser.text = getString(R.string.achievements_of_user, userName) | ||||||
|         } |         } | ||||||
|         if (isBetaFlavour) { |         if (isBetaFlavour) { | ||||||
|             binding.progressBar.visibility = View.GONE |             binding.layout.visibility = View.GONE | ||||||
|             binding.imagesUsedCount.setText(R.string.no_image) |  | ||||||
|             binding.imagesRevertedText.setText(R.string.no_image_reverted) |  | ||||||
|             binding.imagesUploadTextParam.setText(R.string.no_image_uploaded) |  | ||||||
|             binding.wikidataEdits.text = "0" |  | ||||||
|             binding.imageFeatured.text = "0" |  | ||||||
|             binding.qualityImages.text = "0" |  | ||||||
|             binding.achievementLevel.text = "0" |  | ||||||
|             setMenuVisibility(true) |             setMenuVisibility(true) | ||||||
|             return binding.root |             return binding.root | ||||||
|         } |         } | ||||||
|  | @ -212,7 +206,7 @@ class AchievementsFragment : CommonsDaggerSupportFragment(){ | ||||||
|                 .observeOn(AndroidSchedulers.mainThread()) |                 .observeOn(AndroidSchedulers.mainThread()) | ||||||
|                 .subscribe({ edits: Int -> |                 .subscribe({ edits: Int -> | ||||||
|                     numberOfEdits = edits |                     numberOfEdits = edits | ||||||
|                     binding.wikidataEdits.text = edits.toString() |                     showBadgesWithCount(view = binding.wikidataEditsIcon, count = edits) | ||||||
|                 }, { e: Throwable -> |                 }, { e: Throwable -> | ||||||
|                     Timber.e("Error:$e") |                     Timber.e("Error:$e") | ||||||
|                 }) |                 }) | ||||||
|  | @ -351,15 +345,22 @@ class AchievementsFragment : CommonsDaggerSupportFragment(){ | ||||||
|      * and assign badge and level. Also stores the achievements level of the user in BasicKvStore to display in menu |      * and assign badge and level. Also stores the achievements level of the user in BasicKvStore to display in menu | ||||||
|      * @param achievements |      * @param achievements | ||||||
|      */ |      */ | ||||||
|  | //    @OptIn(ExperimentalBadgeUtils::class) | ||||||
|     private fun inflateAchievements(achievements: Achievements) { |     private fun inflateAchievements(achievements: Achievements) { | ||||||
| //        binding.imagesUsedByWikiProgressBar.setVisibility(View.VISIBLE); | 
 | ||||||
|         binding.thanksReceived.text = achievements.thanksReceived.toString() |         // Thanks Received Badge | ||||||
|  |         showBadgesWithCount(view = binding.thanksImageIcon, count =  achievements.thanksReceived) | ||||||
|  | 
 | ||||||
|  |         // Featured Images Badge | ||||||
|  |         showBadgesWithCount(view = binding.featuredImageIcon, count =  achievements.featuredImages) | ||||||
|  | 
 | ||||||
|  |         // Quality Images Badge | ||||||
|  |         showBadgesWithCount(view = binding.qualityImageIcon, count =  achievements.qualityImages) | ||||||
|  | 
 | ||||||
|         binding.imagesUsedByWikiProgressBar.progress = |         binding.imagesUsedByWikiProgressBar.progress = | ||||||
|             100 * achievements.uniqueUsedImages / levelInfo.maxUniqueImages |             100 * achievements.uniqueUsedImages / levelInfo.maxUniqueImages | ||||||
|         binding.imagesUsedCount.text = (achievements.uniqueUsedImages.toString() + "/" |         binding.imagesUsedCount.text = (achievements.uniqueUsedImages.toString() + "/" | ||||||
|                 + levelInfo.maxUniqueImages) |                 + levelInfo.maxUniqueImages) | ||||||
|         binding.imageFeatured.text = achievements.featuredImages.toString() |  | ||||||
|         binding.qualityImages.text = achievements.qualityImages.toString() |  | ||||||
| 
 | 
 | ||||||
|         binding.achievementLevel.text = getString(R.string.level,levelInfo.levelNumber) |         binding.achievementLevel.text = getString(R.string.level,levelInfo.levelNumber) | ||||||
|         binding.achievementBadgeImage.setImageDrawable( |         binding.achievementBadgeImage.setImageDrawable( | ||||||
|  | @ -373,6 +374,49 @@ class AchievementsFragment : CommonsDaggerSupportFragment(){ | ||||||
|         store.putString("userAchievementsLevel", levelInfo.levelNumber.toString()) |         store.putString("userAchievementsLevel", levelInfo.levelNumber.toString()) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /** | ||||||
|  |      * This function is used to show badge on any view (button, imageView, etc) | ||||||
|  |      * @param view The View on which the badge will be displayed eg (button, imageView, etc) | ||||||
|  |      * @param count The number to be displayed inside the badge. | ||||||
|  |      * @param backgroundColor The badge background color. Default is R.attr.colorPrimary | ||||||
|  |      * @param badgeTextColor The badge text color. Default is R.attr.colorPrimary | ||||||
|  |      * @param badgeGravity The position of the badge [TOP_END,TOP_START,BOTTOM_END,BOTTOM_START]. Default is TOP_END | ||||||
|  |      * @return if the number is 0, then it will not create badge for it and hide the view | ||||||
|  |      * @see https://developer.android.com/reference/com/google/android/material/badge/BadgeDrawable | ||||||
|  |      */ | ||||||
|  | 
 | ||||||
|  |     private fun showBadgesWithCount( | ||||||
|  |         view: View, | ||||||
|  |         count: Int, | ||||||
|  |         backgroundColor: Int = R.attr.colorPrimary, | ||||||
|  |         badgeTextColor: Int = R.attr.textEnabled, | ||||||
|  |         badgeGravity: Int = BadgeDrawable.TOP_END | ||||||
|  |     ) { | ||||||
|  |         //https://stackoverflow.com/a/67742035 | ||||||
|  |         if (count == 0) { | ||||||
|  |             view.visibility = View.GONE | ||||||
|  |             return | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         view.viewTreeObserver.addOnGlobalLayoutListener(object : | ||||||
|  |             ViewTreeObserver.OnGlobalLayoutListener { | ||||||
|  |             /** | ||||||
|  |              * Callback method to be invoked when the global layout state or the visibility of views | ||||||
|  |              * within the view tree changes | ||||||
|  |              */ | ||||||
|  |             @ExperimentalBadgeUtils | ||||||
|  |             override fun onGlobalLayout() { | ||||||
|  |                 view.visibility = View.VISIBLE | ||||||
|  |                 val badgeDrawable = BadgeDrawable.create(requireActivity()) | ||||||
|  |                 badgeDrawable.number = count | ||||||
|  |                 badgeDrawable.badgeGravity = badgeGravity | ||||||
|  |                 badgeDrawable.badgeTextColor = badgeTextColor | ||||||
|  |                 badgeDrawable.backgroundColor = backgroundColor | ||||||
|  |                 BadgeUtils.attachBadgeDrawable(badgeDrawable, binding.wikidataEditsIcon) | ||||||
|  |                 view.getViewTreeObserver().removeOnGlobalLayoutListener(this) | ||||||
|  |             } | ||||||
|  |         }) | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * to hide progressbar |      * to hide progressbar | ||||||
|  |  | ||||||
|  | @ -11,7 +11,7 @@ | ||||||
| <!-- TODO Add ContentDescription For ALL Images Added ignore to suppress Lints --> | <!-- TODO Add ContentDescription For ALL Images Added ignore to suppress Lints --> | ||||||
| 
 | 
 | ||||||
|   <androidx.constraintlayout.widget.ConstraintLayout |   <androidx.constraintlayout.widget.ConstraintLayout | ||||||
|     android:id="@+id/drawer_layout" |     android:id="@+id/layout" | ||||||
|     android:layout_width="match_parent" |     android:layout_width="match_parent" | ||||||
|     android:layout_height="wrap_content"> |     android:layout_height="wrap_content"> | ||||||
| 
 | 
 | ||||||
|  | @ -283,234 +283,233 @@ | ||||||
|       android:layout_height="wrap_content" |       android:layout_height="wrap_content" | ||||||
|       android:layout_marginStart="@dimen/activity_margin_horizontal" |       android:layout_marginStart="@dimen/activity_margin_horizontal" | ||||||
|       android:layout_marginTop="@dimen/activity_margin_horizontal" |       android:layout_marginTop="@dimen/activity_margin_horizontal" | ||||||
|       android:text="@string/statistics" |       android:text="@string/badges" | ||||||
|       android:textAllCaps="true" |       android:textAllCaps="true" | ||||||
|       android:textSize="16sp" |       android:textSize="16sp" | ||||||
|       android:textStyle="bold" |       android:textStyle="bold" | ||||||
|       app:layout_constraintStart_toStartOf="parent" |       app:layout_constraintStart_toStartOf="parent" | ||||||
|       app:layout_constraintTop_toBottomOf="@+id/materialDivider2" /> |       app:layout_constraintTop_toBottomOf="@+id/materialDivider2" /> | ||||||
| 
 | 
 | ||||||
|     <!--Nearby Places Statistics--> |  | ||||||
|     <ImageView |  | ||||||
|       android:id="@+id/wikidata_edits_icon" |  | ||||||
|       android:layout_width="@dimen/dimen_40" |  | ||||||
|       android:layout_height="@dimen/dimen_40" |  | ||||||
|       android:layout_marginStart="@dimen/activity_margin_horizontal" |  | ||||||
|       android:layout_marginTop="@dimen/activity_margin_horizontal" |  | ||||||
|       app:layout_constraintLeft_toLeftOf="parent" |  | ||||||
|       app:layout_constraintTop_toBottomOf="@+id/tv_statistics" |  | ||||||
|       app:srcCompat="@drawable/ic_custom_map_marker" /> |  | ||||||
| 
 | 
 | ||||||
|     <TextView |     <!--    <TextView--> | ||||||
|       android:id="@+id/images_nearby_data" | <!--      android:id="@+id/images_nearby_data"--> | ||||||
|       style="?android:textAppearanceMedium" | <!--      style="?android:textAppearanceMedium"--> | ||||||
|       android:layout_width="0dp" | <!--      android:layout_width="0dp"--> | ||||||
|       android:layout_height="wrap_content" | <!--      android:layout_height="wrap_content"--> | ||||||
|       android:layout_marginStart="16dp" | <!--      android:layout_marginStart="16dp"--> | ||||||
|       android:layout_marginEnd="16dp" | <!--      android:layout_marginEnd="16dp"--> | ||||||
|       android:text="@string/statistics_wikidata_edits" | <!--      android:text="@string/statistics_wikidata_edits"--> | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/wikidata_edits_icon" | <!--      app:layout_constraintBottom_toBottomOf="@+id/wikidata_edits_icon"--> | ||||||
|       app:layout_constraintEnd_toStartOf="@+id/images_nearby_info_icon" | <!--      app:layout_constraintEnd_toStartOf="@+id/images_nearby_info_icon"--> | ||||||
|       app:layout_constraintStart_toEndOf="@+id/wikidata_edits_icon" | <!--      app:layout_constraintStart_toEndOf="@+id/wikidata_edits_icon"--> | ||||||
|       app:layout_constraintTop_toTopOf="@+id/wikidata_edits_icon" /> | <!--      app:layout_constraintTop_toTopOf="@+id/wikidata_edits_icon" />--> | ||||||
| 
 | 
 | ||||||
|     <ImageView | <!--    <ImageView--> | ||||||
|       android:id="@+id/images_nearby_info_icon" | <!--      android:id="@+id/images_nearby_info_icon"--> | ||||||
|       android:layout_width="wrap_content" | <!--      android:layout_width="wrap_content"--> | ||||||
|       android:layout_height="wrap_content" | <!--      android:layout_height="wrap_content"--> | ||||||
|       android:layout_marginEnd="16dp" | <!--      android:layout_marginEnd="16dp"--> | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/images_nearby_data" | <!--      app:layout_constraintBottom_toBottomOf="@+id/images_nearby_data"--> | ||||||
|       app:layout_constraintEnd_toStartOf="@+id/wikidata_edits" | <!--      app:layout_constraintEnd_toStartOf="@+id/wikidata_edits"--> | ||||||
|       app:layout_constraintTop_toTopOf="@+id/images_nearby_data" | <!--      app:layout_constraintTop_toTopOf="@+id/images_nearby_data"--> | ||||||
|       app:srcCompat="@drawable/ic_info_outline_24dp" | <!--      app:srcCompat="@drawable/ic_info_outline_24dp"--> | ||||||
|       app:tint="@color/black" /> | <!--      app:tint="@color/black" />--> | ||||||
| 
 | 
 | ||||||
|     <TextView | <!--    <TextView--> | ||||||
|       android:id="@+id/wikidata_edits" | <!--      android:id="@+id/wikidata_edits"--> | ||||||
|       style="?android:textAppearanceMedium" | <!--      style="?android:textAppearanceMedium"--> | ||||||
|       android:layout_width="wrap_content" | <!--      android:layout_width="wrap_content"--> | ||||||
|       android:layout_height="wrap_content" | <!--      android:layout_height="wrap_content"--> | ||||||
|       android:layout_marginEnd="@dimen/activity_margin_horizontal" | <!--      android:layout_marginEnd="@dimen/activity_margin_horizontal"--> | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/images_nearby_info_icon" | <!--      app:layout_constraintBottom_toBottomOf="@+id/images_nearby_info_icon"--> | ||||||
|       app:layout_constraintEnd_toEndOf="parent" | <!--      app:layout_constraintEnd_toEndOf="parent"--> | ||||||
|       app:layout_constraintTop_toTopOf="@+id/images_nearby_info_icon" | <!--      app:layout_constraintTop_toTopOf="@+id/images_nearby_info_icon"--> | ||||||
|       tools:text="2" /> | <!--      tools:text="2" />--> | ||||||
| 
 | 
 | ||||||
|     <com.google.android.material.divider.MaterialDivider | <!--    <com.google.android.material.divider.MaterialDivider--> | ||||||
|       android:id="@+id/materialDivider3" | <!--      android:id="@+id/materialDivider3"--> | ||||||
|  | <!--      android:layout_width="match_parent"--> | ||||||
|  | <!--      android:layout_height="wrap_content"--> | ||||||
|  | <!--      android:layout_marginStart="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      android:layout_marginTop="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      android:layout_marginEnd="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      app:layout_constraintEnd_toEndOf="parent"--> | ||||||
|  | <!--      app:layout_constraintStart_toStartOf="parent"--> | ||||||
|  | <!--      app:layout_constraintTop_toBottomOf="@+id/wikidata_edits_icon" />--> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | <!--    <TextView--> | ||||||
|  | <!--      android:id="@+id/images_featured_data"--> | ||||||
|  | <!--      style="?android:textAppearanceMedium"--> | ||||||
|  | <!--      android:layout_width="0dp"--> | ||||||
|  | <!--      android:layout_height="wrap_content"--> | ||||||
|  | <!--      android:layout_marginStart="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      android:layout_marginEnd="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      android:text="@string/statistics_featured"--> | ||||||
|  | <!--      app:layout_constraintBottom_toBottomOf="@+id/featured_image_icon"--> | ||||||
|  | <!--      app:layout_constraintEnd_toStartOf="@+id/images_nearby_info_icon"--> | ||||||
|  | <!--      app:layout_constraintStart_toEndOf="@+id/featured_image_icon"--> | ||||||
|  | <!--      app:layout_constraintTop_toTopOf="@+id/featured_image_icon" />--> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | <!--    <TextView--> | ||||||
|  | <!--      android:id="@+id/image_featured"--> | ||||||
|  | <!--      style="?android:textAppearanceMedium"--> | ||||||
|  | <!--      android:layout_width="wrap_content"--> | ||||||
|  | <!--      android:layout_height="wrap_content"--> | ||||||
|  | <!--      android:layout_marginEnd="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      app:layout_constraintBottom_toBottomOf="@+id/images_featured_info_icon"--> | ||||||
|  | <!--      app:layout_constraintEnd_toEndOf="parent"--> | ||||||
|  | <!--      app:layout_constraintTop_toTopOf="@+id/images_featured_info_icon"--> | ||||||
|  | <!--      tools:text="2" />--> | ||||||
|  | 
 | ||||||
|  | <!--    <com.google.android.material.divider.MaterialDivider--> | ||||||
|  | <!--      android:id="@+id/materialDivider4"--> | ||||||
|  | <!--      android:layout_width="match_parent"--> | ||||||
|  | <!--      android:layout_height="wrap_content"--> | ||||||
|  | <!--      android:layout_marginStart="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      android:layout_marginTop="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      android:layout_marginEnd="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      app:layout_constraintEnd_toEndOf="parent"--> | ||||||
|  | <!--      app:layout_constraintStart_toStartOf="parent"--> | ||||||
|  | <!--      app:layout_constraintTop_toBottomOf="@+id/featured_image_icon" />--> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     <LinearLayout | ||||||
|  |       android:id="@+id/badgesItems" | ||||||
|       android:layout_width="match_parent" |       android:layout_width="match_parent" | ||||||
|       android:layout_height="wrap_content" |       android:layout_height="wrap_content" | ||||||
|       android:layout_marginStart="@dimen/activity_margin_horizontal" |       android:layout_marginStart="@dimen/activity_margin_horizontal" | ||||||
|       android:layout_marginTop="@dimen/activity_margin_horizontal" |  | ||||||
|       android:layout_marginEnd="@dimen/activity_margin_horizontal" |       android:layout_marginEnd="@dimen/activity_margin_horizontal" | ||||||
|  |       android:orientation="horizontal" | ||||||
|  |       android:padding="@dimen/activity_margin_horizontal" | ||||||
|       app:layout_constraintEnd_toEndOf="parent" |       app:layout_constraintEnd_toEndOf="parent" | ||||||
|       app:layout_constraintStart_toStartOf="parent" |       app:layout_constraintStart_toStartOf="parent" | ||||||
|       app:layout_constraintTop_toBottomOf="@+id/wikidata_edits_icon" /> |       app:layout_constraintTop_toBottomOf="@+id/tv_statistics"> | ||||||
| 
 | 
 | ||||||
|     <!--Featured Image Statistics--> |       <!--Nearby Places Statistics--> | ||||||
|  |       <ImageView | ||||||
|  |         android:id="@+id/wikidata_edits_icon" | ||||||
|  |         android:layout_width="@dimen/dimen_40" | ||||||
|  |         android:layout_height="@dimen/dimen_40" | ||||||
|  |         android:layout_marginEnd="@dimen/medium_width" | ||||||
|  |         app:srcCompat="@drawable/ic_custom_map_marker" /> | ||||||
| 
 | 
 | ||||||
|     <ImageView |       <!--Featured Image Statistics--> | ||||||
|       android:id="@+id/featured_image_icon" |       <ImageView | ||||||
|       android:layout_width="@dimen/dimen_40" |         android:id="@+id/featured_image_icon" | ||||||
|       android:layout_height="@dimen/dimen_40" |         android:layout_width="@dimen/dimen_40" | ||||||
|       android:layout_marginStart="@dimen/activity_margin_horizontal" |         android:layout_height="@dimen/dimen_40" | ||||||
|       android:layout_marginTop="@dimen/activity_margin_horizontal" |         android:layout_marginEnd="@dimen/medium_width" | ||||||
|       app:layout_constraintLeft_toLeftOf="parent" |         app:srcCompat="@drawable/featured" /> | ||||||
|       app:layout_constraintTop_toBottomOf="@+id/materialDivider3" |  | ||||||
|       app:srcCompat="@drawable/featured" /> |  | ||||||
| 
 | 
 | ||||||
|     <TextView |       <!--Quality Image Statistics--> | ||||||
|       android:id="@+id/images_featured_data" |       <ImageView | ||||||
|       style="?android:textAppearanceMedium" |         android:id="@+id/quality_image_icon" | ||||||
|       android:layout_width="0dp" |         android:layout_width="@dimen/dimen_40" | ||||||
|       android:layout_height="wrap_content" |         android:layout_height="@dimen/dimen_40" | ||||||
|       android:layout_marginStart="@dimen/activity_margin_horizontal" |         android:layout_marginEnd="@dimen/medium_width" | ||||||
|       android:layout_marginEnd="@dimen/activity_margin_horizontal" |         app:srcCompat="@drawable/ic_quality_images_logo" /> | ||||||
|       android:text="@string/statistics_featured" | 
 | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/featured_image_icon" |       <!--Thank Image Statistics--> | ||||||
|       app:layout_constraintEnd_toStartOf="@+id/images_nearby_info_icon" |       <ImageView | ||||||
|       app:layout_constraintStart_toEndOf="@+id/featured_image_icon" |         android:id="@+id/thanks_image_icon" | ||||||
|       app:layout_constraintTop_toTopOf="@+id/featured_image_icon" /> |         android:layout_width="@dimen/dimen_40" | ||||||
|  |         android:layout_height="@dimen/dimen_40" | ||||||
|  | 
 | ||||||
|  |         android:layout_marginEnd="@dimen/medium_width" | ||||||
|  |         app:srcCompat="@drawable/ic_thanks" /> | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     <ImageView |     </LinearLayout> | ||||||
|       android:id="@+id/images_featured_info_icon" | 
 | ||||||
|       android:layout_width="wrap_content" | <!--    <TextView--> | ||||||
|       android:layout_height="wrap_content" | <!--      android:id="@+id/quality_images_data"--> | ||||||
|       android:layout_marginEnd="16dp" | <!--      style="?android:textAppearanceMedium"--> | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/images_featured_data" | <!--      android:layout_width="0dp"--> | ||||||
|       app:layout_constraintEnd_toStartOf="@+id/wikidata_edits" | <!--      android:layout_height="wrap_content"--> | ||||||
|       app:layout_constraintTop_toTopOf="@+id/images_featured_data" | <!--      android:layout_marginStart="@dimen/activity_margin_horizontal"--> | ||||||
|       app:srcCompat="@drawable/ic_info_outline_24dp" | <!--      android:layout_marginEnd="@dimen/activity_margin_horizontal"--> | ||||||
|       app:tint="@color/black" /> | <!--      android:text="@string/statistics_quality"--> | ||||||
|  | <!--      app:layout_constraintBottom_toBottomOf="@+id/quality_image_icon"--> | ||||||
|  | <!--      app:layout_constraintEnd_toStartOf="@+id/images_nearby_info_icon"--> | ||||||
|  | <!--      app:layout_constraintStart_toEndOf="@+id/quality_image_icon"--> | ||||||
|  | <!--      app:layout_constraintTop_toTopOf="@+id/quality_image_icon" />--> | ||||||
|  | 
 | ||||||
|  | <!--    <ImageView--> | ||||||
|  | <!--      android:id="@+id/quality_images_info_icon"--> | ||||||
|  | <!--      android:layout_width="wrap_content"--> | ||||||
|  | <!--      android:layout_height="wrap_content"--> | ||||||
|  | <!--      android:layout_marginEnd="16dp"--> | ||||||
|  | <!--      app:layout_constraintBottom_toBottomOf="@+id/quality_images_data"--> | ||||||
|  | <!--      app:layout_constraintEnd_toStartOf="@+id/quality_images"--> | ||||||
|  | <!--      app:layout_constraintTop_toTopOf="@+id/quality_images_data"--> | ||||||
|  | <!--      app:srcCompat="@drawable/ic_info_outline_24dp"--> | ||||||
|  | <!--      app:tint="@color/black" />--> | ||||||
|  | 
 | ||||||
|  | <!--    <TextView--> | ||||||
|  | <!--      android:id="@+id/quality_images"--> | ||||||
|  | <!--      style="?android:textAppearanceMedium"--> | ||||||
|  | <!--      android:layout_width="wrap_content"--> | ||||||
|  | <!--      android:layout_height="wrap_content"--> | ||||||
|  | <!--      android:layout_marginEnd="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      app:layout_constraintBottom_toBottomOf="@+id/quality_images_info_icon"--> | ||||||
|  | <!--      app:layout_constraintEnd_toEndOf="parent"--> | ||||||
|  | <!--      app:layout_constraintTop_toTopOf="@+id/quality_images_info_icon"--> | ||||||
|  | <!--      tools:text="2" />--> | ||||||
|  | 
 | ||||||
|  | <!--    <com.google.android.material.divider.MaterialDivider--> | ||||||
|  | <!--      android:id="@+id/materialDivider5"--> | ||||||
|  | <!--      android:layout_width="match_parent"--> | ||||||
|  | <!--      android:layout_height="wrap_content"--> | ||||||
|  | <!--      android:layout_marginStart="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      android:layout_marginTop="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      android:layout_marginEnd="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      app:layout_constraintEnd_toEndOf="parent"--> | ||||||
|  | <!--      app:layout_constraintStart_toStartOf="parent"--> | ||||||
|  | <!--      app:layout_constraintTop_toBottomOf="@+id/quality_image_icon" />--> | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     <TextView |  | ||||||
|       android:id="@+id/image_featured" |  | ||||||
|       style="?android:textAppearanceMedium" |  | ||||||
|       android:layout_width="wrap_content" |  | ||||||
|       android:layout_height="wrap_content" |  | ||||||
|       android:layout_marginEnd="@dimen/activity_margin_horizontal" |  | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/images_featured_info_icon" |  | ||||||
|       app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|       app:layout_constraintTop_toTopOf="@+id/images_featured_info_icon" |  | ||||||
|       tools:text="2" /> |  | ||||||
| 
 | 
 | ||||||
|     <com.google.android.material.divider.MaterialDivider |  | ||||||
|       android:id="@+id/materialDivider4" |  | ||||||
|       android:layout_width="match_parent" |  | ||||||
|       android:layout_height="wrap_content" |  | ||||||
|       android:layout_marginStart="@dimen/activity_margin_horizontal" |  | ||||||
|       android:layout_marginTop="@dimen/activity_margin_horizontal" |  | ||||||
|       android:layout_marginEnd="@dimen/activity_margin_horizontal" |  | ||||||
|       app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|       app:layout_constraintStart_toStartOf="parent" |  | ||||||
|       app:layout_constraintTop_toBottomOf="@+id/featured_image_icon" /> |  | ||||||
| 
 | 
 | ||||||
|     <!--Quality Image Statistics--> | <!--    <TextView--> | ||||||
|  | <!--      android:id="@+id/thanks_received_data"--> | ||||||
|  | <!--      style="?android:textAppearanceMedium"--> | ||||||
|  | <!--      android:layout_width="0dp"--> | ||||||
|  | <!--      android:layout_height="wrap_content"--> | ||||||
|  | <!--      android:layout_marginStart="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      android:layout_marginEnd="@dimen/activity_margin_horizontal"--> | ||||||
|  | <!--      android:text="@string/statistics_thanks"--> | ||||||
|  | <!--      app:layout_constraintBottom_toBottomOf="@+id/thanks_image_icon"--> | ||||||
|  | <!--      app:layout_constraintEnd_toStartOf="@+id/images_nearby_info_icon"--> | ||||||
|  | <!--      app:layout_constraintStart_toEndOf="@+id/thanks_image_icon"--> | ||||||
|  | <!--      app:layout_constraintTop_toTopOf="@+id/thanks_image_icon" />--> | ||||||
| 
 | 
 | ||||||
|     <ImageView | <!--    <ImageView--> | ||||||
|       android:id="@+id/quality_image_icon" | <!--      android:id="@+id/thanks_received_info_icon"--> | ||||||
|       android:layout_width="@dimen/dimen_40" | <!--      android:layout_width="wrap_content"--> | ||||||
|       android:layout_height="@dimen/dimen_40" | <!--      android:layout_height="wrap_content"--> | ||||||
|       android:layout_marginStart="@dimen/activity_margin_horizontal" | <!--      android:layout_marginEnd="@dimen/activity_margin_horizontal"--> | ||||||
|       android:layout_marginTop="@dimen/activity_margin_horizontal" | <!--      app:layout_constraintBottom_toBottomOf="@+id/thanks_received_data"--> | ||||||
|       app:layout_constraintLeft_toLeftOf="parent" | <!--      app:layout_constraintEnd_toStartOf="@+id/quality_images"--> | ||||||
|       app:layout_constraintTop_toBottomOf="@+id/materialDivider4" | <!--      app:layout_constraintTop_toTopOf="@+id/thanks_received_data"--> | ||||||
|       app:srcCompat="@drawable/ic_quality_images_logo" /> | <!--      app:srcCompat="@drawable/ic_info_outline_24dp"--> | ||||||
|  | <!--      app:tint="@color/black" />--> | ||||||
| 
 | 
 | ||||||
|     <TextView | <!--    <TextView--> | ||||||
|       android:id="@+id/quality_images_data" | <!--      android:id="@+id/thanks_received"--> | ||||||
|       style="?android:textAppearanceMedium" | <!--      style="?android:textAppearanceMedium"--> | ||||||
|       android:layout_width="0dp" | <!--      android:layout_width="wrap_content"--> | ||||||
|       android:layout_height="wrap_content" | <!--      android:layout_height="wrap_content"--> | ||||||
|       android:layout_marginStart="@dimen/activity_margin_horizontal" | <!--      android:layout_marginEnd="@dimen/activity_margin_horizontal"--> | ||||||
|       android:layout_marginEnd="@dimen/activity_margin_horizontal" | <!--      app:layout_constraintBottom_toBottomOf="@+id/thanks_received_info_icon"--> | ||||||
|       android:text="@string/statistics_quality" | <!--      app:layout_constraintEnd_toEndOf="parent"--> | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/quality_image_icon" | <!--      app:layout_constraintTop_toTopOf="@+id/thanks_received_info_icon"--> | ||||||
|       app:layout_constraintEnd_toStartOf="@+id/images_nearby_info_icon" | <!--      tools:text="2" />--> | ||||||
|       app:layout_constraintStart_toEndOf="@+id/quality_image_icon" |  | ||||||
|       app:layout_constraintTop_toTopOf="@+id/quality_image_icon" /> |  | ||||||
| 
 |  | ||||||
|     <ImageView |  | ||||||
|       android:id="@+id/quality_images_info_icon" |  | ||||||
|       android:layout_width="wrap_content" |  | ||||||
|       android:layout_height="wrap_content" |  | ||||||
|       android:layout_marginEnd="16dp" |  | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/quality_images_data" |  | ||||||
|       app:layout_constraintEnd_toStartOf="@+id/quality_images" |  | ||||||
|       app:layout_constraintTop_toTopOf="@+id/quality_images_data" |  | ||||||
|       app:srcCompat="@drawable/ic_info_outline_24dp" |  | ||||||
|       app:tint="@color/black" /> |  | ||||||
| 
 |  | ||||||
|     <TextView |  | ||||||
|       android:id="@+id/quality_images" |  | ||||||
|       style="?android:textAppearanceMedium" |  | ||||||
|       android:layout_width="wrap_content" |  | ||||||
|       android:layout_height="wrap_content" |  | ||||||
|       android:layout_marginEnd="@dimen/activity_margin_horizontal" |  | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/quality_images_info_icon" |  | ||||||
|       app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|       app:layout_constraintTop_toTopOf="@+id/quality_images_info_icon" |  | ||||||
|       tools:text="2" /> |  | ||||||
| 
 |  | ||||||
|     <com.google.android.material.divider.MaterialDivider |  | ||||||
|       android:id="@+id/materialDivider5" |  | ||||||
|       android:layout_width="match_parent" |  | ||||||
|       android:layout_height="wrap_content" |  | ||||||
|       android:layout_marginStart="@dimen/activity_margin_horizontal" |  | ||||||
|       android:layout_marginTop="@dimen/activity_margin_horizontal" |  | ||||||
|       android:layout_marginEnd="@dimen/activity_margin_horizontal" |  | ||||||
|       app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|       app:layout_constraintStart_toStartOf="parent" |  | ||||||
|       app:layout_constraintTop_toBottomOf="@+id/quality_image_icon" /> |  | ||||||
| 
 |  | ||||||
|     <!--Thank Image Statistics--> |  | ||||||
| 
 |  | ||||||
|     <ImageView |  | ||||||
|       android:id="@+id/thanks_image_icon" |  | ||||||
|       android:layout_width="@dimen/dimen_40" |  | ||||||
|       android:layout_height="@dimen/dimen_40" |  | ||||||
|       android:layout_marginStart="@dimen/activity_margin_horizontal" |  | ||||||
|       android:layout_marginTop="@dimen/activity_margin_horizontal" |  | ||||||
|       app:layout_constraintLeft_toLeftOf="parent" |  | ||||||
|       app:layout_constraintTop_toBottomOf="@+id/materialDivider5" |  | ||||||
|       app:srcCompat="@drawable/ic_thanks" /> |  | ||||||
| 
 |  | ||||||
|     <TextView |  | ||||||
|       android:id="@+id/thanks_received_data" |  | ||||||
|       style="?android:textAppearanceMedium" |  | ||||||
|       android:layout_width="0dp" |  | ||||||
|       android:layout_height="wrap_content" |  | ||||||
|       android:layout_marginStart="@dimen/activity_margin_horizontal" |  | ||||||
|       android:layout_marginEnd="@dimen/activity_margin_horizontal" |  | ||||||
|       android:text="@string/statistics_thanks" |  | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/thanks_image_icon" |  | ||||||
|       app:layout_constraintEnd_toStartOf="@+id/images_nearby_info_icon" |  | ||||||
|       app:layout_constraintStart_toEndOf="@+id/thanks_image_icon" |  | ||||||
|       app:layout_constraintTop_toTopOf="@+id/thanks_image_icon" /> |  | ||||||
| 
 |  | ||||||
|     <ImageView |  | ||||||
|       android:id="@+id/thanks_received_info_icon" |  | ||||||
|       android:layout_width="wrap_content" |  | ||||||
|       android:layout_height="wrap_content" |  | ||||||
|       android:layout_marginEnd="@dimen/activity_margin_horizontal" |  | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/thanks_received_data" |  | ||||||
|       app:layout_constraintEnd_toStartOf="@+id/quality_images" |  | ||||||
|       app:layout_constraintTop_toTopOf="@+id/thanks_received_data" |  | ||||||
|       app:srcCompat="@drawable/ic_info_outline_24dp" |  | ||||||
|       app:tint="@color/black" /> |  | ||||||
| 
 |  | ||||||
|     <TextView |  | ||||||
|       android:id="@+id/thanks_received" |  | ||||||
|       style="?android:textAppearanceMedium" |  | ||||||
|       android:layout_width="wrap_content" |  | ||||||
|       android:layout_height="wrap_content" |  | ||||||
|       android:layout_marginEnd="@dimen/activity_margin_horizontal" |  | ||||||
|       app:layout_constraintBottom_toBottomOf="@+id/thanks_received_info_icon" |  | ||||||
|       app:layout_constraintEnd_toEndOf="parent" |  | ||||||
|       app:layout_constraintTop_toTopOf="@+id/thanks_received_info_icon" |  | ||||||
|       tools:text="2" /> |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     <ProgressBar |     <ProgressBar | ||||||
|  |  | ||||||
|  | @ -371,6 +371,7 @@ | ||||||
|   <string name="delete">Delete</string> |   <string name="delete">Delete</string> | ||||||
|   <string name="Achievements">Achievements</string> |   <string name="Achievements">Achievements</string> | ||||||
|   <string name="Profile">Profile</string> |   <string name="Profile">Profile</string> | ||||||
|  |   <string name="badges">Badges</string> | ||||||
|   <string name="statistics">Statistics</string> |   <string name="statistics">Statistics</string> | ||||||
|   <string name="statistics_thanks">Thanks Received</string> |   <string name="statistics_thanks">Thanks Received</string> | ||||||
|   <string name="statistics_featured">Featured Images</string> |   <string name="statistics_featured">Featured Images</string> | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| <resources> | <resources> | ||||||
| 
 | 
 | ||||||
|     <style name="DarkAppTheme" parent="Theme.AppCompat.NoActionBar"> |     <style name="DarkAppTheme" parent="Theme.MaterialComponents.NoActionBar"> | ||||||
|         <item name="contributionsListBackground">@color/contributionListDarkBackground</item> |         <item name="contributionsListBackground">@color/contributionListDarkBackground</item> | ||||||
|         <item name="tabBackground">@color/contributionListDarkBackground</item> |         <item name="tabBackground">@color/contributionListDarkBackground</item> | ||||||
|         <item name="tabIndicatorColor">@color/white</item> |         <item name="tabIndicatorColor">@color/white</item> | ||||||
|  | @ -62,7 +62,7 @@ | ||||||
|         <item name="android:splitMotionEvents">false</item> |         <item name="android:splitMotionEvents">false</item> | ||||||
|     </style> |     </style> | ||||||
| 
 | 
 | ||||||
|     <style name="LightAppTheme" parent="Theme.AppCompat.Light.NoActionBar"> |     <style name="LightAppTheme" parent="Theme.MaterialComponents.NoActionBar"> | ||||||
|         <item name="contributionsListBackground">@color/white</item> |         <item name="contributionsListBackground">@color/white</item> | ||||||
|         <item name="tabBackground">@color/card_light_grey</item> |         <item name="tabBackground">@color/card_light_grey</item> | ||||||
|         <item name="tabIndicatorColor">@color/primaryDarkColor</item> |         <item name="tabIndicatorColor">@color/primaryDarkColor</item> | ||||||
|  | @ -73,6 +73,7 @@ | ||||||
|         <item name="drawerHeaderBackground">@color/drawerHeader_background_light</item> |         <item name="drawerHeaderBackground">@color/drawerHeader_background_light</item> | ||||||
|         <item name="tutorialBackground">@color/tutorial_background_light</item> |         <item name="tutorialBackground">@color/tutorial_background_light</item> | ||||||
|         <item name="icon">@color/secondaryTextColor</item> |         <item name="icon">@color/secondaryTextColor</item> | ||||||
|  |         <item name="colorPrimary">@color/primaryDarkColor</item> | ||||||
|         <item name="colorPrimaryDark">@color/primaryDarkColor</item> |         <item name="colorPrimaryDark">@color/primaryDarkColor</item> | ||||||
|         <item name="colorAccent">@color/primaryColor</item> |         <item name="colorAccent">@color/primaryColor</item> | ||||||
|         <item name="colorButtonNormal">@color/primaryColor</item> |         <item name="colorButtonNormal">@color/primaryColor</item> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Neel Doshi
						Neel Doshi