ui: fix link icons, use backward compatible Java api (#6839)

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
Evgeny
2026-04-19 14:13:13 +01:00
committed by GitHub
co-authored by Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
parent a2fa2be87e
commit a7c6f0af95
6 changed files with 8 additions and 8 deletions
@@ -47,7 +47,7 @@ struct AddChannelView: View {
Group {
ZStack(alignment: .center) {
ZStack(alignment: .topTrailing) {
ProfileImage(imageStr: profile.image, size: 128)
ProfileImage(imageStr: profile.image, iconName: "antenna.radiowaves.left.and.right.circle.fill", size: 128)
if profile.image != nil {
Button {
profile.image = nil
@@ -256,7 +256,7 @@ struct AddChannelView: View {
let total = groupRelays.count
return List {
Group {
ProfileImage(imageStr: gInfo.groupProfile.image, size: 128)
ProfileImage(imageStr: gInfo.groupProfile.image, iconName: "antenna.radiowaves.left.and.right.circle.fill", size: 128)
.frame(maxWidth: .infinity, alignment: .center)
Text(gInfo.groupProfile.displayName)
@@ -68,7 +68,7 @@ struct AddGroupView: View {
Group {
ZStack(alignment: .center) {
ZStack(alignment: .topTrailing) {
ProfileImage(imageStr: profile.image, size: 128)
ProfileImage(imageStr: profile.image, iconName: "person.2.circle.fill", size: 128)
if profile.image != nil {
Button {
profile.image = nil
@@ -544,7 +544,7 @@ fun stripTextLink(text: String, link: String): String =
fun stripFormattedTextLink(ft: List<FormattedText>?, link: String): List<FormattedText>? {
if (ft == null || ft.isEmpty() || ft.last().text != link) return ft
val result = ft.toMutableList()
result.removeLast()
result.removeAt(result.lastIndex)
val i = result.lastIndex
if (i >= 0 && result[i].format == null && result[i].text.endsWith("\n")) {
result[i] = FormattedText(result[i].text.dropLast(1), null)
@@ -196,7 +196,7 @@ private fun ShareList(
val oneHandUI = remember { appPrefs.oneHandUI.state }
val chats by remember(search) {
derivedStateOf {
val sorted = chatModel.chats.value.toList().filter { it.chatInfo.ready }.sortedByDescending { it.chatInfo is ChatInfo.Local }
val sorted = chatModel.chats.value.toList().filter { it.chatInfo.ready && it.chatInfo.sendMsgEnabled }.sortedByDescending { it.chatInfo is ChatInfo.Local }
filteredChats(mutableStateOf(false), mutableStateOf(null), search, sorted)
}
}
@@ -249,7 +249,7 @@ private fun ProfileStepView(
) {
Box(contentAlignment = Alignment.TopEnd) {
Box(contentAlignment = Alignment.Center) {
ProfileImage(108.dp, image = profileImage.value)
ProfileImage(108.dp, image = profileImage.value, icon = MR.images.ic_bigtop_updates_circle_filled)
EditImageButton { scope.launch { bottomSheetModalState.show() } }
}
if (profileImage.value != null) {
@@ -376,7 +376,7 @@ private fun ProgressStepView(
Modifier.fillMaxWidth().padding(bottom = 8.dp),
contentAlignment = Alignment.Center
) {
ProfileImage(108.dp, image = gInfo.groupProfile.image)
ProfileImage(108.dp, image = gInfo.groupProfile.image, icon = MR.images.ic_bigtop_updates_circle_filled)
}
Text(
gInfo.groupProfile.displayName,
@@ -108,7 +108,7 @@ fun AddGroupLayout(
) {
Box(contentAlignment = Alignment.TopEnd) {
Box(contentAlignment = Alignment.Center) {
ProfileImage(108.dp, image = profileImage.value)
ProfileImage(108.dp, image = profileImage.value, icon = MR.images.ic_supervised_user_circle_filled)
EditImageButton { scope.launch { bottomSheetModalState.show() } }
}
if (profileImage.value != null) {