use layout animations only if they arent disabled by the system

This commit is contained in:
tibbi
2021-11-17 09:54:44 +01:00
parent 8d9c000a08
commit 8707684013
4 changed files with 21 additions and 5 deletions

View File

@ -178,7 +178,10 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
fragment_list.adapter = this
}
fragment_list.scheduleLayoutAnimation()
if (context.areSystemAnimationsEnabled) {
fragment_list.scheduleLayoutAnimation()
}
fragment_fastscroller.setScrollToY(0)
fragment_fastscroller.setViews(fragment_list) {
val item = (fragment_list.adapter as GroupsAdapter).groups.getOrNull(it)
@ -211,7 +214,10 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
}.apply {
fragment_list.adapter = this
}
fragment_list.scheduleLayoutAnimation()
if (context.areSystemAnimationsEnabled) {
fragment_list.scheduleLayoutAnimation()
}
} else {
(currAdapter as ContactsAdapter).apply {
startNameWithSurname = config.startNameWithSurname