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

Conversation

@AleksandrKalevich
Copy link

с больше разобрался c sharedViewModel и смог внедрить Koin, так же подправил тему с dpToPx (скруглениями рамок альбомов)
photo_2022-05-23_17-35-26
photo_2022-05-23_17-35-28
photo_2022-05-23_17-35-30
photo_2022-05-23_17-35-32

private val moduleRepository: Module
get() = module {
factory { AlbumsRepository(get(), get()) }
factory { SongsRepository(get(), get(), get()) }
Copy link
Owner

Choose a reason for hiding this comment

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

factoryOf


recyclerView.layoutManager = LinearLayoutManager(fragment.requireContext(), RecyclerView.HORIZONTAL, false)

if (recyclerView.adapter == null) {
Copy link
Owner

Choose a reason for hiding this comment

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

Избежать дублирования

class AlbumsRepository(private val albumDbDataSource: AlbumDbDataSource,
private val albumRemoteDataSource: AlbumRemoteDataSource) {

suspend fun getItunesAlbums(): List<AlbumModel> {
Copy link
Owner

Choose a reason for hiding this comment

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

дублирование кода

private val songDbDataSourceLibrary: SongDbDataSource,
private val songRemoteDataSource: SongRemoteDataSource) {

suspend fun getItunesSongs(album_id : Long): List<SongModel> {
Copy link
Owner

Choose a reason for hiding this comment

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

дублирование кода

}
}

override suspend fun getAlbums(contentType: ContentType): Map<ContentType, List<AlbumModel>>? {
Copy link
Owner

Choose a reason for hiding this comment

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

Неиспользуемый параметр

import com.github.krottv.tmstemp.domain.SongsJSON

interface SongRemoteDataSource {
suspend fun getItunesSongs(album_id : Long): SongsJSON
Copy link
Owner

Choose a reason for hiding this comment

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

camelCase - albumId

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