Rename class to follow naling convention for Epoxy items

This commit is contained in:
Benoit Marty 2021-05-31 15:52:11 +02:00 committed by Benoit Marty
parent 243b6a93f4
commit ffde34cbb2
11 changed files with 25 additions and 27 deletions

View File

@ -29,7 +29,7 @@ import im.vector.app.features.themes.ThemeUtils
* A generic list item header left aligned with notice color.
*/
@EpoxyModelClass(layout = R.layout.item_generic_header)
abstract class GenericItemHeader : VectorEpoxyModel<GenericItemHeader.Holder>() {
abstract class GenericHeaderItem : VectorEpoxyModel<GenericHeaderItem.Holder>() {
@EpoxyAttribute
var text: String? = null

View File

@ -37,9 +37,8 @@ import im.vector.app.features.themes.ThemeUtils
* Can display an accessory on the right, that can be an image or an indeterminate progress.
* If provided with an action, will display a button at the bottom of the list item.
*/
// TODO This class is not following the name convention. Should end with `Item
@EpoxyModelClass(layout = R.layout.item_generic_with_value)
abstract class GenericItemWithValue : VectorEpoxyModel<GenericItemWithValue.Holder>() {
abstract class GenericWithValueItem : VectorEpoxyModel<GenericWithValueItem.Holder>() {
@EpoxyAttribute
var title: CharSequence? = null

View File

@ -29,7 +29,7 @@ import im.vector.app.core.date.VectorDateFormatter
import im.vector.app.core.epoxy.loadingItem
import im.vector.app.core.epoxy.noResultItem
import im.vector.app.core.resources.StringProvider
import im.vector.app.core.ui.list.GenericItemHeader_
import im.vector.app.core.ui.list.GenericHeaderItem_
import im.vector.app.features.home.AvatarRenderer
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.events.model.Content
@ -111,7 +111,7 @@ class SearchResultController @Inject constructor(
timeInMillis = eventAndSender.event.originServerTs ?: System.currentTimeMillis()
}
if (lastDate?.get(Calendar.DAY_OF_YEAR) != eventDate.get(Calendar.DAY_OF_YEAR)) {
GenericItemHeader_()
GenericHeaderItem_()
.id(eventDate.hashCode())
.text(dateFormatter.format(eventDate.timeInMillis, DateFormatKind.EDIT_HISTORY_HEADER))
.let { result.add(it) }

View File

@ -26,8 +26,8 @@ import im.vector.app.core.date.VectorDateFormatter
import im.vector.app.core.resources.ColorProvider
import im.vector.app.core.resources.StringProvider
import im.vector.app.core.ui.list.genericFooterItem
import im.vector.app.core.ui.list.genericHeaderItem
import im.vector.app.core.ui.list.genericItem
import im.vector.app.core.ui.list.genericItemHeader
import im.vector.app.core.ui.list.genericLoaderItem
import im.vector.app.features.html.EventHtmlRenderer
import me.gujun.android.span.span
@ -87,7 +87,7 @@ class ViewEditHistoryEpoxyController @Inject constructor(
}
if (lastDate?.get(Calendar.DAY_OF_YEAR) != evDate.get(Calendar.DAY_OF_YEAR)) {
// need to display header with day
genericItemHeader {
genericHeaderItem {
id(evDate.hashCode())
text(host.dateFormatter.format(evDate.timeInMillis, DateFormatKind.EDIT_HISTORY_HEADER))
}

View File

@ -29,7 +29,7 @@ import im.vector.app.core.resources.StringProvider
import im.vector.app.core.ui.list.ItemStyle
import im.vector.app.core.ui.list.genericFooterItem
import im.vector.app.core.ui.list.genericItem
import im.vector.app.core.ui.list.genericItemWithValue
import im.vector.app.core.ui.list.genericWithValueItem
import im.vector.app.core.utils.DimensionConverter
import im.vector.app.features.settings.VectorPreferences
import me.gujun.android.span.span
@ -101,7 +101,7 @@ class DeviceListEpoxyController @Inject constructor(private val stringProvider:
} else {
// Build list of device with status
deviceList.forEach { device ->
genericItemWithValue {
genericWithValueItem {
id(device.deviceId)
titleIconResourceId(if (device.isVerified) R.drawable.ic_shield_trusted else R.drawable.ic_shield_warning)
apply {
@ -152,7 +152,7 @@ class DeviceListEpoxyController @Inject constructor(private val stringProvider:
private fun addDebugInfo(data: DeviceListViewState) {
val host = this
data.memberCrossSigningKey?.masterKey()?.let {
genericItemWithValue {
genericWithValueItem {
id("msk")
titleIconResourceId(R.drawable.key_small)
title(
@ -168,7 +168,7 @@ class DeviceListEpoxyController @Inject constructor(private val stringProvider:
}
}
data.memberCrossSigningKey?.userKey()?.let {
genericItemWithValue {
genericWithValueItem {
id("usk")
titleIconResourceId(R.drawable.key_small)
title(
@ -184,7 +184,7 @@ class DeviceListEpoxyController @Inject constructor(private val stringProvider:
}
}
data.memberCrossSigningKey?.selfSigningKey()?.let {
genericItemWithValue {
genericWithValueItem {
id("ssk")
titleIconResourceId(R.drawable.key_small)
title(

View File

@ -23,7 +23,7 @@ import im.vector.app.core.resources.StringProvider
import im.vector.app.core.ui.list.ItemStyle
import im.vector.app.core.ui.list.genericFooterItem
import im.vector.app.core.ui.list.genericItem
import im.vector.app.core.ui.list.genericItemWithValue
import im.vector.app.core.ui.list.genericWithValueItem
import im.vector.app.core.utils.DimensionConverter
import im.vector.app.features.crypto.verification.epoxy.bottomSheetVerificationActionItem
import im.vector.app.features.settings.VectorPreferences
@ -77,7 +77,7 @@ class DeviceTrustInfoEpoxyController @Inject constructor(private val stringProvi
// text(stringProvider.getString(R.string.verification_profile_device_untrust_info))
}
genericItemWithValue {
genericWithValueItem {
id(cryptoDeviceInfo.deviceId)
titleIconResourceId(if (isVerified) R.drawable.ic_shield_trusted else R.drawable.ic_shield_warning)
title(

View File

@ -21,8 +21,8 @@ import im.vector.app.core.resources.ColorProvider
import im.vector.app.core.resources.StringProvider
import im.vector.app.core.ui.list.genericButtonItem
import im.vector.app.core.ui.list.genericItem
import im.vector.app.core.ui.list.genericItemWithValue
import im.vector.app.core.ui.list.genericPositiveButtonItem
import im.vector.app.core.ui.list.genericWithValueItem
import im.vector.app.core.utils.DimensionConverter
import me.gujun.android.span.span
import javax.inject.Inject
@ -104,7 +104,7 @@ class CrossSigningSettingsController @Inject constructor(
val crossSigningKeys = data.crossSigningInfo
crossSigningKeys?.masterKey()?.let {
genericItemWithValue {
genericWithValueItem {
id("msk")
titleIconResourceId(R.drawable.key_small)
title(
@ -120,7 +120,7 @@ class CrossSigningSettingsController @Inject constructor(
}
}
crossSigningKeys?.userKey()?.let {
genericItemWithValue {
genericWithValueItem {
id("usk")
titleIconResourceId(R.drawable.key_small)
title(
@ -136,7 +136,7 @@ class CrossSigningSettingsController @Inject constructor(
}
}
crossSigningKeys?.selfSigningKey()?.let {
genericItemWithValue {
genericWithValueItem {
id("ssk")
titleIconResourceId(R.drawable.key_small)
title(

View File

@ -29,7 +29,7 @@ import im.vector.app.core.epoxy.loadingItem
import im.vector.app.core.error.ErrorFormatter
import im.vector.app.core.resources.ColorProvider
import im.vector.app.core.resources.StringProvider
import im.vector.app.core.ui.list.genericItemHeader
import im.vector.app.core.ui.list.genericHeaderItem
import im.vector.app.core.utils.DimensionConverter
import im.vector.app.features.settings.VectorPreferences
import org.matrix.android.sdk.internal.crypto.crosssigning.DeviceTrustLevel
@ -90,7 +90,7 @@ class DevicesController @Inject constructor(private val errorFormatter: ErrorFor
}?.let { fullInfo ->
val deviceInfo = fullInfo.deviceInfo
// Current device
genericItemHeader {
genericHeaderItem {
id("current")
text(host.stringProvider.getString(R.string.devices_current_device))
}
@ -126,7 +126,7 @@ class DevicesController @Inject constructor(private val errorFormatter: ErrorFor
// Other devices
if (devices.size > 1) {
genericItemHeader {
genericHeaderItem {
id("others")
text(host.stringProvider.getString(R.string.devices_other_devices))
}

View File

@ -25,7 +25,7 @@ import im.vector.app.R
import im.vector.app.core.epoxy.loadingItem
import im.vector.app.core.resources.StringProvider
import im.vector.app.core.ui.list.genericFooterItem
import im.vector.app.core.ui.list.genericItemWithValue
import im.vector.app.core.ui.list.genericWithValueItem
import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent
import javax.inject.Inject
@ -65,7 +65,7 @@ class AccountDataEpoxyController @Inject constructor(
}
} else {
dataList.forEach { accountData ->
genericItemWithValue {
genericWithValueItem {
id(accountData.type)
title(accountData.type)
itemClickAction {

View File

@ -22,7 +22,6 @@ import im.vector.app.RoomGroupingMethod
import im.vector.app.core.resources.ColorProvider
import im.vector.app.core.resources.StringProvider
import im.vector.app.core.ui.list.genericFooterItem
import im.vector.app.core.ui.list.genericItemHeader
import im.vector.app.features.grouplist.groupSummaryItem
import im.vector.app.features.grouplist.homeSpaceSummaryItem
import im.vector.app.features.home.AvatarRenderer
@ -72,7 +71,7 @@ class SpaceSummaryController @Inject constructor(
text(" ")
}
genericItemHeader {
genericHeaderItem {
id("legacy_groups")
text(host.stringProvider.getString(R.string.groups_header))
textColor(host.colorProvider.getColorFromAttribute(R.attr.riotx_text_primary))

View File

@ -22,7 +22,7 @@ import com.airbnb.mvrx.Success
import im.vector.app.R
import im.vector.app.core.epoxy.loadingItem
import im.vector.app.core.resources.StringProvider
import im.vector.app.core.ui.list.genericItemHeader
import im.vector.app.core.ui.list.genericHeaderItem
import im.vector.app.core.utils.TextUtils
import im.vector.app.features.home.AvatarRenderer
import javax.inject.Inject
@ -48,7 +48,7 @@ class SpacePreviewController @Inject constructor(
val result = data?.childInfoList?.invoke() ?: return
if (result.isNotEmpty()) {
genericItemHeader {
genericHeaderItem {
id("header_rooms")
text(host.stringProvider.getString(R.string.rooms))
}