mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
Render room version in room detail screen if developer mode is enabled.
This commit is contained in:
committed by
Benoit Marty
parent
f8cd83db24
commit
fbddfbdb0e
+1
@@ -205,6 +205,7 @@ class RoomDetailsPresenter(
|
|||||||
canReportRoom = canReportRoom,
|
canReportRoom = canReportRoom,
|
||||||
isTombstoned = roomInfo.successorRoom != null,
|
isTombstoned = roomInfo.successorRoom != null,
|
||||||
showDebugInfo = isDeveloperModeEnabled,
|
showDebugInfo = isDeveloperModeEnabled,
|
||||||
|
roomVersion = roomInfo.roomVersion,
|
||||||
eventSink = ::handleEvent,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -49,6 +49,7 @@ data class RoomDetailsState(
|
|||||||
val canReportRoom: Boolean,
|
val canReportRoom: Boolean,
|
||||||
val isTombstoned: Boolean,
|
val isTombstoned: Boolean,
|
||||||
val showDebugInfo: Boolean,
|
val showDebugInfo: Boolean,
|
||||||
|
val roomVersion: String?,
|
||||||
val eventSink: (RoomDetailsEvent) -> Unit
|
val eventSink: (RoomDetailsEvent) -> Unit
|
||||||
) {
|
) {
|
||||||
val roomBadges = buildList {
|
val roomBadges = buildList {
|
||||||
|
|||||||
+1
@@ -146,6 +146,7 @@ fun aRoomDetailsState(
|
|||||||
canReportRoom = canReportRoom,
|
canReportRoom = canReportRoom,
|
||||||
isTombstoned = isTombstoned,
|
isTombstoned = isTombstoned,
|
||||||
showDebugInfo = showDebugInfo,
|
showDebugInfo = showDebugInfo,
|
||||||
|
roomVersion = "12",
|
||||||
eventSink = eventSink,
|
eventSink = eventSink,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+18
-1
@@ -264,6 +264,7 @@ fun RoomDetailsView(
|
|||||||
if (state.showDebugInfo) {
|
if (state.showDebugInfo) {
|
||||||
DebugInfoSection(
|
DebugInfoSection(
|
||||||
roomId = state.roomId,
|
roomId = state.roomId,
|
||||||
|
roomVersion = state.roomVersion,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -714,7 +715,10 @@ private fun OtherActionsSection(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun DebugInfoSection(roomId: RoomId) {
|
private fun DebugInfoSection(
|
||||||
|
roomId: RoomId,
|
||||||
|
roomVersion: String?,
|
||||||
|
) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
PreferenceCategory(showTopDivider = true) {
|
PreferenceCategory(showTopDivider = true) {
|
||||||
ListItem(
|
ListItem(
|
||||||
@@ -737,6 +741,19 @@ private fun DebugInfoSection(roomId: RoomId) {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
ListItem(
|
||||||
|
headlineContent = {
|
||||||
|
Text("Room version")
|
||||||
|
},
|
||||||
|
supportingContent = {
|
||||||
|
Text(
|
||||||
|
text = roomVersion ?: "Unknown",
|
||||||
|
style = ElementTheme.typography.fontBodySmRegular,
|
||||||
|
color = ElementTheme.colors.textSecondary,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Info())),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user