sprint-1 #1
@ -13,6 +13,9 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.example.libary.theme.WhiteColor
|
||||
|
||||
// Модальные окна
|
||||
// modifier - модификаторы
|
||||
// content - контент будет отображаться внутри модального окна
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun BottomSheet(
|
||||
|
@ -25,7 +25,6 @@ import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.libary.theme.AccentColor
|
||||
@ -62,6 +61,11 @@ enum class BigButtonState(
|
||||
)
|
||||
}
|
||||
|
||||
// большая кнопка
|
||||
// state - состояние кнопки
|
||||
// modifier - модификаторы
|
||||
// onClick - вызовиться при нажатии на кнопку
|
||||
// text - текст кнопки
|
||||
@Composable
|
||||
fun BigButton(
|
||||
state: BigButtonState,
|
||||
@ -118,6 +122,11 @@ enum class SmallButtonState(
|
||||
)
|
||||
}
|
||||
|
||||
// маленькая кнопка
|
||||
// state - состояние кнопки
|
||||
// modifier - модификаторы
|
||||
// onClick - вызовиться при нажатии на кнопку
|
||||
// text - текст кнопки
|
||||
@Composable
|
||||
fun SmallButton(
|
||||
state: SmallButtonState,
|
||||
@ -150,6 +159,11 @@ fun SmallButton(
|
||||
}
|
||||
}
|
||||
|
||||
// кнопка корзины
|
||||
// price - сумма которая лежит в корзине
|
||||
// modifier - модификаторы
|
||||
// onClick - вызовиться при нажатии на кнопку
|
||||
// text - текст кнопки
|
||||
@Composable
|
||||
fun CartButton(
|
||||
modifier: Modifier = Modifier,
|
||||
@ -210,6 +224,10 @@ enum class LoginState(
|
||||
Yandex(R.drawable.yandex, "Войти с Yandex")
|
||||
}
|
||||
|
||||
// кнопка авторизации
|
||||
// state - состояние кнопки
|
||||
// modifier - модификаторы
|
||||
// onClick - вызовиться при нажатии на кнопку
|
||||
@Composable
|
||||
fun LoginButton(
|
||||
modifier: Modifier = Modifier,
|
||||
@ -256,6 +274,11 @@ enum class ChipButtonState(
|
||||
Off(InputBGColor, Desc)
|
||||
}
|
||||
|
||||
// chip кнопка
|
||||
// state - состояние кнопки
|
||||
// modifier - модификаторы
|
||||
// onClick - вызовиться при нажатии на кнопку
|
||||
// text - текст кнопки
|
||||
@Composable
|
||||
fun ChipButton(
|
||||
modifier: Modifier = Modifier,
|
||||
|
@ -36,6 +36,9 @@ import com.example.libary.theme.DividerColor
|
||||
import com.example.libary.theme.InputBGColor
|
||||
import com.example.libary.theme.White1Color
|
||||
|
||||
// базовая карта
|
||||
// modifier - модификаторы
|
||||
// content - контент который будет внктри карточки
|
||||
@Composable
|
||||
fun BaseCard(
|
||||
modifier: Modifier = Modifier,
|
||||
@ -60,6 +63,13 @@ fun BaseCard(
|
||||
}
|
||||
}
|
||||
|
||||
// карточка продукции
|
||||
// modifier - модификаторы
|
||||
// name - название продукции
|
||||
// category - категория продукции
|
||||
// price - цена продукуии
|
||||
// isAdd - если равен true тогда отображаеться кнопка "Добавить" иначе "Убрать"
|
||||
// onClick - вызываеться при нажатии на кнопку Добавить" или "Убрать"
|
||||
@Composable
|
||||
fun PrimaryCard(
|
||||
modifier: Modifier = Modifier,
|
||||
@ -113,6 +123,14 @@ fun PrimaryCard(
|
||||
}
|
||||
}
|
||||
|
||||
// карточка продукции для корзины
|
||||
// modifier - модификаторы
|
||||
// name - название продукции
|
||||
// price - цена продукуии
|
||||
// count - количество продукции в корине
|
||||
// onClose - вызываеться при нажатии на крестик
|
||||
// onPlus - вызываеться при нажатии на плюс
|
||||
// onMinus - вызываеться при нажатии на минус
|
||||
@Composable
|
||||
fun CartCard(
|
||||
modifier: Modifier = Modifier,
|
||||
@ -212,6 +230,11 @@ fun CartCard(
|
||||
}
|
||||
}
|
||||
|
||||
// карточка проекта
|
||||
// modifier - модификаторы
|
||||
// name - название проекта
|
||||
// date - дата проекта
|
||||
// open - вызываеться при нажатии на кнопку "Открыть"
|
||||
@Composable
|
||||
fun ProjectCard(
|
||||
modifier: Modifier = Modifier,
|
||||
|
@ -34,6 +34,12 @@ enum class HeaderState {
|
||||
Small
|
||||
}
|
||||
|
||||
// Хэдер
|
||||
// modifier - модификаторы
|
||||
// state - состояние хзэдера
|
||||
// title - загаловок
|
||||
// onBack - вызываеться при нажатии на кнопку назад
|
||||
// onRm - вызываеться при нажатии на кнопку удалить
|
||||
@Composable
|
||||
fun Header(
|
||||
modifier: Modifier = Modifier,
|
||||
@ -110,7 +116,7 @@ fun Header(
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun HeaderBt(
|
||||
internal fun HeaderBt(
|
||||
icon: Int,
|
||||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier
|
||||
|
@ -30,6 +30,11 @@ import com.example.libary.theme.Error1Color
|
||||
import com.example.libary.theme.InputBGColor
|
||||
import com.example.libary.theme.InputStroke
|
||||
|
||||
/**
|
||||
* текстовое поле
|
||||
* modifier - модификаторы
|
||||
* value - значение
|
||||
* */
|
||||
@Composable
|
||||
fun Input(
|
||||
modifier: Modifier = Modifier,
|
||||
|
@ -2,13 +2,15 @@ package com.example.libary.theme
|
||||
|
||||
import androidx.compose.material3.Typography
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.Font
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.libary.R
|
||||
|
||||
val Typography = Typography(
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp,
|
||||
|
Loading…
x
Reference in New Issue
Block a user