Naming convention: Epoxy item classes have Itemsuffix

This commit is contained in:
Benoit Marty 2022-10-03 16:42:44 +02:00 committed by Benoit Marty
parent 24fe677e50
commit e282380ab8
8 changed files with 11 additions and 11 deletions

View File

@ -41,7 +41,7 @@ import org.matrix.android.sdk.api.session.presence.model.UserPresence
import org.matrix.android.sdk.api.util.MatrixItem import org.matrix.android.sdk.api.util.MatrixItem
@EpoxyModelClass @EpoxyModelClass
abstract class RoomSummaryItemCentered : VectorEpoxyModel<RoomSummaryItemCentered.Holder>(R.layout.item_room_centered) { abstract class RoomSummaryCenteredItem : VectorEpoxyModel<RoomSummaryCenteredItem.Holder>(R.layout.item_room_centered) {
@EpoxyAttribute @EpoxyAttribute
lateinit var avatarRenderer: AvatarRenderer lateinit var avatarRenderer: AvatarRenderer

View File

@ -191,7 +191,7 @@ class RoomSummaryItemFactory @Inject constructor(
unreadCount: Int, unreadCount: Int,
onClick: ((RoomSummary) -> Unit)?, onClick: ((RoomSummary) -> Unit)?,
onLongClick: ((RoomSummary) -> Boolean)? onLongClick: ((RoomSummary) -> Boolean)?
) = RoomSummaryItemCentered_() ) = RoomSummaryCenteredItem_()
.id(roomSummary.roomId) .id(roomSummary.roomId)
.avatarRenderer(avatarRenderer) .avatarRenderer(avatarRenderer)
// We do not display shield in the room list anymore // We do not display shield in the room list anymore

View File

@ -67,7 +67,7 @@ class RoomSummaryPagedController(
override fun buildItemModel(currentPosition: Int, item: RoomSummary?): EpoxyModel<*> { override fun buildItemModel(currentPosition: Int, item: RoomSummary?): EpoxyModel<*> {
return if (item == null) { return if (item == null) {
val host = this val host = this
RoomSummaryItemPlaceHolder_().apply { RoomSummaryPlaceHolderItem_().apply {
id(currentPosition) id(currentPosition)
useSingleLineForLastEvent(host.shouldUseSingleLine) useSingleLineForLastEvent(host.shouldUseSingleLine)
} }

View File

@ -24,7 +24,7 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder
import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.VectorEpoxyModel
@EpoxyModelClass @EpoxyModelClass
abstract class RoomSummaryItemPlaceHolder : VectorEpoxyModel<RoomSummaryItemPlaceHolder.Holder>(R.layout.item_room_placeholder) { abstract class RoomSummaryPlaceHolderItem : VectorEpoxyModel<RoomSummaryPlaceHolderItem.Holder>(R.layout.item_room_placeholder) {
@EpoxyAttribute @EpoxyAttribute
var useSingleLineForLastEvent: Boolean = false var useSingleLineForLastEvent: Boolean = false

View File

@ -22,6 +22,6 @@ import im.vector.app.core.epoxy.VectorEpoxyHolder
import im.vector.app.core.epoxy.VectorEpoxyModel import im.vector.app.core.epoxy.VectorEpoxyModel
@EpoxyModelClass @EpoxyModelClass
abstract class SpaceDirectoryFilterNoResults : VectorEpoxyModel<SpaceDirectoryFilterNoResults.Holder>(R.layout.item_space_directory_filter_no_results) { abstract class SpaceDirectoryFilterNoResultsItem : VectorEpoxyModel<SpaceDirectoryFilterNoResultsItem.Holder>(R.layout.item_space_directory_filter_no_results) {
class Holder : VectorEpoxyHolder() class Holder : VectorEpoxyHolder()
} }

View File

@ -24,7 +24,7 @@ import im.vector.app.core.utils.createUIHandler
import im.vector.app.features.home.RoomListDisplayMode import im.vector.app.features.home.RoomListDisplayMode
import im.vector.app.features.home.room.list.RoomListListener import im.vector.app.features.home.room.list.RoomListListener
import im.vector.app.features.home.room.list.RoomSummaryItemFactory import im.vector.app.features.home.room.list.RoomSummaryItemFactory
import im.vector.app.features.home.room.list.RoomSummaryItemPlaceHolder_ import im.vector.app.features.home.room.list.RoomSummaryPlaceHolderItem_
import im.vector.app.features.settings.FontScalePreferences import im.vector.app.features.settings.FontScalePreferences
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
import org.matrix.android.sdk.api.session.room.model.RoomSummary import org.matrix.android.sdk.api.session.room.model.RoomSummary
@ -83,7 +83,7 @@ class HomeFilteredRoomsController @Inject constructor(
override fun buildItemModel(currentPosition: Int, item: RoomSummary?): EpoxyModel<*> { override fun buildItemModel(currentPosition: Int, item: RoomSummary?): EpoxyModel<*> {
return if (item == null) { return if (item == null) {
val host = this val host = this
RoomSummaryItemPlaceHolder_().apply { RoomSummaryPlaceHolderItem_().apply {
id(currentPosition) id(currentPosition)
useSingleLineForLastEvent(host.shouldUseSingleLine) useSingleLineForLastEvent(host.shouldUseSingleLine)
} }

View File

@ -22,7 +22,7 @@ import im.vector.app.core.utils.createUIHandler
import im.vector.app.features.home.RoomListDisplayMode import im.vector.app.features.home.RoomListDisplayMode
import im.vector.app.features.home.room.list.RoomListListener import im.vector.app.features.home.room.list.RoomListListener
import im.vector.app.features.home.room.list.RoomSummaryItemFactory import im.vector.app.features.home.room.list.RoomSummaryItemFactory
import im.vector.app.features.home.room.list.RoomSummaryItemPlaceHolder_ import im.vector.app.features.home.room.list.RoomSummaryPlaceHolderItem_
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
import org.matrix.android.sdk.api.session.room.model.RoomSummary import org.matrix.android.sdk.api.session.room.model.RoomSummary
import javax.inject.Inject import javax.inject.Inject
@ -43,7 +43,7 @@ class InvitesController @Inject constructor(
var listener: RoomListListener? = null var listener: RoomListListener? = null
override fun buildItemModel(currentPosition: Int, item: RoomSummary?): EpoxyModel<*> { override fun buildItemModel(currentPosition: Int, item: RoomSummary?): EpoxyModel<*> {
item ?: return RoomSummaryItemPlaceHolder_().apply { id(currentPosition) } item ?: return RoomSummaryPlaceHolderItem_().apply { id(currentPosition) }
return roomSummaryItemFactory.create(item, roomChangeMembershipStates.orEmpty(), emptySet(), RoomListDisplayMode.ROOMS, listener) return roomSummaryItemFactory.create(item, roomChangeMembershipStates.orEmpty(), emptySet(), RoomListDisplayMode.ROOMS, listener)
} }
} }

View File

@ -34,7 +34,7 @@ import im.vector.app.core.ui.list.genericEmptyWithActionItem
import im.vector.app.core.ui.list.genericPillItem import im.vector.app.core.ui.list.genericPillItem
import im.vector.app.features.home.AvatarRenderer import im.vector.app.features.home.AvatarRenderer
import im.vector.app.features.home.room.list.spaceChildInfoItem import im.vector.app.features.home.room.list.spaceChildInfoItem
import im.vector.app.features.home.room.list.spaceDirectoryFilterNoResults import im.vector.app.features.home.room.list.spaceDirectoryFilterNoResultsItem
import im.vector.app.features.spaces.manage.SpaceChildInfoMatchFilter import im.vector.app.features.spaces.manage.SpaceChildInfoMatchFilter
import im.vector.lib.core.utils.epoxy.charsequence.toEpoxyCharSequence import im.vector.lib.core.utils.epoxy.charsequence.toEpoxyCharSequence
import me.gujun.android.span.span import me.gujun.android.span.span
@ -141,7 +141,7 @@ class SpaceDirectoryController @Inject constructor(
val filteredChildInfo = flattenChildInfo.filter { matchFilter.test(it) } val filteredChildInfo = flattenChildInfo.filter { matchFilter.test(it) }
if (filteredChildInfo.isEmpty()) { if (filteredChildInfo.isEmpty()) {
spaceDirectoryFilterNoResults { spaceDirectoryFilterNoResultsItem {
id("no_results") id("no_results")
} }
} else { } else {