1
0
Fork 0

For #10848 - Fixes bug where selected index wouldnt be properly calculated in private mode

master
Jeff Boek 2020-05-29 20:11:30 -07:00
parent d5c20bc0d0
commit f05890efec
2 changed files with 5 additions and 1 deletions

View File

@ -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)

View File

@ -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"