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

Conversation

@ElenaVeshtard
Copy link

26-27 Homework
28 Homework Loading
28 Homework Loading is complete

@krottv
Copy link
Owner

krottv commented May 23, 2022

Нужны рамки!

}
private val viewModelModule: Module
get() = module {
viewModel { AlbumsViewModel(get()) }
Copy link
Owner

Choose a reason for hiding this comment

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

viewModelOf

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.

Уже Коле писал для реализации нужен другой интерфейс. Этот должен быть только для retrofit, конечно работает и так, но надо, чтобы было чище.


fun loadTracks() {
viewModelScope.launch(Dispatchers.IO) {
_stateITunes.emit(musicApi.getTracks(1))
Copy link
Owner

Choose a reason for hiding this comment

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

обработка ошибок?

return START_NOT_STICKY
}

private suspend fun loadDataFake() {
Copy link
Owner

Choose a reason for hiding this comment

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

Это надо вынести в отдельный класс

override fun onCreate() {
super.onCreate()

runBlocking {
Copy link
Owner

Choose a reason for hiding this comment

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

Блокирует ui поток.

holder.imageAlbum.clipToOutline = true
holder.imageAlbum.outlineProvider = object : ViewOutlineProvider() {
override fun getOutline(view: View, outline: Outline) {
outline.setRoundRect(0, 0, view.width, view.height, 24.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.

val action =
LibraryMusicFragmentDirections.actionLibraryMusicFragmentToITunesMusicFragment()
navController.navigate(action)
navController.saveState()
Copy link
Owner

Choose a reason for hiding this comment

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

Зачем? Наобор нужно clearState.

navController.saveState()
}

viewModel.loadData()
Copy link
Owner

Choose a reason for hiding this comment

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

Проверять savedInstanceState.

import com.github.krottv.tmstemp.domain.AlbumModel
import com.github.krottv.tmstemp.domain.TracksModel

class LibraryMusicFragmentBinder(val fragment: LibraryMusicFragment) {
Copy link
Owner

Choose a reason for hiding this comment

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

Два фрагмента с одинаковым кодом.


var data: List<Tracks> = data
set(value) {
field = value
Copy link
Owner

Choose a reason for hiding this comment

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

copy-paste

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