1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-22 06:37:30 +00:00

show full count on longclick

This commit is contained in:
Austin Huang 2021-07-11 14:03:24 -04:00
parent a6194bf6b8
commit d3ac655784
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F

View File

@ -13,6 +13,7 @@ import android.view.*
import android.widget.Toast import android.widget.Toast
import androidx.activity.OnBackPressedCallback import androidx.activity.OnBackPressedCallback
import androidx.appcompat.content.res.AppCompatResources import androidx.appcompat.content.res.AppCompatResources
import androidx.appcompat.widget.TooltipCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction import androidx.fragment.app.FragmentTransaction
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
@ -680,6 +681,9 @@ class ProfileFragment : Fragment(), OnRefreshListener, ConfirmDialogFragmentCall
} }
binding.header.mainPostCount.visibility = View.VISIBLE binding.header.mainPostCount.visibility = View.VISIBLE
binding.header.mainPostCount.text = getCountSpan(R.plurals.main_posts_count, abbreviate(count, null), count) 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?) { private fun setupFollowing(count: Long?) {
@ -696,6 +700,9 @@ class ProfileFragment : Fragment(), OnRefreshListener, ConfirmDialogFragmentCall
return return
} }
binding.header.mainFollowing.setOnClickListener(onFollowingClickListener) binding.header.mainFollowing.setOnClickListener(onFollowingClickListener)
if (count >= 1000) {
TooltipCompat.setTooltipText(binding.header.mainFollowing, count.toString(10))
}
} }
private fun setupFollowers(count: Long?) { private fun setupFollowers(count: Long?) {
@ -710,6 +717,9 @@ class ProfileFragment : Fragment(), OnRefreshListener, ConfirmDialogFragmentCall
return return
} }
binding.header.mainFollowers.setOnClickListener(onFollowersClickListener) binding.header.mainFollowers.setOnClickListener(onFollowersClickListener)
if (count >= 1000) {
TooltipCompat.setTooltipText(binding.header.mainFollowers, count.toString(10))
}
} }
private fun setupDMButton(currentUser: User?, profile: User?) { private fun setupDMButton(currentUser: User?, profile: User?) {