@@ -78,9 +78,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
7878
7979 private val groupAdapter = GroupAdapter <GroupieViewHolder <FeedItemCarouselBinding >>()
8080 private val feedGroupsSection = Section ()
81- private val feedGroupsVerticalSection = Section ()
8281 private var feedGroupsCarousel: FeedGroupCarouselItem ? = null
83- private var feedGroupsVerticalCarousel: FeedGroupCarouselItem ? = null
8482 private lateinit var feedGroupsSortMenuItem: HeaderWithMenuItem
8583 private val subscriptionsSection = Section ()
8684 private var defaultListView: Boolean = true
@@ -284,7 +282,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
284282 getString(R .string.feed_groups_header_title),
285283 R .drawable.ic_list,
286284 R .drawable.ic_sort,
287- listViewOnClickListener = ::changeLayout ,
285+ listViewOnClickListener = ::changeVerticalLayout ,
288286 menuItemOnClickListener = ::openReorderDialog
289287 )
290288
@@ -307,13 +305,13 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
307305 view?.let { initViews(it, savedInstanceState = Bundle ()) }
308306 }
309307
310- private fun changeLayout () {
308+ private fun changeVerticalLayout () {
311309 defaultListView = false
312310 Section ().apply {
313311 val carouselAdapter = GroupAdapter <GroupieViewHolder <FeedItemCarouselBinding >>()
314312
315313 carouselAdapter.add(FeedGroupCardVerticalItem (- 1 , getString(R .string.all), FeedGroupIcon .RSS ))
316- carouselAdapter.add(feedGroupsVerticalSection )
314+ carouselAdapter.add(feedGroupsSection )
317315 carouselAdapter.add(FeedGroupAddVerticalItem ())
318316
319317 carouselAdapter.setOnItemClickListener { item, _ ->
@@ -328,7 +326,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
328326 listenerFeedVerticalGroups.held(item)
329327 return @setOnItemLongClickListener true
330328 }
331- feedGroupsVerticalCarousel = FeedGroupCarouselItem (requireContext(), carouselAdapter, RecyclerView .VERTICAL )
329+ feedGroupsCarousel = FeedGroupCarouselItem (requireContext(), carouselAdapter, RecyclerView .VERTICAL )
332330
333331 feedGroupsSortMenuItem = HeaderWithMenuItem (
334332 getString(R .string.feed_groups_header_title),
@@ -337,7 +335,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
337335 listViewOnClickListener = ::setupInitialLayout,
338336 menuItemOnClickListener = ::openReorderDialog
339337 )
340- add(Section (feedGroupsSortMenuItem, listOf (feedGroupsVerticalCarousel )))
338+ add(Section (feedGroupsSortMenuItem, listOf (feedGroupsCarousel )))
341339 groupAdapter.clear()
342340 groupAdapter.add(this )
343341 }
@@ -499,10 +497,10 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
499497
500498 private fun handleFeedGroupsVertical (groups : List <Group >) {
501499 if (! defaultListView) {
502- feedGroupsVerticalSection .update(groups)
500+ feedGroupsSection .update(groups)
503501
504502 if (feedGroupsListVerticalState != null ) {
505- feedGroupsVerticalCarousel ?.onRestoreInstanceState(feedGroupsListVerticalState)
503+ feedGroupsCarousel ?.onRestoreInstanceState(feedGroupsListVerticalState)
506504 feedGroupsListVerticalState = null
507505 }
508506
0 commit comments