private fun getCFRToShow(): Result { var result: Result = Result.None val count = recyclerView.adapter?.itemCount ?: return result for (index in count downTo 0) { val viewHolder = recyclerView.findViewHolderForAdapterPosition(index) if (context.settings().showSyncCFR && viewHolder is RecentSyncedTabViewHolder) { result = Result.SyncedTab(view = viewHolder.composeView) break } else if (context.settings().shouldShowJumpBackInCFR && viewHolder is RecentTabsHeaderViewHolder ) { result = Result.JumpBackIn(view = viewHolder.composeView) } } return result }
Returns a [Result] that indicates the CFR that should be shown on the Home screen if any based on the views available and the preferences.