bottombar: навигационная панель по дизайну «Новое меню»
Панель стала единой навигационной: слева назад (в Конференциях — чаты), далее ярлыки-разделы Почта · Карточки · Конференции (активный подсвечен), справа выдвижное меню. Профиль/Уведомления/Настройки/Создать убраны из панели (Профиль/Уведомления/Настройки — в выдвижном меню; бейдж уведомлений перенесён на кнопку меню). Создание раньше вызывалось ТОЛЬКО из панели → чтобы не потерять: - новый общий компонент F7CreateButton (зелёный круг «+»); - добавлен в шапку Файлов (→ меню создания) и Контактов (→ добавить контакт). Задачи/Поддержка уже имели свои кнопки; Почта — «+» в шапке. F7BottomBarConfig упрощён (единый layout), F7MobileBottomBar получил слоты SectionMail/SectionCards/SectionConferences + activeTabKey.
This commit is contained in:
+14
-63
@@ -3,10 +3,9 @@ package ru.forbion.f7cloud.core.designsystem
|
||||
enum class F7BottomBarSlot {
|
||||
Chats,
|
||||
NavBack,
|
||||
Create,
|
||||
Profile,
|
||||
Notifications,
|
||||
Settings,
|
||||
SectionMail,
|
||||
SectionCards,
|
||||
SectionConferences,
|
||||
Menu,
|
||||
}
|
||||
|
||||
@@ -16,69 +15,21 @@ data class F7BottomBarConfig(
|
||||
val buttonCount: Int get() = slots.size
|
||||
|
||||
companion object {
|
||||
// Единая навигационная панель по дизайну «Новое меню»:
|
||||
// слева «назад» (в Конференциях — «чаты»), затем ярлыки-разделы
|
||||
// Почта · Карточки · Конференции, справа — выдвижное меню.
|
||||
// Профиль/Уведомления/Настройки/Создать вынесены (меню и шапки экранов).
|
||||
fun forContext(
|
||||
tabKey: String,
|
||||
talkInRoom: Boolean,
|
||||
): F7BottomBarConfig = when (tabKey) {
|
||||
"Talk" -> if (talkInRoom) {
|
||||
F7BottomBarConfig(listOf(F7BottomBarSlot.Profile, F7BottomBarSlot.Notifications, F7BottomBarSlot.Menu))
|
||||
} else {
|
||||
F7BottomBarConfig(
|
||||
listOf(
|
||||
F7BottomBarSlot.Chats,
|
||||
F7BottomBarSlot.Profile,
|
||||
F7BottomBarSlot.Notifications,
|
||||
F7BottomBarSlot.Menu,
|
||||
),
|
||||
)
|
||||
}
|
||||
"Files" -> F7BottomBarConfig(
|
||||
): F7BottomBarConfig {
|
||||
val left = if (tabKey == "Talk") F7BottomBarSlot.Chats else F7BottomBarSlot.NavBack
|
||||
return F7BottomBarConfig(
|
||||
listOf(
|
||||
F7BottomBarSlot.NavBack,
|
||||
F7BottomBarSlot.Profile,
|
||||
F7BottomBarSlot.Notifications,
|
||||
F7BottomBarSlot.Create,
|
||||
F7BottomBarSlot.Settings,
|
||||
F7BottomBarSlot.Menu,
|
||||
),
|
||||
)
|
||||
"Contacts" -> F7BottomBarConfig(
|
||||
listOf(
|
||||
F7BottomBarSlot.Create,
|
||||
F7BottomBarSlot.Profile,
|
||||
F7BottomBarSlot.Notifications,
|
||||
F7BottomBarSlot.Menu,
|
||||
),
|
||||
)
|
||||
"Tasks" -> F7BottomBarConfig(
|
||||
listOf(
|
||||
F7BottomBarSlot.Create,
|
||||
F7BottomBarSlot.Profile,
|
||||
F7BottomBarSlot.Notifications,
|
||||
F7BottomBarSlot.Menu,
|
||||
),
|
||||
)
|
||||
"Support" -> F7BottomBarConfig(
|
||||
listOf(
|
||||
F7BottomBarSlot.Create,
|
||||
F7BottomBarSlot.Profile,
|
||||
F7BottomBarSlot.Notifications,
|
||||
F7BottomBarSlot.Menu,
|
||||
),
|
||||
)
|
||||
"Mail", "Calendar" -> F7BottomBarConfig(
|
||||
listOf(
|
||||
F7BottomBarSlot.NavBack,
|
||||
F7BottomBarSlot.Profile,
|
||||
F7BottomBarSlot.Notifications,
|
||||
F7BottomBarSlot.Settings,
|
||||
F7BottomBarSlot.Menu,
|
||||
),
|
||||
)
|
||||
else -> F7BottomBarConfig(
|
||||
listOf(
|
||||
F7BottomBarSlot.Profile,
|
||||
F7BottomBarSlot.Notifications,
|
||||
left,
|
||||
F7BottomBarSlot.SectionMail,
|
||||
F7BottomBarSlot.SectionCards,
|
||||
F7BottomBarSlot.SectionConferences,
|
||||
F7BottomBarSlot.Menu,
|
||||
),
|
||||
)
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package ru.forbion.f7cloud.core.designsystem
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Brush
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
/**
|
||||
* Зелёная круглая кнопка «+» — единый элемент создания в шапках экранов
|
||||
* (Почта/Файлы/Контакты/…). Градиент Primary, как у других зелёных кнопок.
|
||||
*/
|
||||
@Composable
|
||||
fun F7CreateButton(
|
||||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
size: Dp = 44.dp,
|
||||
) {
|
||||
Box(
|
||||
modifier = modifier
|
||||
.size(size)
|
||||
.shadow(3.dp, CircleShape, spotColor = F7Colors.Primary.copy(alpha = 0.25f))
|
||||
.clip(CircleShape)
|
||||
.background(
|
||||
Brush.linearGradient(
|
||||
listOf(F7Colors.PrimaryGradientStart, F7Colors.PrimaryGradientEnd),
|
||||
),
|
||||
)
|
||||
.border(1.dp, F7Colors.Primary.copy(alpha = 0.22f), CircleShape)
|
||||
.clickable(onClick = onClick),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Text(
|
||||
text = "+",
|
||||
color = Color.White,
|
||||
fontSize = 26.sp,
|
||||
fontWeight = FontWeight.Light,
|
||||
)
|
||||
}
|
||||
}
|
||||
+20
-22
@@ -27,10 +27,9 @@ import coil.compose.AsyncImage
|
||||
data class F7BottomBarActions(
|
||||
val onChatsClick: () -> Unit = {},
|
||||
val onNavBackClick: () -> Unit = {},
|
||||
val onCreateClick: () -> Unit = {},
|
||||
val onProfileClick: () -> Unit = {},
|
||||
val onNotificationsClick: () -> Unit = {},
|
||||
val onSettingsClick: () -> Unit = {},
|
||||
val onMailClick: () -> Unit = {},
|
||||
val onCardsClick: () -> Unit = {},
|
||||
val onConferencesClick: () -> Unit = {},
|
||||
val onMenuClick: () -> Unit = {},
|
||||
)
|
||||
|
||||
@@ -53,6 +52,7 @@ fun F7MobileBottomBar(
|
||||
userId: String,
|
||||
config: F7BottomBarConfig,
|
||||
actions: F7BottomBarActions,
|
||||
activeTabKey: String = "",
|
||||
menuOpen: Boolean = false,
|
||||
chatsHighlighted: Boolean = false,
|
||||
navBackHighlighted: Boolean = false,
|
||||
@@ -97,26 +97,23 @@ fun F7MobileBottomBar(
|
||||
iconRotation = if (navBackHighlighted) 180f else 0f,
|
||||
onClick = actions.onNavBackClick,
|
||||
)
|
||||
F7BottomBarSlot.Create -> F7BottomBarIconSlot(
|
||||
iconUrl = "$base/themes/forbion/images/header/green-plus.svg",
|
||||
contentDescription = "Создать",
|
||||
onClick = actions.onCreateClick,
|
||||
F7BottomBarSlot.SectionMail -> F7BottomBarIconSlot(
|
||||
iconUrl = "$base/themes/forbion/images/header/mail-header-icon.svg",
|
||||
contentDescription = "Почта",
|
||||
highlighted = activeTabKey == "Mail",
|
||||
onClick = actions.onMailClick,
|
||||
)
|
||||
F7BottomBarSlot.Profile -> F7BottomBarIconSlot(
|
||||
iconUrl = "$base/themes/forbion/images/header/profile-menu-icon-big.svg",
|
||||
contentDescription = "Профиль",
|
||||
onClick = actions.onProfileClick,
|
||||
F7BottomBarSlot.SectionCards -> F7BottomBarIconSlot(
|
||||
iconUrl = "$base/themes/forbion/images/header/deck-header-icon.svg",
|
||||
contentDescription = "Карточки",
|
||||
highlighted = activeTabKey == "Deck",
|
||||
onClick = actions.onCardsClick,
|
||||
)
|
||||
F7BottomBarSlot.Notifications -> F7BottomBarIconSlot(
|
||||
iconUrl = "$base/themes/forbion/images/header/not-menu-icon-big.svg",
|
||||
contentDescription = "Уведомления",
|
||||
showBadge = showNotificationBadge,
|
||||
onClick = actions.onNotificationsClick,
|
||||
)
|
||||
F7BottomBarSlot.Settings -> F7BottomBarIconSlot(
|
||||
iconUrl = "$base/themes/forbion/images/header/setting-menu-icon.svg",
|
||||
contentDescription = "Настройки",
|
||||
onClick = actions.onSettingsClick,
|
||||
F7BottomBarSlot.SectionConferences -> F7BottomBarIconSlot(
|
||||
iconUrl = "$base/themes/forbion/images/header/spreed-header-icon.svg",
|
||||
contentDescription = "Конференции",
|
||||
highlighted = activeTabKey == "Talk",
|
||||
onClick = actions.onConferencesClick,
|
||||
)
|
||||
F7BottomBarSlot.Menu -> F7BottomBarIconSlot(
|
||||
iconUrl = if (menuOpen) {
|
||||
@@ -126,6 +123,7 @@ fun F7MobileBottomBar(
|
||||
},
|
||||
contentDescription = "Меню",
|
||||
highlighted = menuOpen,
|
||||
showBadge = showNotificationBadge,
|
||||
onClick = actions.onMenuClick,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user