update the font size after it gets changed in the app settings
This commit is contained in:
parent
fe4e6767aa
commit
78294997e9
|
@ -59,6 +59,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||
private var storedShowContactThumbnails = false
|
||||
private var storedShowPhoneNumbers = false
|
||||
private var storedStartNameWithSurname = false
|
||||
private var storedFontSize = 0
|
||||
private var storedShowTabs = 0
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
@ -137,6 +138,13 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||
favorites_fragment?.startNameWithSurnameChanged(configStartNameWithSurname)
|
||||
}
|
||||
|
||||
val configFontSize = config.fontSize
|
||||
if (storedFontSize != configFontSize) {
|
||||
getAllFragments().forEach {
|
||||
it?.fontSizeChanged()
|
||||
}
|
||||
}
|
||||
|
||||
if (werePermissionsHandled && !isFirstResume) {
|
||||
if (viewpager.adapter == null) {
|
||||
initFragments()
|
||||
|
@ -218,6 +226,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||
storedShowPhoneNumbers = showPhoneNumbers
|
||||
storedStartNameWithSurname = startNameWithSurname
|
||||
storedShowTabs = showTabs
|
||||
storedFontSize = fontSize
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -232,6 +232,20 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||
}
|
||||
}
|
||||
|
||||
fun fontSizeChanged() {
|
||||
if (this is GroupsFragment) {
|
||||
(fragment_list.adapter as? GroupsAdapter)?.apply {
|
||||
fontSize = activity.getTextSize()
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
} else {
|
||||
(fragment_list.adapter as? ContactsAdapter)?.apply {
|
||||
fontSize = activity.getTextSize()
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onActivityResume() {
|
||||
updateViewStuff()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue