Commit 87a7b6f9 authored by ekager's avatar ekager Committed by Emily Kager
Browse files

For #12992 - Correctly notifies concat adapters about mode changes

parent 2c0511c9
...@@ -7,6 +7,7 @@ package org.mozilla.fenix.tabtray ...@@ -7,6 +7,7 @@ package org.mozilla.fenix.tabtray
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.view.isVisible
import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
...@@ -31,7 +32,10 @@ class SaveToCollectionsButtonAdapter( ...@@ -31,7 +32,10 @@ class SaveToCollectionsButtonAdapter(
return ViewHolder(itemView, interactor) return ViewHolder(itemView, interactor)
} }
override fun onBindViewHolder(holder: ViewHolder, position: Int) = Unit override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.itemView.isVisible =
interactor.onModeRequested() is TabTrayDialogFragmentState.Mode.Normal
}
override fun getItemViewType(position: Int): Int { override fun getItemViewType(position: Int): Int {
return ViewHolder.LAYOUT_ID return ViewHolder.LAYOUT_ID
......
...@@ -413,7 +413,8 @@ class TabTrayView( ...@@ -413,7 +413,8 @@ class TabTrayView(
isPrivateModeSelected isPrivateModeSelected
) )
this.adapter?.notifyItemRangeChanged(0, tabs.size, true) collectionsButtonAdapter.notifyItemChanged(0)
tabsAdapter.notifyItemRangeChanged(0, tabs.size, true)
} }
} }
...@@ -425,7 +426,7 @@ class TabTrayView( ...@@ -425,7 +426,7 @@ class TabTrayView(
val selectedBrowserTabIndex = tabs.indexOfFirst { it.id == itemId } val selectedBrowserTabIndex = tabs.indexOfFirst { it.id == itemId }
this.adapter?.notifyItemChanged( tabsAdapter.notifyItemChanged(
selectedBrowserTabIndex, true selectedBrowserTabIndex, true
) )
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment