mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 01:55:04 +08:00
Rename some classes with "Item" suffix, as a convention (ooi)
This commit is contained in:
parent
c69852c849
commit
69f923383c
@ -29,7 +29,7 @@ class SasEmojiController : TypedEpoxyController<SasState>() {
|
||||
if (data == null) return
|
||||
|
||||
data.emojiList.forEachIndexed { idx, emojiRepresentation ->
|
||||
itemSasEmoji {
|
||||
sasEmojiItem {
|
||||
id(idx)
|
||||
index(idx)
|
||||
emojiRepresentation(emojiRepresentation)
|
||||
|
@ -25,7 +25,7 @@ import im.vector.riotx.core.epoxy.VectorEpoxyHolder
|
||||
import im.vector.riotx.core.epoxy.VectorEpoxyModel
|
||||
|
||||
@EpoxyModelClass(layout = im.vector.riotx.R.layout.item_sas_emoji)
|
||||
abstract class ItemSasEmoji : VectorEpoxyModel<ItemSasEmoji.Holder>() {
|
||||
abstract class SasEmojiItem : VectorEpoxyModel<SasEmojiItem.Holder>() {
|
||||
|
||||
@EpoxyAttribute
|
||||
var index: Int = 0
|
@ -37,7 +37,7 @@ import im.vector.riotx.features.themes.ThemeUtils
|
||||
* A action for bottom sheet.
|
||||
*/
|
||||
@EpoxyModelClass(layout = R.layout.item_bottom_sheet_action)
|
||||
abstract class BottomSheetItemAction : VectorEpoxyModel<BottomSheetItemAction.Holder>() {
|
||||
abstract class BottomSheetActionItem : VectorEpoxyModel<BottomSheetActionItem.Holder>() {
|
||||
|
||||
@EpoxyAttribute
|
||||
@DrawableRes
|
@ -32,7 +32,7 @@ import im.vector.riotx.features.home.room.detail.timeline.tools.findPillsAndProc
|
||||
* A message preview for bottom sheet.
|
||||
*/
|
||||
@EpoxyModelClass(layout = R.layout.item_bottom_sheet_message_preview)
|
||||
abstract class BottomSheetItemMessagePreview : VectorEpoxyModel<BottomSheetItemMessagePreview.Holder>() {
|
||||
abstract class BottomSheetMessagePreviewItem : VectorEpoxyModel<BottomSheetMessagePreviewItem.Holder>() {
|
||||
|
||||
@EpoxyAttribute
|
||||
lateinit var avatarRenderer: AvatarRenderer
|
@ -29,7 +29,7 @@ import im.vector.riotx.core.epoxy.VectorEpoxyModel
|
||||
* A quick reaction list for bottom sheet.
|
||||
*/
|
||||
@EpoxyModelClass(layout = R.layout.item_bottom_sheet_quick_reaction)
|
||||
abstract class BottomSheetItemQuickReactions : VectorEpoxyModel<BottomSheetItemQuickReactions.Holder>() {
|
||||
abstract class BottomSheetQuickReactionsItem : VectorEpoxyModel<BottomSheetQuickReactionsItem.Holder>() {
|
||||
|
||||
@EpoxyAttribute
|
||||
lateinit var fontProvider: EmojiCompatFontProvider
|
@ -31,7 +31,7 @@ import im.vector.riotx.features.home.AvatarRenderer
|
||||
* A room preview for bottom sheet.
|
||||
*/
|
||||
@EpoxyModelClass(layout = R.layout.item_bottom_sheet_room_preview)
|
||||
abstract class BottomSheetItemRoomPreview : VectorEpoxyModel<BottomSheetItemRoomPreview.Holder>() {
|
||||
abstract class BottomSheetRoomPreviewItem : VectorEpoxyModel<BottomSheetRoomPreviewItem.Holder>() {
|
||||
|
||||
@EpoxyAttribute
|
||||
lateinit var avatarRenderer: AvatarRenderer
|
@ -30,7 +30,7 @@ import im.vector.riotx.core.epoxy.VectorEpoxyModel
|
||||
* A send state for bottom sheet.
|
||||
*/
|
||||
@EpoxyModelClass(layout = R.layout.item_bottom_sheet_message_status)
|
||||
abstract class BottomSheetItemSendState : VectorEpoxyModel<BottomSheetItemSendState.Holder>() {
|
||||
abstract class BottomSheetSendStateItem : VectorEpoxyModel<BottomSheetSendStateItem.Holder>() {
|
||||
|
||||
@EpoxyAttribute
|
||||
var showProgress: Boolean = false
|
@ -22,7 +22,7 @@ import im.vector.riotx.core.epoxy.VectorEpoxyHolder
|
||||
import im.vector.riotx.core.epoxy.VectorEpoxyModel
|
||||
|
||||
@EpoxyModelClass(layout = R.layout.item_bottom_sheet_divider)
|
||||
abstract class BottomSheetItemSeparator : VectorEpoxyModel<BottomSheetItemSeparator.Holder>() {
|
||||
abstract class BottomSheetSeparatorItem : VectorEpoxyModel<BottomSheetSeparatorItem.Holder>() {
|
||||
|
||||
class Holder : VectorEpoxyHolder()
|
||||
}
|
@ -41,7 +41,7 @@ class MessageActionsEpoxyController @Inject constructor(private val stringProvid
|
||||
// Message preview
|
||||
val body = state.messageBody
|
||||
if (body != null) {
|
||||
bottomSheetItemMessagePreview {
|
||||
bottomSheetMessagePreviewItem {
|
||||
id("preview")
|
||||
avatarRenderer(avatarRenderer)
|
||||
avatarUrl(state.informationData.avatarUrl ?: "")
|
||||
@ -55,13 +55,13 @@ class MessageActionsEpoxyController @Inject constructor(private val stringProvid
|
||||
|
||||
// Send state
|
||||
if (state.informationData.sendState.isSending()) {
|
||||
bottomSheetItemSendState {
|
||||
bottomSheetSendStateItem {
|
||||
id("send_state")
|
||||
showProgress(true)
|
||||
text(stringProvider.getString(R.string.event_status_sending_message))
|
||||
}
|
||||
} else if (state.informationData.sendState.hasFailed()) {
|
||||
bottomSheetItemSendState {
|
||||
bottomSheetSendStateItem {
|
||||
id("send_state")
|
||||
showProgress(false)
|
||||
text(stringProvider.getString(R.string.unable_to_send_message))
|
||||
@ -72,16 +72,16 @@ class MessageActionsEpoxyController @Inject constructor(private val stringProvid
|
||||
// Quick reactions
|
||||
if (state.canReact() && state.quickStates is Success) {
|
||||
// Separator
|
||||
bottomSheetItemSeparator {
|
||||
bottomSheetSeparatorItem {
|
||||
id("reaction_separator")
|
||||
}
|
||||
|
||||
bottomSheetItemQuickReactions {
|
||||
bottomSheetQuickReactionsItem {
|
||||
id("quick_reaction")
|
||||
fontProvider(fontProvider)
|
||||
texts(state.quickStates()?.map { it.reaction }.orEmpty())
|
||||
selecteds(state.quickStates.invoke().map { it.isSelected })
|
||||
listener(object : BottomSheetItemQuickReactions.Listener {
|
||||
listener(object : BottomSheetQuickReactionsItem.Listener {
|
||||
override fun didSelect(emoji: String, selected: Boolean) {
|
||||
listener?.didSelectMenuAction(EventSharedAction.QuickReact(state.eventId, emoji, selected))
|
||||
}
|
||||
@ -90,18 +90,18 @@ class MessageActionsEpoxyController @Inject constructor(private val stringProvid
|
||||
}
|
||||
|
||||
// Separator
|
||||
bottomSheetItemSeparator {
|
||||
bottomSheetSeparatorItem {
|
||||
id("actions_separator")
|
||||
}
|
||||
|
||||
// Action
|
||||
state.actions()?.forEachIndexed { index, action ->
|
||||
if (action is EventSharedAction.Separator) {
|
||||
bottomSheetItemSeparator {
|
||||
bottomSheetSeparatorItem {
|
||||
id("separator_$index")
|
||||
}
|
||||
} else {
|
||||
bottomSheetItemAction {
|
||||
bottomSheetActionItem {
|
||||
id("action_$index")
|
||||
iconRes(action.iconResId)
|
||||
textRes(action.titleRes)
|
||||
@ -118,7 +118,7 @@ class MessageActionsEpoxyController @Inject constructor(private val stringProvid
|
||||
EventSharedAction.ReportContentInappropriate(action.eventId, action.senderId),
|
||||
EventSharedAction.ReportContentCustom(action.eventId, action.senderId)
|
||||
).forEachIndexed { indexReport, actionReport ->
|
||||
bottomSheetItemAction {
|
||||
bottomSheetActionItem {
|
||||
id("actionReport_$indexReport")
|
||||
subMenuItem(true)
|
||||
iconRes(actionReport.iconResId)
|
||||
|
@ -18,9 +18,9 @@ package im.vector.riotx.features.home.room.list.actions
|
||||
import android.view.View
|
||||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import im.vector.matrix.android.api.session.room.notification.RoomNotificationState
|
||||
import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetItemAction
|
||||
import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetItemRoomPreview
|
||||
import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetItemSeparator
|
||||
import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetActionItem
|
||||
import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetRoomPreviewItem
|
||||
import im.vector.riotx.core.epoxy.bottomsheet.bottomSheetSeparatorItem
|
||||
import im.vector.riotx.features.home.AvatarRenderer
|
||||
import javax.inject.Inject
|
||||
|
||||
@ -36,7 +36,7 @@ class RoomListQuickActionsEpoxyController @Inject constructor(private val avatar
|
||||
val roomSummary = state.roomSummary() ?: return
|
||||
|
||||
// Preview
|
||||
bottomSheetItemRoomPreview {
|
||||
bottomSheetRoomPreviewItem {
|
||||
id("preview")
|
||||
avatarRenderer(avatarRenderer)
|
||||
roomName(roomSummary.displayName)
|
||||
@ -46,7 +46,7 @@ class RoomListQuickActionsEpoxyController @Inject constructor(private val avatar
|
||||
}
|
||||
|
||||
// Notifications
|
||||
bottomSheetItemSeparator {
|
||||
bottomSheetSeparatorItem {
|
||||
id("notifications_separator")
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ class RoomListQuickActionsEpoxyController @Inject constructor(private val avatar
|
||||
RoomListQuickActionsSharedAction.NotificationsMute(roomSummary.roomId).toBottomSheetItem(3, selectedRoomState)
|
||||
|
||||
// Leave
|
||||
bottomSheetItemSeparator {
|
||||
bottomSheetSeparatorItem {
|
||||
id("leave_separator")
|
||||
}
|
||||
RoomListQuickActionsSharedAction.Leave(roomSummary.roomId).toBottomSheetItem(5)
|
||||
@ -72,7 +72,7 @@ class RoomListQuickActionsEpoxyController @Inject constructor(private val avatar
|
||||
is RoomListQuickActionsSharedAction.Settings,
|
||||
is RoomListQuickActionsSharedAction.Leave -> false
|
||||
}
|
||||
return bottomSheetItemAction {
|
||||
return bottomSheetActionItem {
|
||||
id("action_$index")
|
||||
selected(selected)
|
||||
iconRes(iconResId)
|
||||
|
Loading…
Reference in New Issue
Block a user