mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Post rebase fix
This commit is contained in:
parent
1a92d75a54
commit
aa7d284dd9
23 changed files with 51 additions and 35 deletions
|
@ -24,6 +24,7 @@ import im.vector.app.R
|
|||
import im.vector.app.core.epoxy.ClickListener
|
||||
import im.vector.app.core.epoxy.VectorEpoxyHolder
|
||||
import im.vector.app.core.epoxy.VectorEpoxyModel
|
||||
import im.vector.app.core.epoxy.charsequence.EpoxyCharSequence
|
||||
import im.vector.app.core.epoxy.onClick
|
||||
import im.vector.app.core.extensions.setTextOrHide
|
||||
import im.vector.app.features.themes.ThemeUtils
|
||||
|
@ -38,7 +39,7 @@ import im.vector.app.features.themes.ThemeUtils
|
|||
abstract class GenericFooterItem : VectorEpoxyModel<GenericFooterItem.Holder>() {
|
||||
|
||||
@EpoxyAttribute
|
||||
var text: String? = null
|
||||
var text: EpoxyCharSequence? = null
|
||||
|
||||
@EpoxyAttribute
|
||||
var style: ItemStyle = ItemStyle.NORMAL_TEXT
|
||||
|
@ -56,7 +57,7 @@ abstract class GenericFooterItem : VectorEpoxyModel<GenericFooterItem.Holder>()
|
|||
override fun bind(holder: Holder) {
|
||||
super.bind(holder)
|
||||
|
||||
holder.text.setTextOrHide(text)
|
||||
holder.text.setTextOrHide(text?.charSequence)
|
||||
holder.text.typeface = style.toTypeFace()
|
||||
holder.text.textSize = style.toTextSize()
|
||||
holder.text.gravity = if (centered) Gravity.CENTER_HORIZONTAL else Gravity.START
|
||||
|
|
|
@ -18,6 +18,7 @@ package im.vector.app.features.devtools
|
|||
|
||||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.ui.list.genericFooterItem
|
||||
import im.vector.app.features.form.formEditTextItem
|
||||
|
@ -36,7 +37,7 @@ class RoomDevToolSendFormController @Inject constructor(
|
|||
|
||||
genericFooterItem {
|
||||
id("topSpace")
|
||||
text("")
|
||||
text("".toEpoxyCharSequence())
|
||||
}
|
||||
formEditTextItem {
|
||||
id("event_type")
|
||||
|
|
|
@ -62,7 +62,7 @@ class ViewEditHistoryEpoxyController @Inject constructor(
|
|||
is Fail -> {
|
||||
genericFooterItem {
|
||||
id("failure")
|
||||
text(host.stringProvider.getString(R.string.unknown_error))
|
||||
text(host.stringProvider.getString(R.string.unknown_error).toEpoxyCharSequence())
|
||||
}
|
||||
}
|
||||
is Success -> {
|
||||
|
|
|
@ -49,7 +49,7 @@ class ViewReactionsEpoxyController @Inject constructor(
|
|||
is Fail -> {
|
||||
genericFooterItem {
|
||||
id("failure")
|
||||
text(host.stringProvider.getString(R.string.unknown_error))
|
||||
text(host.stringProvider.getString(R.string.unknown_error).toEpoxyCharSequence())
|
||||
}
|
||||
}
|
||||
is Success -> {
|
||||
|
|
|
@ -18,6 +18,7 @@ package im.vector.app.features.home.room.detail.widget
|
|||
|
||||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.resources.ColorProvider
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.ui.list.genericButtonItem
|
||||
|
@ -40,7 +41,7 @@ class RoomWidgetsController @Inject constructor(
|
|||
if (widgets.isEmpty()) {
|
||||
genericFooterItem {
|
||||
id("empty")
|
||||
text(host.stringProvider.getString(R.string.room_no_active_widgets))
|
||||
text(host.stringProvider.getString(R.string.room_no_active_widgets).toEpoxyCharSequence())
|
||||
}
|
||||
} else {
|
||||
widgets.forEach { widget ->
|
||||
|
|
|
@ -20,6 +20,7 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import im.vector.app.EmojiCompatFontProvider
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.ui.list.genericFooterItem
|
||||
import javax.inject.Inject
|
||||
|
@ -52,13 +53,13 @@ class EmojiSearchResultController @Inject constructor(
|
|||
// display 'Type something to find'
|
||||
genericFooterItem {
|
||||
id("type.query.item")
|
||||
text(host.stringProvider.getString(R.string.reaction_search_type_hint))
|
||||
text(host.stringProvider.getString(R.string.reaction_search_type_hint).toEpoxyCharSequence())
|
||||
}
|
||||
} else {
|
||||
// Display no search Results
|
||||
genericFooterItem {
|
||||
id("no.results.item")
|
||||
text(host.stringProvider.getString(R.string.no_result_placeholder))
|
||||
text(host.stringProvider.getString(R.string.no_result_placeholder).toEpoxyCharSequence())
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -19,6 +19,7 @@ package im.vector.app.features.roommemberprofile
|
|||
|
||||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.epoxy.profiles.buildProfileAction
|
||||
import im.vector.app.core.epoxy.profiles.buildProfileSection
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
|
@ -150,7 +151,7 @@ class RoomMemberProfileController @Inject constructor(
|
|||
|
||||
genericFooterItem {
|
||||
id("verify_footer")
|
||||
text(host.stringProvider.getString(R.string.room_profile_encrypted_subtitle))
|
||||
text(host.stringProvider.getString(R.string.room_profile_encrypted_subtitle).toEpoxyCharSequence())
|
||||
centered(false)
|
||||
}
|
||||
}
|
||||
|
@ -171,7 +172,7 @@ class RoomMemberProfileController @Inject constructor(
|
|||
|
||||
genericFooterItem {
|
||||
id("verify_footer_not_encrypted")
|
||||
text(host.stringProvider.getString(R.string.room_profile_not_encrypted_subtitle))
|
||||
text(host.stringProvider.getString(R.string.room_profile_not_encrypted_subtitle).toEpoxyCharSequence())
|
||||
centered(false)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class DeviceListEpoxyController @Inject constructor(private val stringProvider:
|
|||
// Can this really happen?
|
||||
genericFooterItem {
|
||||
id("empty")
|
||||
text(host.stringProvider.getString(R.string.search_no_results))
|
||||
text(host.stringProvider.getString(R.string.search_no_results).toEpoxyCharSequence())
|
||||
}
|
||||
} else {
|
||||
// Build list of device with status
|
||||
|
|
|
@ -67,12 +67,12 @@ class DeviceTrustInfoEpoxyController @Inject constructor(private val stringProvi
|
|||
// TODO FORMAT
|
||||
text(host.stringProvider.getString(R.string.verification_profile_device_verified_because,
|
||||
data.userItem?.displayName ?: "",
|
||||
data.userItem?.id ?: ""))
|
||||
data.userItem?.id ?: "").toEpoxyCharSequence())
|
||||
} else {
|
||||
// TODO what if mine
|
||||
text(host.stringProvider.getString(R.string.verification_profile_device_new_signing,
|
||||
data.userItem?.displayName ?: "",
|
||||
data.userItem?.id ?: ""))
|
||||
data.userItem?.id ?: "").toEpoxyCharSequence())
|
||||
}
|
||||
}
|
||||
// text(stringProvider.getString(R.string.verification_profile_device_untrust_info))
|
||||
|
@ -98,7 +98,7 @@ class DeviceTrustInfoEpoxyController @Inject constructor(private val stringProvi
|
|||
id("warn")
|
||||
centered(false)
|
||||
textColor(host.colorProvider.getColorFromAttribute(R.attr.vctr_content_primary))
|
||||
text(host.stringProvider.getString(R.string.verification_profile_device_untrust_info))
|
||||
text(host.stringProvider.getString(R.string.verification_profile_device_untrust_info).toEpoxyCharSequence())
|
||||
}
|
||||
|
||||
bottomSheetVerificationActionItem {
|
||||
|
|
|
@ -19,6 +19,7 @@ package im.vector.app.features.roomprofile
|
|||
|
||||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.epoxy.expandableTextItem
|
||||
import im.vector.app.core.epoxy.profiles.buildProfileAction
|
||||
import im.vector.app.core.epoxy.profiles.buildProfileSection
|
||||
|
@ -107,7 +108,7 @@ class RoomProfileController @Inject constructor(
|
|||
data.recommendedRoomVersion != null) {
|
||||
genericFooterItem {
|
||||
id("version_warning")
|
||||
text(host.stringProvider.getString(R.string.room_using_unstable_room_version, roomVersion))
|
||||
text(host.stringProvider.getString(R.string.room_using_unstable_room_version, roomVersion).toEpoxyCharSequence())
|
||||
textColor(host.colorProvider.getColorFromAttribute(R.attr.colorError))
|
||||
centered(false)
|
||||
}
|
||||
|
@ -158,7 +159,7 @@ class RoomProfileController @Inject constructor(
|
|||
}
|
||||
}
|
||||
+e2eInfoText
|
||||
}
|
||||
}.toEpoxyCharSequence()
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package im.vector.app.features.roomprofile.banned
|
|||
|
||||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.epoxy.dividerItem
|
||||
import im.vector.app.core.epoxy.profiles.buildProfileSection
|
||||
import im.vector.app.core.epoxy.profiles.profileMatrixItemWithProgress
|
||||
|
@ -53,7 +54,7 @@ class RoomBannedMemberListController @Inject constructor(
|
|||
|
||||
genericFooterItem {
|
||||
id("footer")
|
||||
text(quantityString)
|
||||
text(quantityString.toEpoxyCharSequence())
|
||||
}
|
||||
} else {
|
||||
buildProfileSection(quantityString)
|
||||
|
|
|
@ -18,6 +18,7 @@ package im.vector.app.features.roomprofile.settings.joinrule
|
|||
|
||||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.resources.ColorProvider
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.ui.list.ItemStyle
|
||||
|
@ -49,7 +50,7 @@ class RoomJoinRuleAdvancedController @Inject constructor(
|
|||
|
||||
genericFooterItem {
|
||||
id("header")
|
||||
text(host.stringProvider.getString(R.string.room_settings_room_access_title))
|
||||
text(host.stringProvider.getString(R.string.room_settings_room_access_title).toEpoxyCharSequence())
|
||||
centered(false)
|
||||
style(ItemStyle.TITLE)
|
||||
textColor(host.colorProvider.getColorFromAttribute(R.attr.vctr_content_primary))
|
||||
|
@ -57,7 +58,7 @@ class RoomJoinRuleAdvancedController @Inject constructor(
|
|||
|
||||
genericFooterItem {
|
||||
id("desc")
|
||||
text(host.stringProvider.getString(R.string.decide_who_can_find_and_join))
|
||||
text(host.stringProvider.getString(R.string.decide_who_can_find_and_join).toEpoxyCharSequence())
|
||||
centered(false)
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import com.airbnb.mvrx.Loading
|
|||
import com.airbnb.mvrx.Success
|
||||
import com.airbnb.mvrx.Uninitialized
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.epoxy.loadingItem
|
||||
import im.vector.app.core.epoxy.noResultItem
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
|
@ -76,7 +77,7 @@ class ChooseRestrictedController @Inject constructor(
|
|||
// when no filters
|
||||
genericFooterItem {
|
||||
id("h1")
|
||||
text(host.stringProvider.getString(R.string.space_you_know_that_contains_this_room))
|
||||
text(host.stringProvider.getString(R.string.space_you_know_that_contains_this_room).toEpoxyCharSequence())
|
||||
centered(false)
|
||||
}
|
||||
|
||||
|
@ -93,7 +94,7 @@ class ChooseRestrictedController @Inject constructor(
|
|||
if (data.unknownRestricted.isNotEmpty()) {
|
||||
genericFooterItem {
|
||||
id("others")
|
||||
text(host.stringProvider.getString(R.string.other_spaces_or_rooms_you_might_not_know))
|
||||
text(host.stringProvider.getString(R.string.other_spaces_or_rooms_you_might_not_know).toEpoxyCharSequence())
|
||||
centered(false)
|
||||
}
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ class DeviceVerificationInfoBottomSheetController @Inject constructor(
|
|||
|
||||
genericFooterItem {
|
||||
id("infoCrypto${info.deviceId}")
|
||||
text(host.stringProvider.getString(R.string.settings_failed_to_get_crypto_device_info))
|
||||
text(host.stringProvider.getString(R.string.settings_failed_to_get_crypto_device_info).toEpoxyCharSequence())
|
||||
}
|
||||
|
||||
info.deviceId?.let { addGenericDeviceManageActions(data, it) }
|
||||
|
|
|
@ -54,7 +54,7 @@ class AccountDataEpoxyController @Inject constructor(
|
|||
is Fail -> {
|
||||
genericFooterItem {
|
||||
id("fail")
|
||||
text(data.accountData.error.localizedMessage)
|
||||
text(data.accountData.error.localizedMessage.toEpoxyCharSequence())
|
||||
}
|
||||
}
|
||||
is Success -> {
|
||||
|
@ -62,7 +62,7 @@ class AccountDataEpoxyController @Inject constructor(
|
|||
if (dataList.isEmpty()) {
|
||||
genericFooterItem {
|
||||
id("noResults")
|
||||
text(host.stringProvider.getString(R.string.no_result_placeholder))
|
||||
text(host.stringProvider.getString(R.string.no_result_placeholder).toEpoxyCharSequence())
|
||||
}
|
||||
} else {
|
||||
dataList.forEach { accountData ->
|
||||
|
|
|
@ -18,6 +18,7 @@ package im.vector.app.features.settings.push
|
|||
|
||||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.ui.list.genericFooterItem
|
||||
import javax.inject.Inject
|
||||
|
@ -34,7 +35,7 @@ class PushGateWayController @Inject constructor(
|
|||
if (pushers.isEmpty()) {
|
||||
genericFooterItem {
|
||||
id("footer")
|
||||
text(host.stringProvider.getString(R.string.settings_push_gateway_no_pushers))
|
||||
text(host.stringProvider.getString(R.string.settings_push_gateway_no_pushers).toEpoxyCharSequence())
|
||||
}
|
||||
} else {
|
||||
pushers.forEach {
|
||||
|
@ -50,7 +51,7 @@ class PushGateWayController @Inject constructor(
|
|||
} ?: run {
|
||||
genericFooterItem {
|
||||
id("loading")
|
||||
text(host.stringProvider.getString(R.string.loading))
|
||||
text(host.stringProvider.getString(R.string.loading).toEpoxyCharSequence())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ package im.vector.app.features.settings.push
|
|||
|
||||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.ui.list.genericFooterItem
|
||||
import javax.inject.Inject
|
||||
|
@ -38,7 +39,7 @@ class PushRulesController @Inject constructor(
|
|||
} ?: run {
|
||||
genericFooterItem {
|
||||
id("footer")
|
||||
text(host.stringProvider.getString(R.string.settings_push_rules_no_rules))
|
||||
text(host.stringProvider.getString(R.string.settings_push_rules_no_rules).toEpoxyCharSequence())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import com.airbnb.mvrx.Fail
|
|||
import com.airbnb.mvrx.Loading
|
||||
import com.airbnb.mvrx.Success
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.epoxy.loadingItem
|
||||
import im.vector.app.core.epoxy.noResultItem
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
|
@ -86,7 +87,7 @@ class ThreePidsSettingsController @Inject constructor(
|
|||
is Fail -> {
|
||||
genericFooterItem {
|
||||
id("fail")
|
||||
text(data.threePids.error.localizedMessage)
|
||||
text(data.threePids.error.localizedMessage.toEpoxyCharSequence())
|
||||
}
|
||||
}
|
||||
is Success -> {
|
||||
|
|
|
@ -19,6 +19,7 @@ package im.vector.app.features.spaces
|
|||
import com.airbnb.epoxy.EpoxyController
|
||||
import im.vector.app.R
|
||||
import im.vector.app.RoomGroupingMethod
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.resources.ColorProvider
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.ui.list.genericFooterItem
|
||||
|
@ -66,7 +67,7 @@ class SpaceSummaryController @Inject constructor(
|
|||
if (!nonNullViewState.legacyGroups.isNullOrEmpty()) {
|
||||
genericFooterItem {
|
||||
id("legacy_space")
|
||||
text(" ")
|
||||
text(" ".toEpoxyCharSequence())
|
||||
}
|
||||
|
||||
genericHeaderItem {
|
||||
|
|
|
@ -43,12 +43,12 @@ class SpaceAdd3pidEpoxyController @Inject constructor(
|
|||
genericFooterItem {
|
||||
id("info_help_header")
|
||||
style(ItemStyle.TITLE)
|
||||
text(host.stringProvider.getString(R.string.create_spaces_invite_public_header))
|
||||
text(host.stringProvider.getString(R.string.create_spaces_invite_public_header).toEpoxyCharSequence())
|
||||
textColor(host.colorProvider.getColorFromAttribute(R.attr.vctr_content_primary))
|
||||
}
|
||||
genericFooterItem {
|
||||
id("info_help_desc")
|
||||
text(host.stringProvider.getString(R.string.create_spaces_invite_public_header_desc, data.name ?: ""))
|
||||
text(host.stringProvider.getString(R.string.create_spaces_invite_public_header_desc, data.name ?: "").toEpoxyCharSequence())
|
||||
textColor(host.colorProvider.getColorFromAttribute(R.attr.vctr_content_secondary))
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ package im.vector.app.features.spaces.create
|
|||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.resources.ColorProvider
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.ui.list.ItemStyle
|
||||
|
@ -45,7 +46,7 @@ class SpaceDefaultRoomEpoxyController @Inject constructor(
|
|||
host.stringProvider.getString(R.string.create_spaces_room_public_header, data.name)
|
||||
} else {
|
||||
host.stringProvider.getString(R.string.create_spaces_room_private_header)
|
||||
}
|
||||
}.toEpoxyCharSequence()
|
||||
)
|
||||
textColor(host.colorProvider.getColorFromAttribute(R.attr.vctr_content_primary))
|
||||
}
|
||||
|
@ -59,7 +60,7 @@ class SpaceDefaultRoomEpoxyController @Inject constructor(
|
|||
} else {
|
||||
R.string.create_spaces_room_private_header_desc
|
||||
}
|
||||
)
|
||||
).toEpoxyCharSequence()
|
||||
)
|
||||
textColor(host.colorProvider.getColorFromAttribute(R.attr.vctr_content_secondary))
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import com.airbnb.epoxy.TypedEpoxyController
|
|||
import com.airbnb.mvrx.Fail
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.TextListener
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.core.ui.list.genericFooterItem
|
||||
import im.vector.app.features.form.formEditTextItem
|
||||
|
@ -61,7 +62,7 @@ class SpaceDetailEpoxyController @Inject constructor(
|
|||
host.stringProvider.getString(R.string.create_spaces_details_public_header)
|
||||
} else {
|
||||
host.stringProvider.getString(R.string.create_spaces_details_private_header)
|
||||
}
|
||||
}.toEpoxyCharSequence()
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import com.airbnb.epoxy.VisibilityState
|
|||
import com.airbnb.mvrx.Fail
|
||||
import com.airbnb.mvrx.Incomplete
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.epoxy.charsequence.toEpoxyCharSequence
|
||||
import im.vector.app.core.epoxy.errorWithRetryItem
|
||||
import im.vector.app.core.epoxy.loadingItem
|
||||
import im.vector.app.core.error.ErrorFormatter
|
||||
|
@ -74,7 +75,7 @@ class SpaceManageRoomsController @Inject constructor(
|
|||
if (filteredResult.isEmpty()) {
|
||||
genericFooterItem {
|
||||
id("empty_result")
|
||||
text(host.stringProvider.getString(R.string.no_result_placeholder))
|
||||
text(host.stringProvider.getString(R.string.no_result_placeholder).toEpoxyCharSequence())
|
||||
}
|
||||
} else {
|
||||
filteredResult.forEach { childInfo ->
|
||||
|
|
Loading…
Reference in a new issue