Merge pull request #3064 from element-hq/feature/bma/avatarClick
Improve click behavior on room timeline title
This commit is contained in:
commit
5de08795f4
4 changed files with 12 additions and 6 deletions
|
|
@ -33,6 +33,7 @@ import androidx.compose.foundation.layout.navigationBarsPadding
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.statusBars
|
import androidx.compose.foundation.layout.statusBars
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
|
@ -43,6 +44,7 @@ import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.rememberUpdatedState
|
import androidx.compose.runtime.rememberUpdatedState
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import androidx.compose.ui.graphics.RectangleShape
|
import androidx.compose.ui.graphics.RectangleShape
|
||||||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
||||||
|
|
@ -454,7 +456,10 @@ private fun MessagesViewTopBar(
|
||||||
BackButton(onClick = onBackClick)
|
BackButton(onClick = onBackClick)
|
||||||
},
|
},
|
||||||
title = {
|
title = {
|
||||||
val titleModifier = Modifier.clickable { onRoomDetailsClick() }
|
val roundedCornerShape = RoundedCornerShape(8.dp)
|
||||||
|
val titleModifier = Modifier
|
||||||
|
.clip(roundedCornerShape)
|
||||||
|
.clickable { onRoomDetailsClick() }
|
||||||
if (roomName != null && roomAvatar != null) {
|
if (roomName != null && roomAvatar != null) {
|
||||||
RoomAvatarAndNameRow(
|
RoomAvatarAndNameRow(
|
||||||
roomName = roomName,
|
roomName = roomName,
|
||||||
|
|
@ -514,8 +519,8 @@ private fun RoomAvatarAndNameRow(
|
||||||
avatarData = roomAvatar,
|
avatarData = roomAvatar,
|
||||||
heroes = heroes,
|
heroes = heroes,
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
|
||||||
Text(
|
Text(
|
||||||
|
modifier = Modifier.padding(horizontal = 8.dp),
|
||||||
text = roomName,
|
text = roomName,
|
||||||
style = ElementTheme.typography.fontBodyLgMedium,
|
style = ElementTheme.typography.fontBodyLgMedium,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ fun IconTitlePlaceholdersRowMolecule(
|
||||||
PlaceholderAtom(width = 20.dp, height = 7.dp)
|
PlaceholderAtom(width = 20.dp, height = 7.dp)
|
||||||
Spacer(modifier = Modifier.width(7.dp))
|
Spacer(modifier = Modifier.width(7.dp))
|
||||||
PlaceholderAtom(width = 45.dp, height = 7.dp)
|
PlaceholderAtom(width = 45.dp, height = 7.dp)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:2818a7c9b1b5a61bb58cda1baa4e20b19e8e0f5197ef1ebc66e900a8a43e2232
|
oid sha256:d6db28acda62e4343ba7b4f64f31070253fe968f6ed8464afb1bb54506353278
|
||||||
size 53098
|
size 53081
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:4f4831c00703971d968621e0649b45c2e9fa0881ce8b3f1d79e19e4a7f4ad66c
|
oid sha256:534490ea60a6078200761864dd112f54be124647f818ccec77fb986ea71582a8
|
||||||
size 52642
|
size 52689
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue