From d3ac655784f7a4200c8ef8ca061168bf0b9213cc Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Sun, 11 Jul 2021 14:03:24 -0400 Subject: [PATCH] show full count on longclick --- .../instagrabber/fragments/main/ProfileFragment.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.kt b/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.kt index 9e93c0b0..c199b461 100644 --- a/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.kt +++ b/app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.kt @@ -13,6 +13,7 @@ import android.view.* import android.widget.Toast import androidx.activity.OnBackPressedCallback import androidx.appcompat.content.res.AppCompatResources +import androidx.appcompat.widget.TooltipCompat import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentTransaction import androidx.lifecycle.MutableLiveData @@ -680,6 +681,9 @@ class ProfileFragment : Fragment(), OnRefreshListener, ConfirmDialogFragmentCall } binding.header.mainPostCount.visibility = View.VISIBLE binding.header.mainPostCount.text = getCountSpan(R.plurals.main_posts_count, abbreviate(count, null), count) + if (count >= 1000) { + TooltipCompat.setTooltipText(binding.header.mainPostCount, count.toString(10)) + } } private fun setupFollowing(count: Long?) { @@ -696,6 +700,9 @@ class ProfileFragment : Fragment(), OnRefreshListener, ConfirmDialogFragmentCall return } binding.header.mainFollowing.setOnClickListener(onFollowingClickListener) + if (count >= 1000) { + TooltipCompat.setTooltipText(binding.header.mainFollowing, count.toString(10)) + } } private fun setupFollowers(count: Long?) { @@ -710,6 +717,9 @@ class ProfileFragment : Fragment(), OnRefreshListener, ConfirmDialogFragmentCall return } binding.header.mainFollowers.setOnClickListener(onFollowersClickListener) + if (count >= 1000) { + TooltipCompat.setTooltipText(binding.header.mainFollowers, count.toString(10)) + } } private fun setupDMButton(currentUser: User?, profile: User?) {