mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
properly refresh contacts when thumbnail visibility changes
This commit is contained in:
@ -77,14 +77,15 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (storedShowContactThumbnails != config.showContactThumbnails) {
|
if (storedShowPhoneNumbers != config.showPhoneNumbers) {
|
||||||
restartActivity()
|
restartActivity()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (storedShowPhoneNumbers != config.showPhoneNumbers) {
|
val configShowContactThumbnails = config.showContactThumbnails
|
||||||
restartActivity()
|
if (storedShowContactThumbnails != configShowContactThumbnails) {
|
||||||
return
|
contacts_fragment.showContactThumbnailsChanged(configShowContactThumbnails)
|
||||||
|
favorites_fragment.showContactThumbnailsChanged(configShowContactThumbnails)
|
||||||
}
|
}
|
||||||
|
|
||||||
val configTextColor = config.textColor
|
val configTextColor = config.textColor
|
||||||
|
@ -24,7 +24,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||||||
protected var activity: MainActivity? = null
|
protected var activity: MainActivity? = null
|
||||||
private var lastHashCode = 0
|
private var lastHashCode = 0
|
||||||
private var contactsIgnoringSearch = ArrayList<Contact>()
|
private var contactsIgnoringSearch = ArrayList<Contact>()
|
||||||
lateinit private var config: Config
|
private lateinit var config: Config
|
||||||
|
|
||||||
var forceListRedraw = false
|
var forceListRedraw = false
|
||||||
|
|
||||||
@ -144,11 +144,19 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||||||
(currAdapter as ContactsAdapter).apply {
|
(currAdapter as ContactsAdapter).apply {
|
||||||
startNameWithSurname = config.startNameWithSurname
|
startNameWithSurname = config.startNameWithSurname
|
||||||
showPhoneNumbers = config.showPhoneNumbers
|
showPhoneNumbers = config.showPhoneNumbers
|
||||||
|
showContactThumbnails = config.showContactThumbnails
|
||||||
updateItems(contacts)
|
updateItems(contacts)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun showContactThumbnailsChanged(showThumbnails: Boolean) {
|
||||||
|
(fragment_list.adapter as? ContactsAdapter)?.apply {
|
||||||
|
showContactThumbnails = showThumbnails
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun onActivityResume() {
|
fun onActivityResume() {
|
||||||
updateViewStuff()
|
updateViewStuff()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user