Try some stuff on room list and avatar...
This commit is contained in:
parent
fcf7e8d7f1
commit
14992cb63a
17 changed files with 230 additions and 12 deletions
|
|
@ -1,22 +1,30 @@
|
|||
package io.element.android.x.features.roomlist
|
||||
|
||||
import android.widget.Space
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.ExitToApp
|
||||
import androidx.compose.material.ripple.rememberRipple
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.airbnb.mvrx.Success
|
||||
import com.airbnb.mvrx.compose.collectAsState
|
||||
import com.airbnb.mvrx.compose.mavericksViewModel
|
||||
import io.element.android.x.core.data.LogCompositions
|
||||
import io.element.android.x.designsystem.LightGrey
|
||||
import io.element.android.x.designsystem.components.Avatar
|
||||
import io.element.android.x.features.roomlist.model.MatrixUser
|
||||
import io.element.android.x.matrix.core.RoomId
|
||||
|
|
@ -107,17 +115,59 @@ private fun RoomItem(
|
|||
return
|
||||
}
|
||||
val details = room.details
|
||||
Row(verticalAlignment = Alignment.CenterVertically,
|
||||
Column(
|
||||
modifier = modifier
|
||||
.clickable {
|
||||
onClick(room.details.roomId)
|
||||
}
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 8.dp)
|
||||
.clickable(
|
||||
onClick = { onClick(room.details.roomId) },
|
||||
indication = rememberRipple(),
|
||||
interactionSource = remember { MutableInteractionSource() }
|
||||
),
|
||||
) {
|
||||
Column(modifier = modifier.padding(8.dp)) {
|
||||
Text(fontSize = 18.sp, text = details.name.orEmpty())
|
||||
Text(text = details.lastMessage?.toString().orEmpty(), maxLines = 2)
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
) {
|
||||
Box(modifier = Modifier
|
||||
.align(Alignment.CenterVertically)
|
||||
) {
|
||||
Avatar(data = null)
|
||||
}
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.padding(12.dp)
|
||||
.weight(1f)
|
||||
) {
|
||||
Text(
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color.Black,
|
||||
text = details.name,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
Text(
|
||||
text = details.lastMessage?.toString().orEmpty(),
|
||||
color = LightGrey,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
Column(
|
||||
Modifier
|
||||
.padding(horizontal = 8.dp)
|
||||
.align(Alignment.CenterVertically)
|
||||
) {
|
||||
Text(
|
||||
fontSize = 12.sp,
|
||||
text = "14:18",
|
||||
color = LightGrey
|
||||
)
|
||||
Spacer(Modifier.size(20.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue