mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
Fix UI error
This commit is contained in:
parent
3c069f8b79
commit
893ebd9690
1 changed files with 24 additions and 19 deletions
|
@ -60,6 +60,13 @@ class RoomAliasController @Inject constructor(
|
|||
override fun buildModels(data: RoomAliasViewState?) {
|
||||
data ?: return
|
||||
|
||||
// Published
|
||||
buildPublishInfo(data)
|
||||
// Local
|
||||
buildLocalInfo(data)
|
||||
}
|
||||
|
||||
private fun buildPublishInfo(data: RoomAliasViewState) {
|
||||
buildProfileSection(
|
||||
stringProvider.getString(R.string.room_alias_published_alias_title)
|
||||
)
|
||||
|
@ -68,11 +75,8 @@ class RoomAliasController @Inject constructor(
|
|||
helperTextResId(R.string.room_alias_published_alias_subtitle)
|
||||
}
|
||||
|
||||
// TODO Canonical
|
||||
settingsInfoItem {
|
||||
id("otherPublished")
|
||||
helperTextResId(R.string.room_alias_published_other)
|
||||
}
|
||||
// TODO Set/Unset Canonical
|
||||
|
||||
if (data.alternativeAliases.isEmpty()) {
|
||||
settingsInfoItem {
|
||||
id("otherPublishedEmpty")
|
||||
|
@ -82,6 +86,21 @@ class RoomAliasController @Inject constructor(
|
|||
helperTextResId(R.string.room_alias_address_empty)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
settingsInfoItem {
|
||||
id("otherPublished")
|
||||
helperTextResId(R.string.room_alias_published_other)
|
||||
}
|
||||
data.alternativeAliases.forEachIndexed { idx, altAlias ->
|
||||
// TODO Rename this item to a more generic name
|
||||
threePidItem {
|
||||
id("alt_$idx")
|
||||
title(altAlias)
|
||||
if (data.actionPermissions.canChangeCanonicalAlias) {
|
||||
deleteClickListener { callback?.removeAlias(altAlias) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data.actionPermissions.canChangeCanonicalAlias) {
|
||||
|
@ -100,20 +119,6 @@ class RoomAliasController @Inject constructor(
|
|||
buttonClickListener { callback?.addAlias() }
|
||||
}
|
||||
}
|
||||
|
||||
data.alternativeAliases.forEachIndexed { idx, altAlias ->
|
||||
// TODO Rename this item to a more generic name
|
||||
threePidItem {
|
||||
id("alt_$idx")
|
||||
title(altAlias)
|
||||
if (data.actionPermissions.canChangeCanonicalAlias) {
|
||||
deleteClickListener { callback?.removeAlias(altAlias) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Local
|
||||
buildLocalInfo(data)
|
||||
}
|
||||
|
||||
private fun buildLocalInfo(data: RoomAliasViewState) {
|
||||
|
|
Loading…
Reference in a new issue