Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f7f2623
Созданы модули Редактирования профиля Profile-edit
Yrun00 Jan 28, 2026
586ce43
DropDownMenu with previews
Yrun00 Jan 30, 2026
fc9f769
DropDownMenu with previews
Yrun00 Jan 30, 2026
a84e437
DropDownMenu with previews
Yrun00 Jan 30, 2026
7eb9590
UploadPhotoButton with previews
Yrun00 Jan 30, 2026
3e60ed2
DefaultTextField refactor
Yrun00 Feb 1, 2026
fd31ffb
DropDownMenu DefaultTextField reused
Yrun00 Feb 1, 2026
24ef988
UploadPhotoButton lines fix
Yrun00 Feb 1, 2026
16d84b9
add font for ProfileEdit TabBar
Yrun00 Feb 1, 2026
38e7403
add TabBar
Yrun00 Feb 1, 2026
c7448b7
added secondary color for OutlineButton and preview
Yrun00 Feb 1, 2026
458a695
added SmallScreenSizePreview
Yrun00 Feb 1, 2026
c1f2779
added UnsavedChangesDialog with preview
Yrun00 Feb 1, 2026
03e08dd
resolve empty lines merge conflict
Yrun00 Jan 28, 2026
a4efd9f
DropDownMenu with previews
Yrun00 Jan 30, 2026
15772e3
DropDownMenu with previews
Yrun00 Jan 30, 2026
8a622da
DropDownMenu with previews
Yrun00 Jan 30, 2026
dca3b20
UploadPhotoButton with previews
Yrun00 Jan 30, 2026
9bd2b34
DefaultTextField refactor
Yrun00 Feb 1, 2026
2955ef4
DropDownMenu DefaultTextField reused
Yrun00 Feb 1, 2026
0ce181e
UploadPhotoButton lines fix
Yrun00 Feb 1, 2026
9006bfe
add font for ProfileEdit TabBar
Yrun00 Feb 1, 2026
5263a30
add TabBar
Yrun00 Feb 1, 2026
6a99c15
added secondary color for OutlineButton and preview
Yrun00 Feb 1, 2026
f294038
added SmallScreenSizePreview
Yrun00 Feb 1, 2026
e2498e8
added UnsavedChangesDialog with preview
Yrun00 Feb 1, 2026
cfefbe2
Merge remote-tracking branch 'origin/feature/ANDR-40-Core-UI' into fe…
Yrun00 Feb 1, 2026
49fe97d
UnsavedChangesDialog color fix
Yrun00 Feb 1, 2026
e1a79dc
UnsavedChangesDialog fix font and typo
Yrun00 Feb 2, 2026
aef290f
Merge branch 'epic/ANDR-37' into feature/ANDR-38-Core-UI
Yrun00 Feb 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package ru.yeahub.navigation_api
* - Построение путей с учетом родительских маршрутов
*/
object FeatureRoute {

fun createFeatureRoute(parentRoute: String, featureName: String): String =
if (parentRoute.isEmpty()) featureName else "$parentRoute/$featureName"

Expand Down Expand Up @@ -46,23 +46,28 @@ object FeatureRoute {
object DetailsFeature {
const val FEATURE_NAME = "details"
}

object PublicQuestionsFeature {
const val FEATURE_NAME = "public_questions"
}

object DetailQuestionFeature {
const val FEATURE_NAME = "detail_question"
}

object SpecializationsFeature {
const val FEATURE_NAME = "specializations"
}

object CollectionsFeature {
const val FEATURE_NAME = "collections"
}

object PublicCollectionsFeature {
const val FEATURE_NAME = "public_collections"
}
object ProfileEditFeature{

object ProfileEditFeature {
const val FEATURE_NAME = "profile_edit"
}
}
53 changes: 53 additions & 0 deletions core/ui/src/main/java/ru/yeahub/core_ui/component/AlertDialog.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package ru.yeahub.core_ui.component

import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import ru.yeahub.core_ui.example.dynamicPreview.SmallScreenSizePreview
import ru.yeahub.core_ui.theme.Theme
import ru.yeahub.core_ui.theme.colors

@Composable
fun UnsavedChangesDialog(
onStay: () -> Unit,
onLeave: () -> Unit,
) {
AlertDialog(
onDismissRequest = onStay,
title = {
Text(
text = "Подтвердить действие",
style = Theme.typography.head4,
)
},
text = {
Text(
"У вас есть несохраненные данные.\nВы хотите продолжить?",
style = Theme.typography.body3,
)
},
dismissButton = {
PrimaryButton(onClick = onStay) {
Text("Да")
}
},
confirmButton = {
OutlineButton(
onClick = onLeave,
colors = YeahubButtonDefaults.secondaryOutlinedButtonColors(),
border = YeahubButtonDefaults.secondaryOutlineBorderDefaults(),
) {
Text(
"Нет",
)
}
},
containerColor = colors.white900,
)
}

@SmallScreenSizePreview
@Composable
fun UnsavedChangesDialogPreview() {
UnsavedChangesDialog({}, {})
}
87 changes: 61 additions & 26 deletions core/ui/src/main/java/ru/yeahub/core_ui/component/Button.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fun PrimaryButton(
interactionSource = interactionSource,
shape = shape,
contentPadding = contentPadding,
content = content
content = content,
)
}

Expand Down Expand Up @@ -91,7 +91,7 @@ fun OutlineButton(
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
shape: Shape = RoundedCornerShape(12.dp),
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
content: @Composable RowScope.() -> Unit
content: @Composable RowScope.() -> Unit,
) {
DefaultButton(
onClick = onClick,
Expand All @@ -102,7 +102,7 @@ fun OutlineButton(
interactionSource = interactionSource,
shape = shape,
contentPadding = contentPadding,
content = content
content = content,
)
}

Expand All @@ -116,7 +116,7 @@ private fun DefaultButton(
border: BorderStroke? = null,
shape: Shape = ButtonDefaults.shape,
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
content: @Composable RowScope.() -> Unit
content: @Composable RowScope.() -> Unit,
) {
val contentColor: Color by colors.contentColor(enabled)
val containerColor: Color by colors.containerColor(enabled)
Expand All @@ -129,16 +129,16 @@ private fun DefaultButton(
color = containerColor,
contentColor = contentColor,
border = border,
interactionSource = interactionSource
interactionSource = interactionSource,
) {
CompositionLocalProvider(
value = LocalContentColor provides contentColor
value = LocalContentColor provides contentColor,
) {
Row(
modifier = Modifier
.padding(contentPadding),
horizontalArrangement = Arrangement.Center,
content = content
content = content,
)
}
}
Expand All @@ -150,13 +150,13 @@ object YeahubButtonDefaults {
contentColor: Color = Theme.colors.white900,
containerColor: Color = Theme.colors.purple700,
disabledContentColor: Color = Theme.colors.white900,
disabledContainerColor: Color = Theme.colors.black100
disabledContainerColor: Color = Theme.colors.black100,
): YeahubButtonColors {
return YeahubButtonColors(
contentColor = contentColor,
containerColor = containerColor,
disabledContentColor = disabledContentColor,
disabledContainerColor = disabledContainerColor
disabledContainerColor = disabledContainerColor,
)
}

Expand All @@ -165,13 +165,13 @@ object YeahubButtonDefaults {
contentColor: Color = Theme.colors.white900,
containerColor: Color = Theme.colors.red600,
disabledContentColor: Color = Theme.colors.white900,
disabledContainerColor: Color = Theme.colors.red200
disabledContainerColor: Color = Theme.colors.red200,
): YeahubButtonColors {
return YeahubButtonColors(
contentColor = contentColor,
containerColor = containerColor,
disabledContentColor = disabledContentColor,
disabledContainerColor = disabledContainerColor
disabledContainerColor = disabledContainerColor,
)
}

Expand All @@ -180,13 +180,13 @@ object YeahubButtonDefaults {
contentColor: Color = Theme.colors.purple700,
containerColor: Color = Theme.colors.purple100,
disabledContentColor: Color = Theme.colors.black200,
disabledContainerColor: Color = Theme.colors.black50
disabledContainerColor: Color = Theme.colors.black50,
): YeahubButtonColors {
return YeahubButtonColors(
contentColor = contentColor,
containerColor = containerColor,
disabledContentColor = disabledContentColor,
disabledContainerColor = disabledContainerColor
disabledContainerColor = disabledContainerColor,
)
}

Expand All @@ -195,13 +195,13 @@ object YeahubButtonDefaults {
contentColor: Color = Theme.colors.white900,
containerColor: Color = Theme.colors.red600,
disabledContentColor: Color = Theme.colors.white900,
disabledContainerColor: Color = Theme.colors.red200
disabledContainerColor: Color = Theme.colors.red200,
): YeahubButtonColors {
return YeahubButtonColors(
contentColor = contentColor,
containerColor = containerColor,
disabledContentColor = disabledContentColor,
disabledContainerColor = disabledContainerColor
disabledContainerColor = disabledContainerColor,
)
}

Expand All @@ -216,18 +216,44 @@ object YeahubButtonDefaults {
contentColor = contentColor,
containerColor = containerColor,
disabledContentColor = disabledContentColor,
disabledContainerColor = disabledContainerColor
disabledContainerColor = disabledContainerColor,
)
}

@Composable
fun outlineBorderDefaults(
width: Dp = 1.dp,
borderColor: Color = Theme.colors.red200
borderColor: Color = Theme.colors.red200,
): BorderStroke {
return BorderStroke(
width = width,
color = borderColor,
)
}

@Composable
fun secondaryOutlinedButtonColors(
contentColor: Color = Theme.colors.purple700,
containerColor: Color = Color.Transparent,
disabledContentColor: Color = Theme.colors.purple200,
disabledContainerColor: Color = Color.Transparent,
): YeahubButtonColors {
return YeahubButtonColors(
contentColor = contentColor,
containerColor = containerColor,
disabledContentColor = disabledContentColor,
disabledContainerColor = disabledContainerColor,
)
}

@Composable
fun secondaryOutlineBorderDefaults(
width: Dp = 1.dp,
borderColor: Color = Theme.colors.purple700,
): BorderStroke {
return BorderStroke(
width = width,
color = borderColor
color = borderColor,
)
}
}
Expand Down Expand Up @@ -260,29 +286,29 @@ interface ButtonColors {
}

@Preview(
showBackground = true
showBackground = true,
)
@Composable
fun ButtonPreviews() {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp)
verticalArrangement = Arrangement.spacedBy(16.dp),
) {
// Primary Button
Text("Primary Buttons", style = MaterialTheme.typography.titleMedium)
PrimaryButton(
onClick = {},
modifier = Modifier.fillMaxWidth(),
enabled = true
enabled = true,
) {
Text("Enabled Primary Button")
}
PrimaryButton(
onClick = {},
modifier = Modifier.fillMaxWidth(),
enabled = false
enabled = false,
) {
Text("Disabled Primary Button")
}
Expand All @@ -292,14 +318,14 @@ fun ButtonPreviews() {
SecondaryButton(
onClick = {},
modifier = Modifier.fillMaxWidth(),
enabled = true
enabled = true,
) {
Text("Enabled Secondary Button")
}
SecondaryButton(
onClick = {},
modifier = Modifier.fillMaxWidth(),
enabled = false
enabled = false,
) {
Text("Disabled Secondary Button")
}
Expand All @@ -309,16 +335,25 @@ fun ButtonPreviews() {
OutlineButton(
onClick = {},
modifier = Modifier.fillMaxWidth(),
enabled = true
enabled = true,
) {
Text("Enabled Outline Button")
}
OutlineButton(
onClick = {},
modifier = Modifier.fillMaxWidth(),
enabled = false
enabled = false,
) {
Text("Disabled Outline Button")
}
OutlineButton(
onClick = {},
colors = YeahubButtonDefaults.secondaryOutlinedButtonColors(),
border = YeahubButtonDefaults.secondaryOutlineBorderDefaults(),
modifier = Modifier.fillMaxWidth(),
enabled = true,
) {
Text("Enabled Outline Button with secondary colors")
}
}
}
Loading