mirror of
https://github.com/fromchat-messenger/app.git
synced 2026-09-22 19:15:05 +03:00
Add contacts screen placeholder
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
<string name="profile">Профиль</string>
|
||||
<string name="dms">Личные чаты</string>
|
||||
<string name="coming_soon">Скоро…</string>
|
||||
<string name="contacts_empty_title">Скоро</string>
|
||||
<string name="contacts_empty_body">Список контактов появится здесь, когда функция будет готова.</string>
|
||||
<string name="public_chat">Общий чат</string>
|
||||
<string name="chat_last_mesaage">Вы: последнее сообщение</string>
|
||||
<string name="message_placeholder">Напишите сообщение…</string>
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
<string name="profile">Profile</string>
|
||||
<string name="dms">Private chats</string>
|
||||
<string name="coming_soon">Coming soon…</string>
|
||||
<string name="contacts_empty_title">Coming soon</string>
|
||||
<string name="contacts_empty_body">Your contacts will appear here when this feature is ready.</string>
|
||||
<string name="public_chat">Main chat</string>
|
||||
<string name="chat_last_mesaage">You: last message</string>
|
||||
<string name="message_placeholder">Write a message…</string>
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
package ru.fromchat.ui.main
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Contacts
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.jetbrains.compose.resources.stringResource
|
||||
import ru.fromchat.Res
|
||||
import ru.fromchat.*
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun ContactsTab() {
|
||||
Scaffold(
|
||||
topBar = {
|
||||
TopAppBar(
|
||||
title = {
|
||||
Text(
|
||||
text = stringResource(Res.string.contacts),
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
) { innerPadding ->
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(innerPadding),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 40.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
val tonal = ButtonDefaults.filledTonalButtonColors()
|
||||
val pillWidth = 148.dp
|
||||
val pillHeight = 66.dp
|
||||
val pillShape = RoundedCornerShape(pillHeight / 2)
|
||||
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier.width(pillWidth)
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.width(pillWidth),
|
||||
verticalArrangement = Arrangement.spacedBy(0.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Surface(
|
||||
modifier = Modifier
|
||||
.width(pillWidth)
|
||||
.height(pillHeight),
|
||||
shape = pillShape,
|
||||
color = tonal.containerColor
|
||||
) {
|
||||
Box(Modifier.fillMaxSize())
|
||||
}
|
||||
Surface(
|
||||
modifier = Modifier
|
||||
.width(pillWidth)
|
||||
.height(pillHeight),
|
||||
shape = pillShape,
|
||||
color = tonal.containerColor
|
||||
) {
|
||||
Box(Modifier.fillMaxSize())
|
||||
}
|
||||
}
|
||||
Icon(
|
||||
imageVector = Icons.Filled.Contacts,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(88.dp),
|
||||
tint = tonal.contentColor
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(28.dp))
|
||||
|
||||
Text(
|
||||
text = stringResource(Res.string.contacts_empty_title),
|
||||
style = MaterialTheme.typography.headlineSmall,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
|
||||
Text(
|
||||
text = stringResource(Res.string.contacts_empty_body),
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ fun MainScreen(onLogout: () -> Unit = {}) {
|
||||
) { page ->
|
||||
when (page) {
|
||||
PAGE_CHATS -> ChatsTab()
|
||||
PAGE_CONTACTS -> Text(stringResource(Res.string.coming_soon))
|
||||
PAGE_CONTACTS -> ContactsTab()
|
||||
PAGE_SETTINGS -> SettingsTab(onLogout = onLogout)
|
||||
PAGE_PROFILE -> {
|
||||
val currentUserId = ApiClient.user?.id
|
||||
|
||||
Reference in New Issue
Block a user