Skip to content

Commit

Permalink
Post rebase fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr committed Jan 10, 2022
1 parent bc0f55a commit 2f51c91
Show file tree
Hide file tree
Showing 23 changed files with 51 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,7 +37,7 @@ class RoomDevToolSendFormController @Inject constructor(

genericFooterItem {
id("topSpace")
text("")
text("".toEpoxyCharSequence())
}
formEditTextItem {
id("event_type")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
Expand All @@ -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)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -158,7 +159,7 @@ class RoomProfileController @Inject constructor(
}
}
+e2eInfoText
}
}.toEpoxyCharSequence()
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -53,7 +54,7 @@ class RoomBannedMemberListController @Inject constructor(

genericFooterItem {
id("footer")
text(quantityString)
text(quantityString.toEpoxyCharSequence())
}
} else {
buildProfileSection(quantityString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -49,15 +50,15 @@ 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))
}

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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}

Expand All @@ -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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ class AccountDataEpoxyController @Inject constructor(
is Fail -> {
genericFooterItem {
id("fail")
text(data.accountData.error.localizedMessage)
text(data.accountData.error.localizedMessage.toEpoxyCharSequence())
}
}
is Success -> {
val dataList = data.accountData.invoke()
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 ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -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())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -66,7 +67,7 @@ class SpaceSummaryController @Inject constructor(
if (!nonNullViewState.legacyGroups.isNullOrEmpty()) {
genericFooterItem {
id("legacy_space")
text(" ")
text(" ".toEpoxyCharSequence())
}

genericHeaderItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down
Loading

0 comments on commit 2f51c91

Please sign in to comment.