Fixes recents background color not matching app bar

This commit is contained in:
ericdecanini 2022-09-05 18:07:22 +02:00
parent b37996e4c3
commit ad49b4513c
2 changed files with 7 additions and 1 deletions

View file

@ -23,6 +23,8 @@ import com.airbnb.epoxy.CarouselModelBuilder
import com.airbnb.epoxy.EpoxyController
import com.airbnb.epoxy.EpoxyModel
import com.airbnb.epoxy.carousel
import com.google.android.material.color.MaterialColors
import im.vector.app.R
import im.vector.app.features.home.AvatarRenderer
import im.vector.app.features.home.room.list.RoomListListener
import org.matrix.android.sdk.api.session.room.model.RoomSummary
@ -66,6 +68,10 @@ class RecentRoomCarouselController @Inject constructor(
0,
host.itemSpacing)
)
onBind { _, view, _ ->
val colorSurface = MaterialColors.getColor(view, R.attr.colorSurface)
view.setBackgroundColor(colorSurface)
}
withModelsFrom(data) { roomSummary ->
val onClick = host.listener?.let { it::onRoomClicked }
val onLongClick = host.listener?.let { it::onRoomLongClicked }

View file

@ -5,7 +5,7 @@
android:id="@+id/recentRoot"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:background="?android:colorBackground"
android:background="?colorSurface"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"