For #10848 - Fixes bug where selected index wouldnt be properly calculated in private mode
This commit is contained in:
parent
d5c20bc0d0
commit
f05890efec
|
@ -49,6 +49,9 @@ class TabTrayViewHolder(itemView: View) : TabViewHolder(itemView) {
|
|||
* Displays the data of the given session and notifies the given observable about events.
|
||||
*/
|
||||
override fun bind(tab: Tab, isSelected: Boolean, observable: Observable<TabsTray.Observer>) {
|
||||
// This is a hack to workaround a bug in a-c.
|
||||
// https://github.com/mozilla-mobile/android-components/issues/7186
|
||||
val isSelected2 = tab.id == itemView.context.components.core.store.state.selectedTabId
|
||||
this.tab = tab
|
||||
|
||||
// Basic text
|
||||
|
@ -57,7 +60,7 @@ class TabTrayViewHolder(itemView: View) : TabViewHolder(itemView) {
|
|||
updateCloseButtonDescription(tab.title)
|
||||
|
||||
// Drawables and theme
|
||||
updateBackgroundColor(isSelected)
|
||||
updateBackgroundColor(isSelected2)
|
||||
thumbnailView.setImageBitmap(tab.thumbnail)
|
||||
iconView?.setImageBitmap(tab.icon)
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
android:id="@+id/tab_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="@color/foundation_normal_theme"
|
||||
app:tabIndicatorColor="@color/accent_normal_theme"
|
||||
app:tabIconTint="@color/tab_icon"
|
||||
app:tabRippleColor="@android:color/transparent"
|
||||
|
|
Loading…
Reference in New Issue
Block a user