Skip to content

Conversation

@VankaGam
Copy link
Owner

@VankaGam VankaGam commented Oct 6, 2025

Level 1

Copy link

@ArturNurtdinov ArturNurtdinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Отступ плейсхолдера на экране избранных треков не соответствует макетам:
image

Макет:

image
  1. Размер элемента списка треков на экране избранных треков не соответствует макетам:
image

Макет:

image

Также очень советую писать переиспользуемые композабл функции для одинаковых или похожих экранов или компонентов

debugImplementation("androidx.compose.ui:ui-tooling")
implementation("androidx.compose.runtime:runtime-livedata")
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.0")
implementation("io.coil-kt:coil-compose:2.7.0")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Все новые зависимости стоит делать через version catalog механизм - файл libs.versions.toml, чтобы все внешние зависимости проекта находились в одном месте - так удобнее будет с ними работать, а также все модули проекта будут зависеть от одних и тех же версий сторонних зависимостей. В Android Studio можно это сделать автоматически - нужно поставить каретку на зависимость, нажать Alt + Enter (cmd + Enter на маке) и выбрать соответствующий пункт, чтобы автоматически мигрировать зависимость на versions catalog

Comment on lines +15 to +17
single<suspend () -> List<Track>>(named("getFavoritesOnce")) {
suspend { get<FavoritesInteractor>().observeFavorites().first() }
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше это в юзкейс вынести, а не создавать как лямбду, так как это бизнес логика


import com.example.playlistmaker.search.domain.model.Track

data class MediaLibraryState(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Данные, передаваемые в композабл функции лучше помечать аннотацией @Immutable, чтобы повысить стабильность и исключить рекомпозиции из-за этого параметра

fun reload() {
viewModelScope.launch {
val favDef = async { runCatching { getFavoritesOnce() }.getOrElse { emptyList() } }
val plsDef = async { runCatching { getPlaylistsOnce() }.getOrElse { emptyList() } }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runCatching не стоит использовать с suspend вызовами, так как такой код конфликтует с механизмом отмены корутин через CancellationException

Comment on lines +41 to +50
val bg = colorResource(R.color.color_background)
val textPrimary = colorResource(R.color.black_setting)
val rowStart = dimensionResource(R.dimen.margin_start)
val rowV = dimensionResource(R.dimen.layout_margin_setting)
val iconSize = dimensionResource(R.dimen.margin_bottom_setting)
val rowEnd = dimensionResource(R.dimen.margin_setting_end)
val headerBottom = dimensionResource(R.dimen.margin_bottom_setting)
val blue = colorResource(R.color.blue)
val gray = colorResource(R.color.color_gray)
val white = colorResource(R.color.white)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Эти переменные нет смысла объявлять тут, лучше заинлайнить вызов функции

Comment on lines +158 to +182
Row(
modifier = Modifier
.fillMaxWidth()
.clickable(onClick = onAgreementClick)
.padding(start = rowStart, end = rowEnd),
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(R.string.agrement),
style = TextStyle(
fontFamily = YSDisplay,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 16.sp,
color = textPrimary
),
modifier = Modifier.weight(1f)
)
IconM3(
imageVector = Icons.Outlined.ChevronRight,
contentDescription = null,
tint = iconTint,
modifier = Modifier.size(iconSize)
)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Дублирующийся код лучше выносить в отдельные функции и переиспользовать

verstka ispravlena
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants