sprint-1 #1
@ -41,6 +41,8 @@ android {
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation(files("libs/libary-release.aar"))
|
||||
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.lifecycle.runtime.ktx)
|
||||
implementation(libs.androidx.activity.compose)
|
||||
@ -56,6 +58,4 @@ dependencies {
|
||||
androidTestImplementation(libs.androidx.ui.test.junit4)
|
||||
debugImplementation(libs.androidx.ui.tooling)
|
||||
debugImplementation(libs.androidx.ui.test.manifest)
|
||||
|
||||
implementation(project(":libary"))
|
||||
}
|
BIN
app/libs/libary-release.aar
Normal file
BIN
app/libs/libary-release.aar
Normal file
Binary file not shown.
@ -4,12 +4,14 @@ import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.example.libary.theme.UikitTheme
|
||||
|
||||
@ -19,11 +21,15 @@ class MainActivity : ComponentActivity() {
|
||||
enableEdgeToEdge()
|
||||
setContent {
|
||||
UikitTheme {
|
||||
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
||||
Greeting(
|
||||
name = "Android",
|
||||
Scaffold(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
containerColor = Color.White
|
||||
) { innerPadding ->
|
||||
Column(
|
||||
modifier = Modifier.padding(innerPadding)
|
||||
)
|
||||
) {
|
||||
StoryBook()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
406
app/src/main/java/com/example/ui_kit/StoryBook.kt
Normal file
406
app/src/main/java/com/example/ui_kit/StoryBook.kt
Normal file
@ -0,0 +1,406 @@
|
||||
package com.example.ui_kit
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
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.lazy.LazyColumn
|
||||
import androidx.compose.foundation.shape.AbsoluteRoundedCornerShape
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.libary.BaseCard
|
||||
import com.example.libary.BigButton
|
||||
import com.example.libary.BigButtonState
|
||||
import com.example.libary.BottomSheet
|
||||
import com.example.libary.CartButton
|
||||
import com.example.libary.CartCard
|
||||
import com.example.libary.ChipButton
|
||||
import com.example.libary.ChipButtonState
|
||||
import com.example.libary.Header
|
||||
import com.example.libary.HeaderState
|
||||
import com.example.libary.Input
|
||||
import com.example.libary.LoginButton
|
||||
import com.example.libary.LoginState
|
||||
import com.example.libary.PrimaryCard
|
||||
import com.example.libary.ProjectCard
|
||||
import com.example.libary.SearchInput
|
||||
import com.example.libary.Select
|
||||
import com.example.libary.SmallButton
|
||||
import com.example.libary.SmallButtonState
|
||||
import com.example.libary.TabBar
|
||||
import com.example.libary.defaultTabBarData
|
||||
import com.example.libary.theme.BlackColor
|
||||
import com.example.libary.theme.IconsColor
|
||||
|
||||
@Composable
|
||||
fun StoryBook(
|
||||
|
||||
) {
|
||||
var modal by remember { mutableStateOf(false) }
|
||||
|
||||
var inVal by remember { mutableStateOf("") }
|
||||
var passinVal by remember { mutableStateOf("123456789") }
|
||||
|
||||
val searchInput = remember { mutableStateOf("") }
|
||||
val valSelect = remember { mutableStateOf("") }
|
||||
val valSelect1 = remember { mutableStateOf("Гарвард Троцкий") }
|
||||
|
||||
val valueTabBar1 = remember { mutableStateOf(defaultTabBarData[0]) }
|
||||
val valueTabBar2 = remember { mutableStateOf(defaultTabBarData[1]) }
|
||||
val valueTabBar3 = remember { mutableStateOf(defaultTabBarData[2]) }
|
||||
val valueTabBar4 = remember { mutableStateOf(defaultTabBarData[3]) }
|
||||
|
||||
if (modal) {
|
||||
BottomSheet {
|
||||
Row {
|
||||
Text(
|
||||
text = "Рубашка Воскресенье для машинного вязания",
|
||||
color = BlackColor,
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.W800,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier.size(24.dp)
|
||||
.background(IconsColor.copy(0.3f), AbsoluteRoundedCornerShape(90.dp))
|
||||
.clip(AbsoluteRoundedCornerShape(90.dp))
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(com.example.libary.R.drawable.delete),
|
||||
contentDescription = null
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(Modifier.height(84.dp))
|
||||
}
|
||||
}
|
||||
|
||||
LazyColumn(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
item {
|
||||
Spacer(Modifier.height(20.dp))
|
||||
|
||||
Header(
|
||||
state = HeaderState.Big,
|
||||
title = "Корзина"
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(39.dp))
|
||||
|
||||
Header(
|
||||
state = HeaderState.Small,
|
||||
title = "Корзина"
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(40.dp))
|
||||
|
||||
|
||||
BigButton(
|
||||
state = BigButtonState.Property,
|
||||
text = "Открытить модальное окно",
|
||||
onClick = {
|
||||
modal = !modal
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(40.dp))
|
||||
|
||||
BaseCard(
|
||||
modifier = Modifier.height(138.dp).width(335.dp)
|
||||
) {}
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
PrimaryCard(
|
||||
name = "Рубашка Воскресенье для машинного вязания",
|
||||
category = "Мужская одежда",
|
||||
price = "300",
|
||||
isAdd = true,
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp)
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
PrimaryCard(
|
||||
name = "Рубашка Воскресенье для машинного вязания",
|
||||
category = "Мужская одежда",
|
||||
price = "300",
|
||||
isAdd = false,
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp)
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
CartCard(
|
||||
name = "Рубашка воскресенье для машинного вязания",
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp),
|
||||
price = "300",
|
||||
count = "1"
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
ProjectCard(
|
||||
name = "Мой первый проект",
|
||||
date = "Прошло 2 дня",
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp)
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(40.dp))
|
||||
|
||||
Input(
|
||||
value = inVal,
|
||||
modifier = Modifier.fillMaxWidth().padding(start = 16.dp, end = 26.dp),
|
||||
placeholder = "Введите имя",
|
||||
onValueChange = {
|
||||
inVal = it
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
Input(
|
||||
value = "Иван",
|
||||
modifier = Modifier.fillMaxWidth().padding(start = 16.dp, end = 26.dp),
|
||||
placeholder = "Иван",
|
||||
onValueChange = {
|
||||
inVal = it
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
Input(
|
||||
value = inVal,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifierColumn = Modifier.fillMaxWidth().padding(start = 16.dp, end = 26.dp),
|
||||
topText = "Имя",
|
||||
placeholder = "Введите имя",
|
||||
onValueChange = {
|
||||
inVal = it
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
Input(
|
||||
value = inVal,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifierColumn = Modifier.fillMaxWidth().padding(start = 16.dp, end = 26.dp),
|
||||
placeholder = "Иван",
|
||||
errorText = "Введите ваше имя",
|
||||
onValueChange = {
|
||||
inVal = it
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
Input(
|
||||
value = inVal,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifierColumn = Modifier.fillMaxWidth().padding(start = 16.dp, end = 26.dp),
|
||||
topText = "Имя",
|
||||
placeholder = "Введите имя",
|
||||
onValueChange = {
|
||||
inVal = it
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
Input(
|
||||
value = "Введите имя",
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifierColumn = Modifier.fillMaxWidth().padding(start = 16.dp, end = 26.dp),
|
||||
topText = "Имя",
|
||||
placeholder = "Введите имя",
|
||||
onValueChange = {
|
||||
inVal = it
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
Input(
|
||||
value = passinVal,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifierColumn = Modifier.fillMaxWidth().padding(start = 16.dp, end = 26.dp),
|
||||
topText = "Имя",
|
||||
placeholder = "Введите имя",
|
||||
pasMode = true,
|
||||
onValueChange = {
|
||||
passinVal = it
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
Input(
|
||||
value = inVal,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifierColumn = Modifier.fillMaxWidth().padding(start = 16.dp, end = 26.dp),
|
||||
placeholder = "--.--.----",
|
||||
onValueChange = {
|
||||
inVal = it
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(40.dp))
|
||||
|
||||
Select(
|
||||
value = valSelect,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
.padding(start = 16.dp, end = 26.dp),
|
||||
placeholder = "Пол",
|
||||
data = listOf(
|
||||
"Мужской",
|
||||
"Женский"
|
||||
)
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(18.dp))
|
||||
|
||||
Select(
|
||||
value = valSelect1,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
.padding(start = 16.dp, end = 26.dp),
|
||||
leadingIcon = {
|
||||
Image(
|
||||
painter = painterResource(R.drawable.user_icon),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(24.dp)
|
||||
)
|
||||
},
|
||||
data = listOf(
|
||||
"Гарвард Троцкий",
|
||||
"Гарвард Троцкий"
|
||||
)
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(40.dp))
|
||||
|
||||
SearchInput(
|
||||
value = searchInput.value,
|
||||
onValueChange = {
|
||||
searchInput.value = it
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(40.dp))
|
||||
|
||||
BigButtonState.entries.forEach {
|
||||
BigButton(
|
||||
state = it,
|
||||
text = "Подтвердить",
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 16.dp)
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(Modifier.height(40.dp))
|
||||
|
||||
SmallButton(
|
||||
state = SmallButtonState.Property,
|
||||
text = "Добавить"
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(5.dp))
|
||||
|
||||
SmallButton(
|
||||
state = SmallButtonState.Secondary,
|
||||
text = "Убрать"
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(5.dp))
|
||||
|
||||
SmallButton(
|
||||
state = SmallButtonState.Inactive,
|
||||
text = "Добавить"
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(5.dp))
|
||||
|
||||
SmallButton(
|
||||
state = SmallButtonState.Tetriary,
|
||||
text = "Подтвердить"
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(40.dp))
|
||||
|
||||
ChipButton(
|
||||
state = ChipButtonState.On,
|
||||
text = "Популярные"
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(5.dp))
|
||||
|
||||
ChipButton(
|
||||
state = ChipButtonState.Off,
|
||||
text = "Популярные"
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(40.dp))
|
||||
|
||||
CartButton(
|
||||
price = "500"
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(40.dp))
|
||||
|
||||
LoginState.entries.forEach {
|
||||
LoginButton(
|
||||
state = it
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(5.dp))
|
||||
}
|
||||
|
||||
Spacer(Modifier.height(40.dp))
|
||||
|
||||
TabBar(
|
||||
value = valueTabBar1
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(15.dp))
|
||||
|
||||
TabBar(
|
||||
value = valueTabBar2
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(15.dp))
|
||||
|
||||
TabBar(
|
||||
value = valueTabBar3
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(15.dp))
|
||||
|
||||
TabBar(
|
||||
value = valueTabBar4
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
BIN
app/src/main/res/drawable/user_icon.png
Normal file
BIN
app/src/main/res/drawable/user_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,33 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.test.assertIsDisplayed
|
||||
import androidx.compose.ui.test.junit4.createComposeRule
|
||||
import androidx.compose.ui.test.onNodeWithTag
|
||||
import androidx.compose.ui.test.onNodeWithText
|
||||
import androidx.compose.ui.test.performClick
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class BottomSheetTest {
|
||||
|
||||
@get:Rule
|
||||
val composeRule = createComposeRule()
|
||||
|
||||
@Test
|
||||
fun test1() {
|
||||
composeRule.setContent {
|
||||
val ins = remember { mutableStateOf("") }
|
||||
Select(
|
||||
value = ins,
|
||||
data = listOf(
|
||||
"test1"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
composeRule.onNodeWithTag("dr_1").performClick()
|
||||
composeRule.onNodeWithText("test1").assertIsDisplayed()
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.test.junit4.createComposeRule
|
||||
import org.junit.Assert
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class ButtonChipTest {
|
||||
|
||||
@get:Rule
|
||||
val composeRule = createComposeRule()
|
||||
|
||||
@Test
|
||||
fun test() {
|
||||
Assert.assertEquals(ChipButtonState.On.textColor, Color(0xFFFFFFFF))
|
||||
Assert.assertEquals(ChipButtonState.On.containerColor, Color(0xFF1A6FEE))
|
||||
|
||||
Assert.assertEquals(ChipButtonState.Off.textColor, Color(0xFF7E7E9A))
|
||||
Assert.assertEquals(ChipButtonState.Off.containerColor, Color(0xFFF5F5F9))
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.ui.test.assertIsDisplayed
|
||||
import androidx.compose.ui.test.junit4.createComposeRule
|
||||
import androidx.compose.ui.test.onNodeWithText
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class CardPrimaryTest {
|
||||
|
||||
@get:Rule
|
||||
val composeRule = createComposeRule()
|
||||
|
||||
@Test
|
||||
fun test() {
|
||||
composeRule.setContent {
|
||||
PrimaryCard(
|
||||
name = "name",
|
||||
category = "category",
|
||||
price = "100",
|
||||
isAdd = false
|
||||
)
|
||||
}
|
||||
|
||||
composeRule.onNodeWithText("name").assertIsDisplayed()
|
||||
composeRule.onNodeWithText("category").assertIsDisplayed()
|
||||
composeRule.onNodeWithText("100 ₽").assertIsDisplayed()
|
||||
composeRule.onNodeWithText("Убрать").assertIsDisplayed()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun test1() {
|
||||
composeRule.setContent {
|
||||
PrimaryCard(
|
||||
name = "name",
|
||||
category = "category",
|
||||
price = "100",
|
||||
isAdd = true
|
||||
)
|
||||
}
|
||||
|
||||
composeRule.onNodeWithText("name").assertIsDisplayed()
|
||||
composeRule.onNodeWithText("category").assertIsDisplayed()
|
||||
composeRule.onNodeWithText("100 ₽").assertIsDisplayed()
|
||||
composeRule.onNodeWithText("Добавить").assertIsDisplayed()
|
||||
}
|
||||
}
|
26
libary/src/androidTest/java/com/example/libary/InputTest.kt
Normal file
26
libary/src/androidTest/java/com/example/libary/InputTest.kt
Normal file
@ -0,0 +1,26 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.ui.test.assertIsDisplayed
|
||||
import androidx.compose.ui.test.junit4.createComposeRule
|
||||
import androidx.compose.ui.test.onNodeWithText
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class InputTest {
|
||||
|
||||
@get:Rule
|
||||
val composeRule = createComposeRule()
|
||||
|
||||
@Test
|
||||
fun test1() {
|
||||
composeRule.setContent {
|
||||
Input(
|
||||
value = "",
|
||||
onValueChange = {},
|
||||
errorText = "error test"
|
||||
)
|
||||
}
|
||||
|
||||
composeRule.onNodeWithText("error test").assertIsDisplayed()
|
||||
}
|
||||
}
|
46
libary/src/androidTest/java/com/example/libary/TabbarTest.kt
Normal file
46
libary/src/androidTest/java/com/example/libary/TabbarTest.kt
Normal file
@ -0,0 +1,46 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.test.junit4.createComposeRule
|
||||
import androidx.compose.ui.test.onNodeWithTag
|
||||
import androidx.compose.ui.test.performClick
|
||||
import androidx.compose.ui.unit.dp
|
||||
import org.junit.Assert
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class TabbarTest {
|
||||
|
||||
@get:Rule
|
||||
val composeRule = createComposeRule()
|
||||
|
||||
@Test
|
||||
fun test() {
|
||||
|
||||
var valueName = ""
|
||||
|
||||
composeRule.setContent {
|
||||
val value = remember { mutableStateOf(defaultTabBarData[0]) }
|
||||
|
||||
LaunchedEffect(value.value) {
|
||||
valueName = value.value.name
|
||||
}
|
||||
|
||||
Column {
|
||||
Spacer(Modifier.height(100.dp))
|
||||
TabBar(
|
||||
value = value
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
composeRule.onNodeWithTag("Главная").performClick()
|
||||
Assert.assertEquals(valueName, "Главная")
|
||||
}
|
||||
}
|
39
libary/src/main/java/com/example/libary/BottomSheet.kt
Normal file
39
libary/src/main/java/com/example/libary/BottomSheet.kt
Normal file
@ -0,0 +1,39 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.AbsoluteRoundedCornerShape
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.ModalBottomSheet
|
||||
import androidx.compose.runtime.Composable
|
||||
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(
|
||||
modifier: Modifier = Modifier,
|
||||
content: @Composable ColumnScope.() -> Unit
|
||||
) {
|
||||
ModalBottomSheet(
|
||||
modifier = modifier,
|
||||
onDismissRequest = {},
|
||||
containerColor = WhiteColor,
|
||||
shape = AbsoluteRoundedCornerShape(topLeft = 24.dp, topRight = 24.dp),
|
||||
dragHandle = null
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.padding(horizontal = 20.dp)
|
||||
) {
|
||||
Spacer(Modifier.height(24.dp))
|
||||
content()
|
||||
}
|
||||
}
|
||||
}
|
323
libary/src/main/java/com/example/libary/Buttons.kt
Normal file
323
libary/src/main/java/com/example/libary/Buttons.kt
Normal file
@ -0,0 +1,323 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
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.AbsoluteRoundedCornerShape
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
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.sp
|
||||
import com.example.libary.theme.AccentColor
|
||||
import com.example.libary.theme.AccentInactive
|
||||
import com.example.libary.theme.BlackColor
|
||||
import com.example.libary.theme.Desc
|
||||
import com.example.libary.theme.InputBGColor
|
||||
import com.example.libary.theme.InputStroke
|
||||
import com.example.libary.theme.WhiteColor
|
||||
|
||||
enum class BigButtonState(
|
||||
val containerColor: Color,
|
||||
val textColor: Color,
|
||||
val enabled: Boolean = true,
|
||||
val border: BorderStroke? = null
|
||||
) {
|
||||
Property(
|
||||
containerColor = AccentColor,
|
||||
textColor = Color.White,
|
||||
),
|
||||
Inactive(
|
||||
containerColor = AccentInactive,
|
||||
textColor = WhiteColor,
|
||||
enabled = false
|
||||
),
|
||||
Secondary(
|
||||
containerColor = Color.White,
|
||||
textColor = AccentColor,
|
||||
border = BorderStroke(1.dp, AccentColor)
|
||||
),
|
||||
Tetriary(
|
||||
containerColor = InputBGColor,
|
||||
textColor = BlackColor,
|
||||
)
|
||||
}
|
||||
|
||||
// большая кнопка
|
||||
// state - состояние кнопки
|
||||
// modifier - модификаторы
|
||||
// onClick - вызовиться при нажатии на кнопку
|
||||
// text - текст кнопки
|
||||
@Composable
|
||||
fun BigButton(
|
||||
state: BigButtonState,
|
||||
modifier: Modifier = Modifier,
|
||||
onClick: () -> Unit = {},
|
||||
text: String = ""
|
||||
) {
|
||||
Button(
|
||||
onClick = {
|
||||
if (state.enabled) onClick()
|
||||
},
|
||||
modifier = modifier
|
||||
.width(335.dp)
|
||||
.height(56.dp),
|
||||
border = state.border,
|
||||
shape = AbsoluteRoundedCornerShape(10.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = state.containerColor
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp)
|
||||
) {
|
||||
Text(
|
||||
text = text,
|
||||
color = state.textColor,
|
||||
fontWeight = FontWeight.W600,
|
||||
fontSize = 17.sp
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
enum class SmallButtonState(
|
||||
val containerColor: Color,
|
||||
val textColor: Color,
|
||||
val enabled: Boolean = true,
|
||||
val border: BorderStroke? = null
|
||||
) {
|
||||
Property(
|
||||
containerColor = AccentColor,
|
||||
textColor = Color.White,
|
||||
),
|
||||
Inactive(
|
||||
containerColor = AccentInactive,
|
||||
textColor = WhiteColor,
|
||||
enabled = false
|
||||
),
|
||||
Secondary(
|
||||
containerColor = Color.White,
|
||||
textColor = AccentColor,
|
||||
border = BorderStroke(1.dp, AccentColor)
|
||||
),
|
||||
Tetriary(
|
||||
containerColor = InputBGColor,
|
||||
textColor = BlackColor,
|
||||
)
|
||||
}
|
||||
|
||||
// маленькая кнопка
|
||||
// state - состояние кнопки
|
||||
// modifier - модификаторы
|
||||
// onClick - вызовиться при нажатии на кнопку
|
||||
// text - текст кнопки
|
||||
@Composable
|
||||
fun SmallButton(
|
||||
state: SmallButtonState,
|
||||
modifier: Modifier = Modifier,
|
||||
onClick: () -> Unit = {},
|
||||
text: String = ""
|
||||
) {
|
||||
Button(
|
||||
onClick = {
|
||||
if (state.enabled) onClick()
|
||||
},
|
||||
modifier = modifier
|
||||
.width(96.dp)
|
||||
.height(40.dp),
|
||||
border = state.border,
|
||||
shape = AbsoluteRoundedCornerShape(10.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = state.containerColor
|
||||
),
|
||||
contentPadding = PaddingValues(horizontal = 13.5.dp, vertical = 0.dp)
|
||||
) {
|
||||
Text(
|
||||
text = text,
|
||||
color = state.textColor,
|
||||
maxLines = 1,
|
||||
fontWeight = FontWeight.W600,
|
||||
fontSize = 14.sp,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// кнопка корзины
|
||||
// price - сумма которая лежит в корзине
|
||||
// modifier - модификаторы
|
||||
// onClick - вызовиться при нажатии на кнопку
|
||||
// text - текст кнопки
|
||||
@Composable
|
||||
fun CartButton(
|
||||
modifier: Modifier = Modifier,
|
||||
onClick: () -> Unit = {},
|
||||
price: String = ""
|
||||
) {
|
||||
Button(
|
||||
onClick = onClick,
|
||||
modifier = modifier
|
||||
.width(335.dp)
|
||||
.height(56.dp),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = AccentColor
|
||||
),
|
||||
shape = AbsoluteRoundedCornerShape(10.dp)
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(16.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.cart),
|
||||
contentDescription = null
|
||||
)
|
||||
|
||||
Spacer(Modifier.width(16.dp))
|
||||
|
||||
Text(
|
||||
text = "В корзину",
|
||||
fontWeight = FontWeight.W600,
|
||||
fontSize = 17.sp,
|
||||
color = WhiteColor
|
||||
)
|
||||
}
|
||||
|
||||
Text(
|
||||
text = "$price ₽",
|
||||
fontWeight = FontWeight.W600,
|
||||
fontSize = 17.sp,
|
||||
color = WhiteColor
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum class LoginState(
|
||||
val icon: Int,
|
||||
val text: String
|
||||
) {
|
||||
VK(R.drawable.vk, "Войти с VK"),
|
||||
Yandex(R.drawable.yandex, "Войти с Yandex")
|
||||
}
|
||||
|
||||
// кнопка авторизации
|
||||
// state - состояние кнопки
|
||||
// modifier - модификаторы
|
||||
// onClick - вызовиться при нажатии на кнопку
|
||||
@Composable
|
||||
fun LoginButton(
|
||||
modifier: Modifier = Modifier,
|
||||
state: LoginState = LoginState.VK,
|
||||
onClick: () -> Unit = {}
|
||||
) {
|
||||
Button(
|
||||
onClick = onClick,
|
||||
modifier = modifier
|
||||
.width(335.dp)
|
||||
.height(60.dp),
|
||||
shape = AbsoluteRoundedCornerShape(10.dp),
|
||||
border = BorderStroke(1.dp, InputStroke),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = Color.White
|
||||
)
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(state.icon),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(32.dp)
|
||||
)
|
||||
|
||||
Spacer(Modifier.width(16.dp))
|
||||
|
||||
Text(
|
||||
text = state.text,
|
||||
color = Color.Black,
|
||||
fontWeight = FontWeight.W500,
|
||||
fontSize = 17.sp
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum class ChipButtonState(
|
||||
val containerColor: Color,
|
||||
val textColor: Color
|
||||
) {
|
||||
On(AccentColor, Color.White),
|
||||
Off(InputBGColor, Desc)
|
||||
}
|
||||
|
||||
// chip кнопка
|
||||
// state - состояние кнопки
|
||||
// modifier - модификаторы
|
||||
// onClick - вызовиться при нажатии на кнопку
|
||||
// text - текст кнопки
|
||||
@Composable
|
||||
fun ChipButton(
|
||||
modifier: Modifier = Modifier,
|
||||
onClick: () -> Unit = {},
|
||||
state: ChipButtonState = ChipButtonState.On,
|
||||
text: String = ""
|
||||
) {
|
||||
Button(
|
||||
onClick = onClick,
|
||||
modifier = modifier
|
||||
.width(129.dp)
|
||||
.height(48.dp),
|
||||
shape = AbsoluteRoundedCornerShape(10.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = state.containerColor
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp)
|
||||
) {
|
||||
Text(
|
||||
text = text,
|
||||
color = state.textColor,
|
||||
maxLines = 1,
|
||||
fontWeight = FontWeight.W600,
|
||||
fontSize = 14.sp,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun BigButtonPrev() {
|
||||
Column {
|
||||
BigButtonState.entries.forEach {
|
||||
BigButton(
|
||||
state = it,
|
||||
text = "test"
|
||||
)
|
||||
Spacer(Modifier.height(5.dp))
|
||||
}
|
||||
}
|
||||
}
|
287
libary/src/main/java/com/example/libary/Cards.kt
Normal file
287
libary/src/main/java/com/example/libary/Cards.kt
Normal file
@ -0,0 +1,287 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.shape.AbsoluteRoundedCornerShape
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.CardDefaults
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.VerticalDivider
|
||||
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.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.libary.theme.Black1Color
|
||||
import com.example.libary.theme.CaptionColor
|
||||
import com.example.libary.theme.CartShadowColor
|
||||
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,
|
||||
content: @Composable ColumnScope.() -> Unit
|
||||
) {
|
||||
Card(
|
||||
modifier = modifier
|
||||
.shadow(10.dp, AbsoluteRoundedCornerShape(12.dp),
|
||||
ambientColor = CartShadowColor, spotColor = CartShadowColor
|
||||
),
|
||||
shape = AbsoluteRoundedCornerShape(12.dp),
|
||||
colors = CardDefaults.cardColors(
|
||||
containerColor = White1Color
|
||||
),
|
||||
border = BorderStroke(1.dp, DividerColor)
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.padding(16.dp)
|
||||
) {
|
||||
content()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// карточка продукции
|
||||
// modifier - модификаторы
|
||||
// name - название продукции
|
||||
// category - категория продукции
|
||||
// price - цена продукуии
|
||||
// isAdd - если равен true тогда отображаеться кнопка "Добавить" иначе "Убрать"
|
||||
// onClick - вызываеться при нажатии на кнопку Добавить" или "Убрать"
|
||||
@Composable
|
||||
fun PrimaryCard(
|
||||
modifier: Modifier = Modifier,
|
||||
name: String,
|
||||
category: String,
|
||||
price: String,
|
||||
isAdd: Boolean,
|
||||
onClick: () -> Unit = {}
|
||||
) {
|
||||
BaseCard(
|
||||
modifier = modifier
|
||||
) {
|
||||
Text(
|
||||
text = name,
|
||||
color = Black1Color,
|
||||
fontWeight = FontWeight.W500,
|
||||
fontSize = 16.sp
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(16.dp))
|
||||
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Column {
|
||||
Text(
|
||||
text = category,
|
||||
color = CaptionColor,
|
||||
fontWeight = FontWeight.W600,
|
||||
fontSize = 14.sp
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(4.dp))
|
||||
|
||||
Text(
|
||||
text = "$price ₽",
|
||||
color = Black1Color,
|
||||
fontWeight = FontWeight.W600,
|
||||
fontSize = 17.sp
|
||||
)
|
||||
}
|
||||
|
||||
SmallButton(
|
||||
state = if (isAdd) SmallButtonState.Property else SmallButtonState.Secondary,
|
||||
text = if (isAdd) "Добавить" else "Убрать",
|
||||
onClick = onClick
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// карточка продукции для корзины
|
||||
// modifier - модификаторы
|
||||
// name - название продукции
|
||||
// price - цена продукуии
|
||||
// count - количество продукции в корине
|
||||
// onClose - вызываеться при нажатии на крестик
|
||||
// onPlus - вызываеться при нажатии на плюс
|
||||
// onMinus - вызываеться при нажатии на минус
|
||||
@Composable
|
||||
fun CartCard(
|
||||
modifier: Modifier = Modifier,
|
||||
name: String,
|
||||
price: String,
|
||||
count: String,
|
||||
onClose: () -> Unit = {},
|
||||
onPlus: () -> Unit = {},
|
||||
onMinus: () -> Unit = {}
|
||||
) {
|
||||
BaseCard(
|
||||
modifier = modifier
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
) {
|
||||
Text(
|
||||
text = name,
|
||||
fontWeight = FontWeight.W500,
|
||||
fontSize = 16.sp,
|
||||
color = Black1Color,
|
||||
modifier = Modifier.weight(1.0f)
|
||||
)
|
||||
|
||||
Image(
|
||||
painter = painterResource(R.drawable.delete),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.clickable {
|
||||
onClose()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(Modifier.height(34.dp))
|
||||
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(
|
||||
text = "$price ₽",
|
||||
color = Black1Color,
|
||||
fontWeight = FontWeight.W500,
|
||||
fontSize = 17.sp
|
||||
)
|
||||
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(
|
||||
text = "$count штук",
|
||||
fontWeight = FontWeight.W400,
|
||||
fontSize = 15.sp,
|
||||
color = Black1Color
|
||||
)
|
||||
|
||||
Spacer(Modifier.width(42.dp))
|
||||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.width(64.dp)
|
||||
.height(32.dp)
|
||||
.background(InputBGColor, AbsoluteRoundedCornerShape(8.dp))
|
||||
.clip(AbsoluteRoundedCornerShape(8.dp)),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier.padding(6.dp)
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(R.drawable.minus),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.clickable {
|
||||
onMinus()
|
||||
}
|
||||
)
|
||||
|
||||
Spacer(Modifier.width(6.dp))
|
||||
|
||||
VerticalDivider()
|
||||
|
||||
Spacer(Modifier.width(6.dp))
|
||||
|
||||
Image(
|
||||
painter = painterResource(R.drawable.plus),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.clickable {
|
||||
onPlus()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// карточка проекта
|
||||
// modifier - модификаторы
|
||||
// name - название проекта
|
||||
// date - дата проекта
|
||||
// open - вызываеться при нажатии на кнопку "Открыть"
|
||||
@Composable
|
||||
fun ProjectCard(
|
||||
modifier: Modifier = Modifier,
|
||||
name: String,
|
||||
date: String,
|
||||
open: () -> Unit = {}
|
||||
) {
|
||||
BaseCard(
|
||||
modifier = modifier,
|
||||
content = {
|
||||
Text(
|
||||
text = name,
|
||||
fontWeight = FontWeight.W500,
|
||||
fontSize = 16.sp,
|
||||
color = Black1Color
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(44.dp))
|
||||
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Text(
|
||||
text = date,
|
||||
color = CaptionColor,
|
||||
fontWeight = FontWeight.W600,
|
||||
fontSize = 14.sp
|
||||
)
|
||||
|
||||
SmallButton(
|
||||
state = SmallButtonState.Property,
|
||||
text = "Открыть",
|
||||
onClick = open
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun PrimaryCardPrev() {
|
||||
ProjectCard(
|
||||
modifier = Modifier.padding(horizontal = 20.dp),
|
||||
name = "Рубашка Воскресенье для машинного вязания",
|
||||
date = "Прошло 2 дня"
|
||||
)
|
||||
}
|
152
libary/src/main/java/com/example/libary/Header.kt
Normal file
152
libary/src/main/java/com/example/libary/Header.kt
Normal file
@ -0,0 +1,152 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
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.shape.AbsoluteRoundedCornerShape
|
||||
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.graphics.Color
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.libary.HeaderState.*
|
||||
import com.example.libary.theme.Black1Color
|
||||
import com.example.libary.theme.InputBGColor
|
||||
|
||||
enum class HeaderState {
|
||||
Big,
|
||||
Small
|
||||
}
|
||||
|
||||
// Хэдер
|
||||
// modifier - модификаторы
|
||||
// state - состояние хзэдера
|
||||
// title - загаловок
|
||||
// onBack - вызываеться при нажатии на кнопку назад
|
||||
// onRm - вызываеться при нажатии на кнопку удалить
|
||||
@Composable
|
||||
fun Header(
|
||||
modifier: Modifier = Modifier,
|
||||
state: HeaderState,
|
||||
title: String,
|
||||
onBack: () -> Unit = {},
|
||||
onRm: () -> Unit = {}
|
||||
) {
|
||||
when(state) {
|
||||
Big -> {
|
||||
Column(
|
||||
modifier = modifier
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(end = 11.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
) {
|
||||
HeaderBt(
|
||||
icon = R.drawable.back,
|
||||
onClick = onBack
|
||||
)
|
||||
|
||||
Image(
|
||||
painter = painterResource(R.drawable.rm),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.clickable {
|
||||
onRm()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(Modifier.height(24.dp))
|
||||
|
||||
Text(
|
||||
text = title,
|
||||
color = Black1Color,
|
||||
fontWeight = FontWeight.W800,
|
||||
fontSize = 24.sp
|
||||
)
|
||||
}
|
||||
}
|
||||
Small -> {
|
||||
Row(
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.padding(start = 20.dp, end = 26.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
HeaderBt(
|
||||
icon = R.drawable.back,
|
||||
onClick = onBack
|
||||
)
|
||||
|
||||
Text(
|
||||
text = title,
|
||||
color = Black1Color,
|
||||
fontWeight = FontWeight.W600,
|
||||
fontSize = 20.sp
|
||||
)
|
||||
|
||||
Image(
|
||||
painter = painterResource(R.drawable.rm),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.clickable {
|
||||
onRm()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun HeaderBt(
|
||||
icon: Int,
|
||||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
Box(
|
||||
modifier = modifier
|
||||
.size(32.dp)
|
||||
.background(InputBGColor, AbsoluteRoundedCornerShape(8.dp))
|
||||
.clip(AbsoluteRoundedCornerShape(8.dp)),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(icon),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.padding(6.dp).clickable {
|
||||
onClick()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun HeaderPr() {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxSize().background(Color.White).padding(10.dp)
|
||||
) {
|
||||
Header(
|
||||
state = HeaderState.Big,
|
||||
title = "Корзина"
|
||||
)
|
||||
}
|
||||
}
|
146
libary/src/main/java/com/example/libary/Input.kt
Normal file
146
libary/src/main/java/com/example/libary/Input.kt
Normal file
@ -0,0 +1,146 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.shape.AbsoluteRoundedCornerShape
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
||||
import androidx.compose.ui.text.input.VisualTransformation
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.libary.theme.AccentColor
|
||||
import com.example.libary.theme.BlackColor
|
||||
import com.example.libary.theme.CaptionColor
|
||||
import com.example.libary.theme.Error1Color
|
||||
import com.example.libary.theme.InputBGColor
|
||||
import com.example.libary.theme.InputStroke
|
||||
|
||||
/**
|
||||
* текстовое поле
|
||||
* modifier - модификаторы
|
||||
* value - значение
|
||||
* placeholder - the optional placeholder to be displayed when the text field is in focus and the input text is empty.
|
||||
* topText - текст сверху
|
||||
* errorText - текст ошибки
|
||||
* pasMode - пароль мод
|
||||
* onValueChange - вызываеться при изминение текста
|
||||
* */
|
||||
@Composable
|
||||
fun Input(
|
||||
modifier: Modifier = Modifier,
|
||||
modifierColumn: Modifier = Modifier,
|
||||
value: String = "",
|
||||
placeholder: String = "",
|
||||
topText: String = "",
|
||||
errorText: String = "",
|
||||
pasMode: Boolean = false,
|
||||
onValueChange: (String) -> Unit,
|
||||
) {
|
||||
var vis by remember { mutableStateOf(false) }
|
||||
|
||||
Column(modifierColumn) {
|
||||
if (topText.isNotEmpty()) {
|
||||
Text(
|
||||
text = topText,
|
||||
color = Color(0xFF7E7E9A),
|
||||
fontWeight = FontWeight.W400,
|
||||
fontSize = 14.sp
|
||||
)
|
||||
|
||||
Spacer(Modifier.height(8.dp))
|
||||
}
|
||||
|
||||
OutlinedTextField(
|
||||
value = value,
|
||||
modifier = modifier,
|
||||
onValueChange = onValueChange,
|
||||
placeholder = {
|
||||
Text(
|
||||
text = placeholder,
|
||||
color = CaptionColor,
|
||||
fontWeight = FontWeight.W400,
|
||||
fontSize = 16.sp
|
||||
)
|
||||
},
|
||||
trailingIcon = {
|
||||
if (pasMode) {
|
||||
if (vis) {
|
||||
Image(
|
||||
painter = painterResource(R.drawable.gl_2),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.clickable {
|
||||
vis = false
|
||||
}
|
||||
)
|
||||
}else {
|
||||
Image(
|
||||
painter = painterResource(R.drawable.gl_1),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.clickable {
|
||||
vis = true
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
shape = AbsoluteRoundedCornerShape(10.dp),
|
||||
colors = TextFieldDefaults.colors(
|
||||
cursorColor = AccentColor,
|
||||
focusedPlaceholderColor = CaptionColor,
|
||||
unfocusedPlaceholderColor = CaptionColor,
|
||||
|
||||
focusedTextColor = BlackColor,
|
||||
unfocusedTextColor = BlackColor,
|
||||
|
||||
focusedIndicatorColor = if (errorText.isNotEmpty()) Error1Color else AccentColor,
|
||||
unfocusedIndicatorColor = if (errorText.isNotEmpty()) Error1Color else InputStroke,
|
||||
|
||||
focusedContainerColor = if (errorText.isNotEmpty()) Error1Color.copy(0.1f) else InputBGColor,
|
||||
unfocusedContainerColor = if (errorText.isNotEmpty()) Error1Color.copy(0.1f) else InputBGColor
|
||||
),
|
||||
visualTransformation = if (!vis && pasMode) PasswordVisualTransformation('*') else VisualTransformation.None
|
||||
)
|
||||
|
||||
if (errorText.isNotEmpty()) {
|
||||
Spacer(Modifier.height(8.dp))
|
||||
|
||||
Text(
|
||||
text = errorText,
|
||||
color = Error1Color,
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.W400
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun InputPrev() {
|
||||
var value by remember { mutableStateOf("") }
|
||||
|
||||
Input(
|
||||
value = value,
|
||||
placeholder = "Введите имя",
|
||||
topText = "Вве имя",
|
||||
pasMode = true,
|
||||
onValueChange = {
|
||||
value = it
|
||||
}
|
||||
)
|
||||
}
|
97
libary/src/main/java/com/example/libary/SearchInput.kt
Normal file
97
libary/src/main/java/com/example/libary/SearchInput.kt
Normal file
@ -0,0 +1,97 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.AbsoluteRoundedCornerShape
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.focus.onFocusChanged
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.libary.theme.AccentColor
|
||||
import com.example.libary.theme.BlackColor
|
||||
import com.example.libary.theme.CaptionColor
|
||||
import com.example.libary.theme.InputBGColor
|
||||
import com.example.libary.theme.InputStroke
|
||||
|
||||
/***
|
||||
* текстовое поле поиска
|
||||
* modifier - модификаторы
|
||||
* value - значение
|
||||
* onValueChange - вызываеться при изминение текста
|
||||
*/
|
||||
@Composable
|
||||
fun SearchInput(
|
||||
modifier: Modifier = Modifier,
|
||||
value: String = "",
|
||||
onValueChange: (String) -> Unit,
|
||||
) {
|
||||
var focus by remember { mutableStateOf(false) }
|
||||
|
||||
OutlinedTextField(
|
||||
value = value,
|
||||
modifier = modifier.onFocusChanged {
|
||||
focus = it.hasFocus
|
||||
},
|
||||
onValueChange = onValueChange,
|
||||
placeholder = {
|
||||
Text(
|
||||
text = "Искать описание",
|
||||
color = CaptionColor,
|
||||
fontWeight = FontWeight.W400,
|
||||
fontSize = 16.sp
|
||||
)
|
||||
},
|
||||
leadingIcon = {
|
||||
Image(
|
||||
painter = painterResource(R.drawable.icon_search),
|
||||
contentDescription = null
|
||||
)
|
||||
},
|
||||
trailingIcon = {
|
||||
if (focus) {
|
||||
Image(
|
||||
painter = painterResource(R.drawable.delete),
|
||||
contentDescription = null
|
||||
)
|
||||
}
|
||||
},
|
||||
shape = AbsoluteRoundedCornerShape(10.dp),
|
||||
colors = TextFieldDefaults.colors(
|
||||
cursorColor = AccentColor,
|
||||
focusedPlaceholderColor = CaptionColor,
|
||||
unfocusedPlaceholderColor = CaptionColor,
|
||||
focusedTextColor = BlackColor,
|
||||
unfocusedTextColor = BlackColor,
|
||||
focusedIndicatorColor = InputStroke,
|
||||
unfocusedIndicatorColor = InputStroke,
|
||||
focusedContainerColor = InputBGColor,
|
||||
unfocusedContainerColor = InputBGColor
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun SearchInputPrev() {
|
||||
var value by remember { mutableStateOf("") }
|
||||
|
||||
SearchInput(
|
||||
value = value,
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 20.dp, vertical = 7.dp),
|
||||
onValueChange = {
|
||||
value = it
|
||||
}
|
||||
)
|
||||
}
|
116
libary/src/main/java/com/example/libary/Select.kt
Normal file
116
libary/src/main/java/com/example/libary/Select.kt
Normal file
@ -0,0 +1,116 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.shape.AbsoluteRoundedCornerShape
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.MutableState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.libary.theme.BlackColor
|
||||
import com.example.libary.theme.CaptionColor
|
||||
import com.example.libary.theme.InputBGColor
|
||||
import com.example.libary.theme.InputStroke
|
||||
|
||||
/***
|
||||
* текстовое поле поиска
|
||||
* modifier - модификаторы
|
||||
* value - значение
|
||||
* onValueChange - вызываеться при изминение текста
|
||||
* placeholder - the optional placeholder to be displayed when the text field is in focus and the input text is empty.
|
||||
* data - список который будет отображатся в модальном окне
|
||||
* leadingIcon - the optional leading icon to be displayed at the beginning of the text field container
|
||||
*/
|
||||
@Composable
|
||||
fun Select(
|
||||
modifier: Modifier = Modifier,
|
||||
value: MutableState<String>,
|
||||
data: List<String>,
|
||||
placeholder: String = "",
|
||||
leadingIcon: @Composable (() -> Unit)? = null,
|
||||
) {
|
||||
var modal by remember { mutableStateOf(false) }
|
||||
|
||||
OutlinedTextField(
|
||||
value = value.value,
|
||||
onValueChange = {},
|
||||
modifier = modifier,
|
||||
shape = AbsoluteRoundedCornerShape(10.dp),
|
||||
leadingIcon = leadingIcon,
|
||||
placeholder = {
|
||||
Text(
|
||||
text = placeholder,
|
||||
fontWeight = FontWeight.W400,
|
||||
fontSize = 16.sp,
|
||||
color = CaptionColor
|
||||
)
|
||||
},
|
||||
colors = TextFieldDefaults.colors(
|
||||
focusedPlaceholderColor = CaptionColor,
|
||||
unfocusedPlaceholderColor = CaptionColor,
|
||||
focusedTextColor = BlackColor,
|
||||
unfocusedTextColor = BlackColor,
|
||||
focusedIndicatorColor = InputStroke,
|
||||
unfocusedIndicatorColor = InputStroke,
|
||||
focusedContainerColor = InputBGColor,
|
||||
unfocusedContainerColor = InputBGColor
|
||||
),
|
||||
trailingIcon = {
|
||||
Image(
|
||||
painter = painterResource(R.drawable.dr_1),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.testTag("dr_1").clickable {
|
||||
modal = true
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
if (modal) {
|
||||
BottomSheet {
|
||||
LazyColumn {
|
||||
items(data) {
|
||||
Text(
|
||||
text = it,
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.W600,
|
||||
modifier = Modifier
|
||||
.padding(5.dp)
|
||||
.clickable {
|
||||
value.value = it
|
||||
modal = false
|
||||
}
|
||||
)
|
||||
HorizontalDivider()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun SelectPrev() {
|
||||
val value = remember { mutableStateOf("") }
|
||||
|
||||
Select(
|
||||
value = value,
|
||||
data = listOf("test")
|
||||
)
|
||||
}
|
119
libary/src/main/java/com/example/libary/Tabbar.kt
Normal file
119
libary/src/main/java/com/example/libary/Tabbar.kt
Normal file
@ -0,0 +1,119 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.NavigationBar
|
||||
import androidx.compose.material3.NavigationBarItem
|
||||
import androidx.compose.material3.NavigationBarItemDefaults
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.MutableState
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.libary.theme.AccentColor
|
||||
import com.example.libary.theme.IconsColor
|
||||
import com.example.libary.theme.TabBarShad
|
||||
|
||||
data class TabBarData(
|
||||
val icon: Int,
|
||||
val name: String
|
||||
)
|
||||
|
||||
val defaultTabBarData = listOf(
|
||||
TabBarData(
|
||||
icon = R.drawable.bot_1,
|
||||
name = "Главная"
|
||||
),
|
||||
TabBarData(
|
||||
icon = R.drawable.bot_2,
|
||||
name = "Каталог"
|
||||
),
|
||||
TabBarData(
|
||||
icon = R.drawable.bot_3,
|
||||
name = "Проекты"
|
||||
),
|
||||
TabBarData(
|
||||
icon = R.drawable.bot_4,
|
||||
name = "Профиль"
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* Нижняя панель
|
||||
* modifier - модификаторы
|
||||
* value - значение
|
||||
* data - список элементов
|
||||
*
|
||||
* */
|
||||
@Composable
|
||||
fun TabBar(
|
||||
modifier: Modifier = Modifier,
|
||||
value: MutableState<TabBarData>,
|
||||
data: List<TabBarData> = defaultTabBarData
|
||||
) {
|
||||
Column(
|
||||
modifier = modifier
|
||||
.shadow(10.dp, spotColor = TabBarShad, ambientColor = TabBarShad)
|
||||
) {
|
||||
HorizontalDivider(thickness = 1.dp, color = TabBarShad)
|
||||
|
||||
NavigationBar(
|
||||
containerColor = Color.White
|
||||
) {
|
||||
data.forEach {
|
||||
NavigationBarItem(
|
||||
selected = value.value == it,
|
||||
modifier = Modifier.testTag(it.name),
|
||||
colors = NavigationBarItemDefaults.colors(
|
||||
indicatorColor = Color.Transparent
|
||||
),
|
||||
icon = {
|
||||
Icon(
|
||||
painter = painterResource(it.icon),
|
||||
contentDescription = null,
|
||||
tint = if (value.value == it) AccentColor else IconsColor
|
||||
)
|
||||
},
|
||||
label = {
|
||||
Text(
|
||||
text = it.name,
|
||||
color = if (value.value == it) AccentColor else IconsColor,
|
||||
fontWeight = FontWeight.W400,
|
||||
fontSize = 12.sp
|
||||
)
|
||||
},
|
||||
onClick = {
|
||||
value.value = it
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun TabBarPrev() {
|
||||
val value = remember { mutableStateOf(defaultTabBarData[0]) }
|
||||
Column {
|
||||
Spacer(Modifier.height(100.dp))
|
||||
TabBar(
|
||||
value = value
|
||||
)
|
||||
}
|
||||
}
|
38
libary/src/main/java/com/example/libary/Toggle.kt
Normal file
38
libary/src/main/java/com/example/libary/Toggle.kt
Normal file
@ -0,0 +1,38 @@
|
||||
package com.example.libary
|
||||
|
||||
import androidx.compose.material3.Checkbox
|
||||
import androidx.compose.material3.CheckboxDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.example.libary.theme.AccentColor
|
||||
|
||||
/**
|
||||
* Checkboxes allow users to select one or more items from a set. Checkboxes can turn an option on or off.
|
||||
* @param checked whether this checkbox is checked or unchecked
|
||||
* @param onCheckedChange called when this checkbox is clicked. If `null`, then this checkbox will
|
||||
* not be interactable, unless something else handles its input events and updates its state.
|
||||
* @param modifier the [Modifier] to be applied to this checkbox
|
||||
* */
|
||||
@Composable
|
||||
fun Toggle(
|
||||
modifier: Modifier = Modifier,
|
||||
checked: Boolean,
|
||||
onCheckedChange: ((Boolean) -> Unit)? = null,
|
||||
) {
|
||||
Checkbox(
|
||||
checked = checked,
|
||||
onCheckedChange = onCheckedChange,
|
||||
colors = CheckboxDefaults.colors(
|
||||
checkedColor = AccentColor
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun TogglePrev() {
|
||||
Toggle(
|
||||
checked = true
|
||||
)
|
||||
}
|
@ -8,4 +8,31 @@ val Pink80 = Color(0xFFEFB8C8)
|
||||
|
||||
val Purple40 = Color(0xFF6650a4)
|
||||
val PurpleGrey40 = Color(0xFF625b71)
|
||||
val Pink40 = Color(0xFF7D5260)
|
||||
val Pink40 = Color(0xFF7D5260)
|
||||
|
||||
val AccentColor = Color(0xFF1A6FEE)
|
||||
val AccentInactiveColor = Color(0xFFC5D2FF)
|
||||
val BlackColor = Color(0xFF2D2C2C)
|
||||
val WhiteColor = Color(0xFFF7F7F7)
|
||||
val ErrorColor = Color(0xFFFF4646)
|
||||
val SuccessColor = Color(0xFF00B412)
|
||||
val InputBgColor = Color(0xFFF7F7FA)
|
||||
val InputStrokeColor = Color(0xFFE6E6E6)
|
||||
val InputIconColor = Color(0xFFBFC7D1)
|
||||
val PlaceholderColor = Color(0xFF98989A)
|
||||
val DescriptionColor = Color(0xFF8787A1)
|
||||
val CardStrokeColor = Color(0xFFF2F2F2)
|
||||
val DividerColor = Color(0xFFF4F4F4)
|
||||
|
||||
val CartShadowColor = Color(0x99E4E8F5)
|
||||
val CaptionColor = Color(0xFF939396)
|
||||
val InputBGColor = Color(0xFFF5F5F9)
|
||||
val AccentInactive = Color(0xFFC9D4FB)
|
||||
val Desc = Color(0xFF7E7E9A)
|
||||
val InputStroke = Color(0xFFEBEBEB)
|
||||
val IconsColor = Color(0xFFB8C1CC)
|
||||
val TabBarShad = Color(0x4DA0A0A0)
|
||||
val Error1Color = Color(0xFFFD3535)
|
||||
|
||||
val White1Color = Color.White
|
||||
val Black1Color = Color.Black
|
@ -1,14 +1,13 @@
|
||||
package com.example.libary.theme
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
|
||||
private val DarkColorScheme = darkColorScheme(
|
||||
@ -25,8 +24,8 @@ private val LightColorScheme = lightColorScheme(
|
||||
|
||||
@Composable
|
||||
fun UikitTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
dynamicColor: Boolean = true,
|
||||
darkTheme: Boolean = false,
|
||||
dynamicColor: Boolean = false,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val colorScheme = when {
|
||||
@ -39,9 +38,13 @@ fun UikitTheme(
|
||||
else -> LightColorScheme
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme,
|
||||
typography = Typography,
|
||||
content = content
|
||||
)
|
||||
CompositionLocalProvider(
|
||||
LocalUiKitTypography provides UiKitTypography()
|
||||
) {
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme,
|
||||
typography = Typography,
|
||||
content = content
|
||||
)
|
||||
}
|
||||
}
|
@ -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,
|
||||
|
113
libary/src/main/java/com/example/libary/theme/UiKitTypography.kt
Normal file
113
libary/src/main/java/com/example/libary/theme/UiKitTypography.kt
Normal file
@ -0,0 +1,113 @@
|
||||
package com.example.libary.theme
|
||||
|
||||
import androidx.compose.runtime.staticCompositionLocalOf
|
||||
import androidx.compose.ui.graphics.Color
|
||||
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
|
||||
|
||||
data class UiKitTypography(
|
||||
val title1Semibold: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 24.sp,
|
||||
fontWeight = FontWeight.W600
|
||||
),
|
||||
val title1ExtraBold: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 24.sp,
|
||||
fontWeight = FontWeight.W800
|
||||
),
|
||||
val title2Regular: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.W400
|
||||
),
|
||||
val title2Semibold: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.W600
|
||||
),
|
||||
val title2ExtraBold: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.W800
|
||||
),
|
||||
val title3Regular: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 17.sp,
|
||||
fontWeight = FontWeight.W400
|
||||
),
|
||||
val title3Medium: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 17.sp,
|
||||
fontWeight = FontWeight.W500
|
||||
),
|
||||
val title3Semibold: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 17.sp,
|
||||
fontWeight = FontWeight.W600
|
||||
),
|
||||
val headlineRegular: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.W400
|
||||
),
|
||||
val headlineMedium: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.W500
|
||||
),
|
||||
val textRegular: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 15.sp,
|
||||
fontWeight = FontWeight.W400
|
||||
),
|
||||
val textMedium: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 15.sp,
|
||||
fontWeight = FontWeight.W400
|
||||
),
|
||||
val captionRegular: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.W400
|
||||
),
|
||||
val captionSemibold: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.W600
|
||||
),
|
||||
val caption2Regular: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.W400
|
||||
),
|
||||
val caption2Bold: TextStyle = TextStyle(
|
||||
color = Color.Black,
|
||||
fontFamily = FontFamily(Font(R.font.main)),
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.W700
|
||||
)
|
||||
)
|
||||
|
||||
val LocalUiKitTypography = staticCompositionLocalOf<UiKitTypography> {
|
||||
error("UiKitTypography not found")
|
||||
}
|
13
libary/src/main/res/drawable/back.xml
Normal file
13
libary/src/main/res/drawable/back.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M11.5,15L6.5,10L11.5,5"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#7E7E9A"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
9
libary/src/main/res/drawable/bot_1.xml
Normal file
9
libary/src/main/res/drawable/bot_1.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M27.481,15.773L23.809,12.624V8.373C23.809,8.112 23.598,7.901 23.337,7.901H20.878C20.617,7.901 20.405,8.112 20.405,8.373V9.702L16.315,6.195C16.136,6.034 15.865,6.034 15.685,6.195L4.52,15.773C4.368,15.903 4.314,16.113 4.385,16.3C4.455,16.486 4.635,16.608 4.835,16.605H8.191V25.446C8.191,25.707 8.403,25.919 8.663,25.919H10.307C10.568,25.919 10.78,25.707 10.78,25.446C10.78,25.186 10.568,24.974 10.307,24.974H9.136V16.132C9.136,15.872 8.924,15.66 8.663,15.66H6.104L16,7.184L25.897,15.66H23.337C23.076,15.66 22.865,15.872 22.865,16.132V24.974H21.69C21.43,24.974 21.218,25.186 21.218,25.446C21.218,25.707 21.43,25.919 21.69,25.919H23.337C23.598,25.919 23.809,25.707 23.809,25.446V16.605H27.176C27.375,16.608 27.555,16.486 27.625,16.3C27.696,16.113 27.642,15.903 27.491,15.773L27.481,15.773ZM21.353,8.846H22.865V11.815L21.353,10.518V8.846ZM20.408,17.732H11.592C11.331,17.732 11.119,17.943 11.119,18.204V26.391C11.119,26.652 11.331,26.864 11.592,26.864H20.408C20.669,26.864 20.881,26.652 20.881,26.391V18.204C20.881,17.943 20.669,17.732 20.408,17.732ZM16.671,18.677V20.859L16.561,20.792L16.56,20.793C16.374,20.68 16.135,20.71 15.981,20.865L15.553,21.296L15.333,21.044V18.677L16.671,18.677ZM19.939,25.919H12.068V18.677H14.391V21.221C14.39,21.337 14.432,21.449 14.508,21.536L15.178,22.298C15.265,22.396 15.388,22.454 15.519,22.458C15.645,22.459 15.766,22.409 15.855,22.32L16.378,21.791L16.885,22.106C17.031,22.193 17.212,22.195 17.36,22.112C17.507,22.028 17.599,21.872 17.6,21.703V18.677H19.936L19.939,25.919Z"
|
||||
android:fillColor="#B8C1CC"/>
|
||||
</vector>
|
35
libary/src/main/res/drawable/bot_2.xml
Normal file
35
libary/src/main/res/drawable/bot_2.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M7,23.479V8.521C7,7.129 8.129,6 9.521,6H22.479C23.871,6 25,7.129 25,8.521V23.479C25,24.871 23.871,26 22.479,26H9.521C8.129,26 7,24.871 7,23.479Z"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"/>
|
||||
<path
|
||||
android:pathData="M11,16V11H16V16H11Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"/>
|
||||
<path
|
||||
android:pathData="M20,11H21"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M20,16H21"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M11,21L21,21"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
27
libary/src/main/res/drawable/bot_3.xml
Normal file
27
libary/src/main/res/drawable/bot_3.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M7.369,1.837H2.683C2.456,1.837 2.305,1.987 2.305,2.212V6.825C2.305,7.05 2.456,7.2 2.683,7.2H7.331C7.558,7.2 7.709,7.049 7.709,6.825V2.212C7.746,1.987 7.557,1.837 7.369,1.837ZM6.991,6.45H3.061V2.587H6.953V6.45H6.991Z"
|
||||
android:fillColor="#B8C1CC"/>
|
||||
<path
|
||||
android:pathData="M7.369,9.3H2.683C2.456,9.3 2.305,9.45 2.305,9.675V14.287C2.305,14.512 2.456,14.662 2.683,14.662H7.331C7.558,14.662 7.709,14.512 7.709,14.287V9.675C7.746,9.487 7.557,9.3 7.369,9.3ZM6.991,13.95H3.061V10.05H6.953V13.95H6.991Z"
|
||||
android:fillColor="#B8C1CC"/>
|
||||
<path
|
||||
android:pathData="M7.369,16.8H2.683C2.456,16.8 2.305,16.95 2.305,17.175V21.787C2.305,22.012 2.456,22.162 2.683,22.162H7.331C7.558,22.162 7.709,22.012 7.709,21.787V17.175C7.746,16.987 7.557,16.8 7.369,16.8ZM6.991,21.412H3.061V17.55H6.953V21.412H6.991Z"
|
||||
android:fillColor="#B8C1CC"/>
|
||||
<path
|
||||
android:pathData="M4.194,5.662C4.269,5.737 4.383,5.774 4.458,5.774C4.572,5.774 4.647,5.737 4.723,5.662L6.537,3.862C6.688,3.712 6.688,3.487 6.537,3.337C6.386,3.187 6.159,3.187 6.008,3.337L4.458,4.874L4.043,4.462C3.891,4.312 3.665,4.312 3.514,4.462C3.362,4.612 3.362,4.837 3.514,4.987L4.194,5.662Z"
|
||||
android:fillColor="#B8C1CC"/>
|
||||
<path
|
||||
android:pathData="M4.194,13.162C4.269,13.237 4.345,13.274 4.458,13.274C4.572,13.274 4.647,13.237 4.723,13.162L6.537,11.362C6.688,11.212 6.688,10.987 6.537,10.837C6.386,10.687 6.159,10.687 6.008,10.837L4.458,12.374L4.043,11.962C3.891,11.812 3.665,11.812 3.514,11.962C3.362,12.112 3.362,12.337 3.514,12.487L4.194,13.162Z"
|
||||
android:fillColor="#B8C1CC"/>
|
||||
<path
|
||||
android:pathData="M4.194,20.662C4.269,20.737 4.383,20.774 4.458,20.774C4.572,20.774 4.647,20.737 4.723,20.662L6.537,18.862C6.688,18.712 6.688,18.487 6.537,18.337C6.386,18.187 6.159,18.187 6.008,18.337L4.458,19.874L4.043,19.462C3.891,19.312 3.665,19.312 3.514,19.462C3.362,19.612 3.362,19.837 3.514,19.987L4.194,20.662Z"
|
||||
android:fillColor="#B8C1CC"/>
|
||||
<path
|
||||
android:pathData="M23.655,13.462H19.423C19.196,13.462 19.045,13.612 19.045,13.837C18.289,13.575 18.553,13.725 18.175,13.537L18.176,5.887C18.176,5.775 18.138,5.7 18.062,5.625L12.508,0.112C12.432,0.038 12.319,0 12.243,0H0.378C0.151,0 0,0.15 0,0.375V23.625C0,23.85 0.151,24 0.378,24H17.76C17.987,24 18.138,23.85 18.138,23.625V21.45H19.007C19.045,21.638 19.196,21.75 19.385,21.75H23.617C23.844,21.75 23.995,21.6 23.995,21.375V13.838C24.033,13.613 23.844,13.463 23.655,13.463L23.655,13.462ZM19.045,14.587V20.7H11.752C11.223,20.7 11.185,20.287 11.185,20.175C11.185,20.024 11.223,19.912 11.299,19.8C11.374,19.687 11.525,19.65 11.676,19.65C11.903,19.65 12.054,19.5 12.054,19.275C12.054,19.049 11.903,18.9 11.676,18.9H11.147C10.618,18.9 10.58,18.487 10.58,18.375C10.58,18.187 10.694,17.85 11.11,17.85C11.299,17.85 11.45,17.699 11.487,17.512C11.487,17.324 11.374,17.137 11.185,17.099H10.921C10.316,17.137 10.089,17.024 10.014,16.725C9.976,16.574 10.014,16.387 10.089,16.274C10.203,16.162 10.354,16.087 10.505,16.087C10.732,16.087 10.883,15.937 10.883,15.712C10.883,15.487 10.732,15.337 10.505,15.337H9.938C9.523,15.337 9.409,15 9.409,14.812C9.409,14.737 9.447,14.287 9.976,14.287H12.621C13.226,14.287 13.717,14.024 13.944,13.612C14.133,13.199 14.208,12.487 13.339,11.362C13.037,10.987 12.923,10.499 13.075,10.124C13.264,9.599 13.793,9.374 14.133,9.337C14.095,12.074 16.816,13.687 18.025,14.249C18.062,14.325 19.045,14.587 19.045,14.587L19.045,14.587ZM12.621,1.274L16.891,5.512H12.621V1.274ZM17.42,23.249H0.793V0.749H11.865V5.887C11.865,6.112 12.016,6.262 12.243,6.262H17.42V13.087C16.286,12.374 14.888,11.099 14.926,9.337C14.926,9.149 14.85,8.924 14.699,8.812C14.548,8.662 14.321,8.624 14.132,8.624C13.263,8.737 12.658,9.224 12.394,9.899C12.167,10.537 12.318,11.249 12.772,11.849C13.263,12.449 13.452,13.012 13.301,13.274C13.188,13.499 12.81,13.537 12.658,13.537H10.013C9.144,13.537 8.691,14.174 8.691,14.812C8.691,15.262 8.955,15.749 9.409,15.974C9.258,16.274 9.22,16.574 9.295,16.912C9.409,17.362 9.711,17.624 10.013,17.737C9.9,17.924 9.862,18.149 9.862,18.374C9.862,18.824 10.127,19.312 10.58,19.537C10.467,19.724 10.429,19.949 10.429,20.174C10.429,20.812 10.882,21.449 11.752,21.449H17.42L17.42,23.249ZM23.277,21.037H19.8V14.212H23.277V21.037Z"
|
||||
android:fillColor="#B8C1CC"/>
|
||||
</vector>
|
16
libary/src/main/res/drawable/bot_4.xml
Normal file
16
libary/src/main/res/drawable/bot_4.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,6m-4,0a4,4 0,1 1,8 0a4,4 0,1 1,-8 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"/>
|
||||
<path
|
||||
android:pathData="M12,13C16.502,13 20,16.326 20,20.25V20.251C20,20.251 20,20.253 19.999,20.256C19.997,20.262 19.99,20.277 19.974,20.304C19.937,20.361 19.858,20.454 19.7,20.57C19.376,20.809 18.841,21.061 18.081,21.285C16.573,21.731 14.425,22 12,22C9.575,22 7.427,21.731 5.919,21.285C5.159,21.061 4.624,20.809 4.3,20.57C4.142,20.454 4.063,20.361 4.026,20.304C4.01,20.277 4.003,20.262 4.001,20.256C4,20.253 4,20.251 4,20.251V20.25C4,16.326 7.498,13 12,13Z"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"/>
|
||||
</vector>
|
31
libary/src/main/res/drawable/cart.xml
Normal file
31
libary/src/main/res/drawable/cart.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M0,0h20v20h-20z"/>
|
||||
<path
|
||||
android:pathData="M7.5,18.333C7.96,18.333 8.333,17.96 8.333,17.5C8.333,17.04 7.96,16.667 7.5,16.667C7.04,16.667 6.667,17.04 6.667,17.5C6.667,17.96 7.04,18.333 7.5,18.333Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M16.667,18.333C17.127,18.333 17.5,17.96 17.5,17.5C17.5,17.04 17.127,16.667 16.667,16.667C16.207,16.667 15.833,17.04 15.833,17.5C15.833,17.96 16.207,18.333 16.667,18.333Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M0.833,0.833H4.167L6.4,11.992C6.476,12.375 6.685,12.72 6.99,12.965C7.294,13.211 7.676,13.341 8.067,13.333H16.167C16.558,13.341 16.939,13.211 17.244,12.965C17.549,12.72 17.757,12.375 17.833,11.992L19.167,5H5"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeLineCap="round"/>
|
||||
</group>
|
||||
</vector>
|
20
libary/src/main/res/drawable/delete.xml
Normal file
20
libary/src/main/res/drawable/delete.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M15,5L5,15"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#7E7E9A"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M5,5L15,15"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#7E7E9A"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
13
libary/src/main/res/drawable/dr_1.xml
Normal file
13
libary/src/main/res/drawable/dr_1.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M5,8.5L10,13.5L15,8.5"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#7E7E9A"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
13
libary/src/main/res/drawable/gl_1.xml
Normal file
13
libary/src/main/res/drawable/gl_1.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M0,0h20v20h-20z"/>
|
||||
<path
|
||||
android:pathData="M0.818,0.14C0.632,-0.047 0.33,-0.047 0.144,0.14C-0.042,0.326 -0.042,0.628 0.144,0.814L4.255,4.925C2.555,6.245 1.131,7.887 0.066,9.757C-0.022,9.907 -0.022,10.093 0.066,10.243C2.235,13.906 4.999,16.215 8.064,16.921C8.7,17.068 9.35,17.142 10.002,17.142C11.763,17.118 13.481,16.592 14.954,15.627L19.185,19.86V19.86C19.372,20.046 19.673,20.046 19.86,19.86C20.046,19.674 20.046,19.372 19.86,19.186L0.818,0.14ZM8.019,8.689L11.313,11.984H11.314C10.699,12.386 9.933,12.481 9.239,12.243C8.545,12.004 7.999,11.458 7.761,10.764C7.523,10.07 7.618,9.304 8.019,8.689L8.019,8.689ZM8.281,15.993C5.544,15.362 3.044,13.292 1.036,10H1.036C2.034,8.293 3.357,6.798 4.931,5.601L7.344,8.014C6.694,8.873 6.501,9.994 6.827,11.02C7.153,12.047 7.957,12.851 8.983,13.177C10.009,13.503 11.13,13.31 11.989,12.66L14.266,14.938H14.266C12.488,16.065 10.337,16.444 8.281,15.993L8.281,15.993ZM10.35,7.655L9.421,6.726C9.613,6.687 9.807,6.668 10.002,6.667C10.886,6.667 11.734,7.018 12.359,7.643C12.984,8.268 13.335,9.116 13.335,10C13.334,10.195 13.315,10.39 13.276,10.581L12.347,9.652H12.348C12.273,9.149 12.038,8.683 11.679,8.324C11.319,7.964 10.853,7.729 10.35,7.655ZM19.934,9.757V9.757C20.022,9.907 20.022,10.093 19.934,10.243C19.096,11.686 18.057,13.003 16.849,14.155L16.174,13.479V13.479C17.26,12.452 18.2,11.281 18.969,10C16.532,6.006 13.356,3.81 10.002,3.81C9.005,3.82 8.019,4.021 7.097,4.401L6.359,3.663C7.503,3.141 8.745,2.867 10.002,2.858C13.774,2.858 17.301,5.308 19.934,9.757L19.934,9.757Z"
|
||||
android:fillColor="#000000"/>
|
||||
</group>
|
||||
</vector>
|
12
libary/src/main/res/drawable/gl_2.xml
Normal file
12
libary/src/main/res/drawable/gl_2.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="19dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="19">
|
||||
<path
|
||||
android:pathData="M10,6.955C9.216,6.955 8.464,7.266 7.909,7.82C7.355,8.374 7.043,9.126 7.042,9.91C7.042,10.694 7.353,11.446 7.908,12C8.462,12.555 9.214,12.867 9.998,12.867C10.781,12.867 11.533,12.556 12.088,12.001C12.642,11.447 12.954,10.695 12.954,9.911C12.953,9.128 12.642,8.376 12.088,7.822C11.534,7.268 10.783,6.956 10,6.956L10,6.955ZM10,11.225C9.651,11.226 9.316,11.087 9.069,10.84C8.821,10.594 8.683,10.259 8.682,9.91C8.682,9.561 8.821,9.226 9.068,8.979C9.315,8.732 9.65,8.593 9.999,8.594C10.348,8.594 10.683,8.733 10.929,8.98C11.176,9.227 11.314,9.562 11.314,9.911C11.313,10.259 11.175,10.594 10.928,10.84C10.682,11.086 10.348,11.225 10,11.225L10,11.225Z"
|
||||
android:fillColor="#000000"/>
|
||||
<path
|
||||
android:pathData="M17.471,7.507L18.225,6.666C18.421,6.447 18.485,6.141 18.393,5.863C18.302,5.584 18.069,5.376 17.782,5.316C17.495,5.256 17.198,5.354 17.003,5.572L16.274,6.381V6.381C15.722,5.933 15.124,5.544 14.49,5.222L14.982,4.311V4.311C15.087,4.059 15.06,3.771 14.909,3.543C14.759,3.315 14.505,3.177 14.231,3.175C13.958,3.173 13.702,3.307 13.548,3.533L12.967,4.605C12.268,4.393 11.548,4.258 10.82,4.204V3.169C10.82,2.876 10.664,2.605 10.41,2.459C10.156,2.312 9.844,2.312 9.59,2.459C9.336,2.605 9.18,2.876 9.18,3.169V4.202C8.452,4.256 7.732,4.391 7.033,4.603L6.452,3.533C6.313,3.275 6.046,3.112 5.754,3.103C5.461,3.095 5.186,3.244 5.032,3.493C4.878,3.743 4.87,4.055 5.009,4.313L5.501,5.224C4.867,5.546 4.269,5.935 3.717,6.383L2.988,5.574V5.574C2.793,5.356 2.496,5.258 2.209,5.318C1.922,5.378 1.689,5.586 1.598,5.865C1.506,6.143 1.57,6.449 1.765,6.667L2.529,7.507C1.959,8.123 1.469,8.808 1.071,9.546C0.957,9.776 0.957,10.046 1.071,10.275C1.182,10.496 3.83,15.649 10,15.649C16.17,15.649 18.823,10.496 18.929,10.275C19.043,10.046 19.043,9.776 18.929,9.546C18.531,8.808 18.041,8.123 17.471,7.507L17.471,7.507ZM10,14.009C5.683,14.009 3.416,10.988 2.746,9.911C3.418,8.847 5.712,5.809 10,5.809C11.033,5.802 12.059,5.988 13.025,6.356L13.098,6.385H13.098C14.068,6.775 14.957,7.341 15.72,8.056C15.745,8.085 15.771,8.116 15.8,8.144C15.829,8.171 15.84,8.173 15.858,8.187L15.858,8.187C16.391,8.704 16.86,9.282 17.254,9.911C16.582,10.974 14.288,14.009 10,14.009L10,14.009Z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
20
libary/src/main/res/drawable/icon_search.xml
Normal file
20
libary/src/main/res/drawable/icon_search.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M9.167,15.833C12.849,15.833 15.833,12.849 15.833,9.167C15.833,5.485 12.849,2.5 9.167,2.5C5.485,2.5 2.5,5.485 2.5,9.167C2.5,12.849 5.485,15.833 9.167,15.833Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M17.5,17.5L13.875,13.875"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
13
libary/src/main/res/drawable/minus.xml
Normal file
13
libary/src/main/res/drawable/minus.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M4.167,10H15.833"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
20
libary/src/main/res/drawable/plus.xml
Normal file
20
libary/src/main/res/drawable/plus.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M10,4.167V15.833"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#939396"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M4.167,10H15.833"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#939396"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
34
libary/src/main/res/drawable/rm.xml
Normal file
34
libary/src/main/res/drawable/rm.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:viewportWidth="20"
|
||||
android:viewportHeight="20">
|
||||
<path
|
||||
android:pathData="M2.5,5H4.167H17.5"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6.667,5V3.333C6.667,2.891 6.842,2.467 7.155,2.155C7.467,1.842 7.891,1.667 8.333,1.667H11.667C12.109,1.667 12.533,1.842 12.845,2.155C13.158,2.467 13.333,2.891 13.333,3.333V5M15.833,5V16.667C15.833,17.109 15.658,17.533 15.345,17.845C15.033,18.158 14.609,18.333 14.167,18.333H5.833C5.391,18.333 4.967,18.158 4.655,17.845C4.342,17.533 4.167,17.109 4.167,16.667V5H15.833Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M8.333,9.167V14.167"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M11.667,9.167V14.167"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#B8C1CC"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
17
libary/src/main/res/drawable/vk.xml
Normal file
17
libary/src/main/res/drawable/vk.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="33dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="33"
|
||||
android:viewportHeight="32">
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M0.5,0h32v32h-32z"/>
|
||||
<path
|
||||
android:pathData="M0.5,0H32.5V32H0.5V0Z"
|
||||
android:fillColor="#0077FF"/>
|
||||
<path
|
||||
android:pathData="M8.571,8.622C7.611,9.76 7.611,11.467 7.611,14.915V17.067C7.611,20.498 7.611,22.222 8.571,23.36C8.731,23.573 8.927,23.751 9.105,23.911C10.26,24.871 11.985,24.871 15.416,24.871H17.567C20.998,24.871 22.722,24.871 23.86,23.911C24.074,23.751 24.251,23.556 24.411,23.378C25.371,22.222 25.371,20.498 25.371,17.067V14.933C25.371,11.502 25.371,9.778 24.411,8.64C24.251,8.427 24.056,8.249 23.878,8.071C22.722,7.111 20.998,7.111 17.567,7.111H15.434C12.002,7.111 10.278,7.111 9.14,8.053C8.927,8.231 8.749,8.409 8.589,8.622H8.571ZM10.634,13.298C10.722,14.524 11.131,15.858 11.7,16.764C12.749,18.489 14.349,19.378 16.678,19.502L17.069,19.538V16.978L17.354,17.013C18.473,17.156 19.611,18.044 20.091,19.182L20.234,19.538H20.589C21.176,19.538 22.278,19.573 22.278,19.538C22.06,18.797 21.696,18.107 21.208,17.508C20.719,16.91 20.116,16.415 19.434,16.053L19.291,15.964L19.522,15.787C20.666,15.063 21.493,13.932 21.834,12.622V12.444H19.967L19.825,12.8C19.469,13.689 18.634,14.649 17.905,15.004C17.638,15.129 17.371,15.2 17.069,15.236V12.444H15.345V17.369L15.078,17.28C14.367,17.013 13.691,16.355 13.282,15.573C12.927,14.915 12.678,13.867 12.607,12.942L12.589,12.444H10.58L10.651,13.298H10.634Z"
|
||||
android:fillColor="#ffffff"
|
||||
android:fillType="evenOdd"/>
|
||||
</group>
|
||||
</vector>
|
9
libary/src/main/res/drawable/yandex.xml
Normal file
9
libary/src/main/res/drawable/yandex.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="33dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="33"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M6.17,0C3.029,0 0.5,2.529 0.5,5.67V26.33C0.5,29.471 3.029,32 6.17,32H21.376L32.5,16.004L21.376,0H6.17V0ZM14.685,5.842H18.298C18.52,5.842 18.647,5.923 18.647,6.114V26.026C18.647,26.162 18.583,26.243 18.393,26.243H16.428C16.302,26.243 16.207,26.134 16.207,26.053V18.681H14.621L10.216,26.053C10.153,26.189 10.026,26.243 9.836,26.243H7.586C7.333,26.243 7.175,26.053 7.333,25.808L12.181,18.3C9.583,17.321 8.125,15.335 8.125,12.642C8.125,8.154 11.136,5.842 14.685,5.842L14.685,5.842ZM14.59,7.582C12.657,7.582 10.755,8.969 10.755,12.37C10.755,15.634 12.783,16.94 14.875,16.94H16.207V7.582H14.59Z"
|
||||
android:fillColor="#FFC107"/>
|
||||
</vector>
|
BIN
libary/src/main/res/font/main.ttf
Normal file
BIN
libary/src/main/res/font/main.ttf
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user