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