diff --git a/vector/src/main/java/im/vector/app/core/epoxy/TimelineEmptyItem.kt b/vector/src/main/java/im/vector/app/core/epoxy/TimelineEmptyItem.kt index 2339287cbe..b77670ba76 100644 --- a/vector/src/main/java/im/vector/app/core/epoxy/TimelineEmptyItem.kt +++ b/vector/src/main/java/im/vector/app/core/epoxy/TimelineEmptyItem.kt @@ -19,10 +19,10 @@ package im.vector.app.core.epoxy import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import im.vector.app.R -import im.vector.app.features.home.room.detail.timeline.item.IsEventItem +import im.vector.app.features.home.room.detail.timeline.item.ItemWithEvents @EpoxyModelClass(layout = R.layout.item_timeline_empty) -abstract class TimelineEmptyItem : VectorEpoxyModel(), IsEventItem { +abstract class TimelineEmptyItem : VectorEpoxyModel(), ItemWithEvents { @EpoxyAttribute lateinit var eventId: String diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/ScrollOnNewMessageCallback.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/ScrollOnNewMessageCallback.kt index 1ab8762895..fbf9ebe32f 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/ScrollOnNewMessageCallback.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/ScrollOnNewMessageCallback.kt @@ -19,7 +19,7 @@ package im.vector.app.features.home.room.detail import androidx.recyclerview.widget.LinearLayoutManager import im.vector.app.core.platform.DefaultListUpdateCallback import im.vector.app.features.home.room.detail.timeline.TimelineEventController -import im.vector.app.features.home.room.detail.timeline.item.IsEventItem +import im.vector.app.features.home.room.detail.timeline.item.ItemWithEvents import timber.log.Timber import java.util.concurrent.CopyOnWriteArrayList @@ -47,7 +47,7 @@ class ScrollOnNewMessageCallback(private val layoutManager: LinearLayoutManager, if (layoutManager.findFirstVisibleItemPosition() != position) { return } - val firstNewItem = timelineEventController.adapter.getModelAtPosition(position) as? IsEventItem ?: return + val firstNewItem = timelineEventController.adapter.getModelAtPosition(position) as? ItemWithEvents ?: return val firstNewItemIds = firstNewItem.getEventIds().firstOrNull() ?: return val indexOfFirstNewItem = newTimelineEventIds.indexOf(firstNewItemIds) if (indexOfFirstNewItem != -1) { diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineControllerInterceptorHelper.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineControllerInterceptorHelper.kt index 6226ab7add..971a3a35d8 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineControllerInterceptorHelper.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/helper/TimelineControllerInterceptorHelper.kt @@ -24,7 +24,7 @@ import im.vector.app.features.call.webrtc.WebRtcCallManager import im.vector.app.features.home.room.detail.UnreadState import im.vector.app.features.home.room.detail.timeline.TimelineEventController import im.vector.app.features.home.room.detail.timeline.item.CallTileTimelineItem -import im.vector.app.features.home.room.detail.timeline.item.IsEventItem +import im.vector.app.features.home.room.detail.timeline.item.ItemWithEvents import im.vector.app.features.home.room.detail.timeline.item.TimelineReadMarkerItem_ import im.vector.app.features.settings.VectorPreferences import org.matrix.android.sdk.api.session.room.timeline.Timeline @@ -61,7 +61,7 @@ class TimelineControllerInterceptorHelper(private val positionOfReadMarker: KMut val firstUnreadEventId = (unreadState as? UnreadState.HasUnread)?.firstUnreadEventId // Then iterate on models so we have the exact positions in the adapter modelsIterator.forEach { epoxyModel -> - if (epoxyModel is IsEventItem) { + if (epoxyModel is ItemWithEvents) { epoxyModel.getEventIds().forEach { eventId -> adapterPositionMapping[eventId] = index if (eventId == firstUnreadEventId) { diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BaseEventItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BaseEventItem.kt index 8546ed7e0f..13bb6db6ef 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BaseEventItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/BaseEventItem.kt @@ -32,7 +32,7 @@ import im.vector.app.core.utils.DimensionConverter /** * Children must override getViewType() */ -abstract class BaseEventItem : VectorEpoxyModel(), IsEventItem { +abstract class BaseEventItem : VectorEpoxyModel(), ItemWithEvents { // To use for instance when opening a permalink with an eventId @EpoxyAttribute diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/IsEventItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/ItemWithEvents.kt similarity index 96% rename from vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/IsEventItem.kt rename to vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/ItemWithEvents.kt index 4c2eeea48b..cf4211bb2c 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/IsEventItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/ItemWithEvents.kt @@ -16,7 +16,7 @@ package im.vector.app.features.home.room.detail.timeline.item -interface IsEventItem { +interface ItemWithEvents { /** * Returns the eventIds associated with the EventItem. * Will generally get only one, but it handles the merged items.