Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Conversation

@davydenkokolya2
Copy link

No description provided.

@davydenkokolya2
Copy link
Author

Screenshot_2022-05-16-02-03-00-432_com github krottv tmstemp
Screenshot_2022-05-16-02-02-56-877_com github krottv tmstemp

import retrofit2.Retrofit
import retrofit2.create

class ITunesRemoteDataSourceRetrofit : MusicApi {
Copy link
Owner

Choose a reason for hiding this comment

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

Плохая практика. MusicApi должен быть отдельным интерфейсом, его не нужно реализовывать.
Нужно создать второй интерфейс DataSource. Да, так больше кода дублируется, но это правильный подход.


@Serializable
data class Tracks(
var artist: String,
Copy link
Owner

Choose a reason for hiding this comment

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

Модели данных нужно делать immutable - var.

@Serializable
data class TracksModel(
var album: Album ,
var tracks: ArrayList<Tracks>
Copy link
Owner

Choose a reason for hiding this comment

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

Нужно делать immutable - List

private val _stateITunes = MutableStateFlow<List<AlbumModel>?>(null)
val stateITunes: StateFlow<List<AlbumModel>?> = _stateITunes

fun loadData() {
Copy link
Owner

Choose a reason for hiding this comment

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

Стоит добавить обработку ошибок.

holder.imageAlbum.clipToOutline = true
holder.imageAlbum.outlineProvider = object: ViewOutlineProvider() {
override fun getOutline(p0: View, p1: Outline) {
p1.setRoundRect(0, 0, p0.width, p0.height, 10.0F)
Copy link
Owner

Choose a reason for hiding this comment

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

Это почему у тебя скругления не как в фигме. Потому что в фигме они в DP, а ты указываешь в PX

holder.titleTrack.text = item.title
holder.textTrack.text = item.artist

holder.imageTrack.clipToOutline = true
Copy link
Owner

Choose a reason for hiding this comment

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

Для этого можно отдельную функцию придумать, чтобы не дублировать

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants