-
Notifications
You must be signed in to change notification settings - Fork 7
26-27 homework #43
base: main
Are you sure you want to change the base?
26-27 homework #43
Conversation
private val moduleRepository: Module | ||
get() = module { | ||
factory { AlbumsRepository(get(), get()) } | ||
factory { SongsRepository(get(), get(), get()) } |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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>>? { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
camelCase - albumId
с больше разобрался c sharedViewModel и смог внедрить Koin, так же подправил тему с dpToPx (скруглениями рамок альбомов)