mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-24 23:27:40 +01:00
hide the value only if we have no data yet
This commit is contained in:
parent
bdb9fd47b8
commit
dcac05922a
@ -62,7 +62,7 @@ class FilterContactSourcesAdapter(
|
|||||||
itemView.apply {
|
itemView.apply {
|
||||||
filter_contact_source_checkbox.isChecked = isSelected
|
filter_contact_source_checkbox.isChecked = isSelected
|
||||||
filter_contact_source_checkbox.setColors(activity.getProperTextColor(), activity.getProperPrimaryColor(), activity.getProperBackgroundColor())
|
filter_contact_source_checkbox.setColors(activity.getProperTextColor(), activity.getProperPrimaryColor(), activity.getProperBackgroundColor())
|
||||||
val countText = if (contactSource.count > 0) " (${contactSource.count})" else ""
|
val countText = if (contactSource.count >= 0) " (${contactSource.count})" else ""
|
||||||
val displayName = "${contactSource.publicName}$countText"
|
val displayName = "${contactSource.publicName}$countText"
|
||||||
filter_contact_source_checkbox.text = displayName
|
filter_contact_source_checkbox.text = displayName
|
||||||
filter_contact_source_holder.setOnClickListener { viewClicked(!isSelected, contactSource) }
|
filter_contact_source_holder.setOnClickListener { viewClicked(!isSelected, contactSource) }
|
||||||
|
@ -42,7 +42,11 @@ class FilterContactSourcesDialog(val activity: SimpleActivity, private val callb
|
|||||||
|
|
||||||
val contactSourcesWithCount = ArrayList<ContactSource>()
|
val contactSourcesWithCount = ArrayList<ContactSource>()
|
||||||
for (contactSource in contactSources) {
|
for (contactSource in contactSources) {
|
||||||
val count = contacts.filter { it.source == contactSource.name }.count()
|
val count = if (isContactsReady) {
|
||||||
|
contacts.filter { it.source == contactSource.name }.count()
|
||||||
|
} else {
|
||||||
|
-1
|
||||||
|
}
|
||||||
contactSourcesWithCount.add(contactSource.copy(count = count))
|
contactSourcesWithCount.add(contactSource.copy(count = count))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user