Merge pull request #3064 from element-hq/feature/bma/avatarClick

Improve click behavior on room timeline title
This commit is contained in:
Benoit Marty 2024-07-04 16:08:40 +02:00 committed by GitHub
commit 489c1f4dfa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 6 deletions

View file

@ -33,6 +33,7 @@ import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.statusBars
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
@ -43,6 +44,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
@ -454,7 +456,10 @@ private fun MessagesViewTopBar(
BackButton(onClick = onBackClick)
},
title = {
val titleModifier = Modifier.clickable { onRoomDetailsClick() }
val roundedCornerShape = RoundedCornerShape(8.dp)
val titleModifier = Modifier
.clip(roundedCornerShape)
.clickable { onRoomDetailsClick() }
if (roomName != null && roomAvatar != null) {
RoomAvatarAndNameRow(
roomName = roomName,
@ -514,8 +519,8 @@ private fun RoomAvatarAndNameRow(
avatarData = roomAvatar,
heroes = heroes,
)
Spacer(modifier = Modifier.width(8.dp))
Text(
modifier = Modifier.padding(horizontal = 8.dp),
text = roomName,
style = ElementTheme.typography.fontBodyLgMedium,
maxLines = 1,

View file

@ -58,6 +58,7 @@ fun IconTitlePlaceholdersRowMolecule(
PlaceholderAtom(width = 20.dp, height = 7.dp)
Spacer(modifier = Modifier.width(7.dp))
PlaceholderAtom(width = 45.dp, height = 7.dp)
Spacer(modifier = Modifier.width(8.dp))
}
}

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2818a7c9b1b5a61bb58cda1baa4e20b19e8e0f5197ef1ebc66e900a8a43e2232
size 53098
oid sha256:d6db28acda62e4343ba7b4f64f31070253fe968f6ed8464afb1bb54506353278
size 53081

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4f4831c00703971d968621e0649b45c2e9fa0881ce8b3f1d79e19e4a7f4ad66c
size 52642
oid sha256:534490ea60a6078200761864dd112f54be124647f818ccec77fb986ea71582a8
size 52689