|
|
|
@ -120,11 +120,13 @@ class HomeFragment : Fragment(), AccountObserver {
|
|
|
|
|
|
|
|
|
|
private val preDrawListener = object : ViewTreeObserver.OnPreDrawListener {
|
|
|
|
|
override fun onPreDraw(): Boolean {
|
|
|
|
|
if (view != null) {
|
|
|
|
|
viewLifecycleOwner.lifecycleScope.launch {
|
|
|
|
|
delay(ANIM_SCROLL_DELAY)
|
|
|
|
|
restoreLayoutState()
|
|
|
|
|
// startPostponedEnterTransition()
|
|
|
|
|
}.invokeOnCompletion { sessionControlComponent.view.viewTreeObserver.removeOnPreDrawListener(this) }
|
|
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -753,6 +755,7 @@ class HomeFragment : Fragment(), AccountObserver {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun scrollAndAnimateCollection(tabsAddedToCollectionSize: Int, changedCollection: TabCollection? = null) {
|
|
|
|
|
if (view != null) {
|
|
|
|
|
viewLifecycleOwner.lifecycleScope.launch {
|
|
|
|
|
val recyclerView = sessionControlComponent.view
|
|
|
|
|
delay(ANIM_SCROLL_DELAY)
|
|
|
|
@ -760,7 +763,8 @@ class HomeFragment : Fragment(), AccountObserver {
|
|
|
|
|
|
|
|
|
|
var indexOfCollection = tabsSize + NON_TAB_ITEM_NUM
|
|
|
|
|
changedCollection?.let { changedCollection ->
|
|
|
|
|
requireComponents.core.tabCollectionStorage.cachedTabCollections.filterIndexed { index, tabCollection ->
|
|
|
|
|
requireComponents.core.tabCollectionStorage.cachedTabCollections
|
|
|
|
|
.filterIndexed { index, tabCollection ->
|
|
|
|
|
if (tabCollection.id == changedCollection.id) {
|
|
|
|
|
indexOfCollection = tabsSize + NON_TAB_ITEM_NUM + index
|
|
|
|
|
return@filterIndexed true
|
|
|
|
@ -787,6 +791,7 @@ class HomeFragment : Fragment(), AccountObserver {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun animateCollection(addedTabsSize: Int, indexOfCollection: Int) {
|
|
|
|
|
viewLifecycleOwner.lifecycleScope.launch {
|
|
|
|
|