mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 13:38:49 +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?) {
|
override fun buildModels(data: RoomAliasViewState?) {
|
||||||
data ?: return
|
data ?: return
|
||||||
|
|
||||||
|
// Published
|
||||||
|
buildPublishInfo(data)
|
||||||
|
// Local
|
||||||
|
buildLocalInfo(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun buildPublishInfo(data: RoomAliasViewState) {
|
||||||
buildProfileSection(
|
buildProfileSection(
|
||||||
stringProvider.getString(R.string.room_alias_published_alias_title)
|
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)
|
helperTextResId(R.string.room_alias_published_alias_subtitle)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Canonical
|
// TODO Set/Unset Canonical
|
||||||
settingsInfoItem {
|
|
||||||
id("otherPublished")
|
|
||||||
helperTextResId(R.string.room_alias_published_other)
|
|
||||||
}
|
|
||||||
if (data.alternativeAliases.isEmpty()) {
|
if (data.alternativeAliases.isEmpty()) {
|
||||||
settingsInfoItem {
|
settingsInfoItem {
|
||||||
id("otherPublishedEmpty")
|
id("otherPublishedEmpty")
|
||||||
|
@ -82,6 +86,21 @@ class RoomAliasController @Inject constructor(
|
||||||
helperTextResId(R.string.room_alias_address_empty)
|
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) {
|
if (data.actionPermissions.canChangeCanonicalAlias) {
|
||||||
|
@ -100,20 +119,6 @@ class RoomAliasController @Inject constructor(
|
||||||
buttonClickListener { callback?.addAlias() }
|
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) {
|
private fun buildLocalInfo(data: RoomAliasViewState) {
|
||||||
|
|
Loading…
Reference in a new issue