Skip to content

Homework Fedorov #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: development
Choose a base branch
from

Conversation

VladimirSergeevichFedorov

No description provided.

antonkazakov and others added 7 commits July 7, 2023 23:23
добавил обработку исключения запроса в сеть передал ошибку на вью, обработал вид исключения, вывел тост согласно заданию

обновил гредл, добавил кастомный скоуп, обернул вызов саспенд функций в корутины

Переписал логику на саспенд функции

Заменил возвращаемый тип  в CatService с колбека на датакласс и добавил модификатор suspend

Обновил УРЛ сервиса
# Conflicts:
#	app/src/main/java/otus/homework/coroutines/CatsService.kt
…уя библиотеку Picasso, добавил в метод populate тип для ссылки, добавил зависимость в гредл лайфсайкл скоуп, изменил скоуп в активити с кастомного на lifecycle
Добавил эксепшен хендлер для перехвата ошибок

Добавил необходимые зависимости для гредла, создал вью модель, убрал обращение к презентору
@VladimirSergeevichFedorov VladimirSergeevichFedorov changed the title Done Homework Fedorov Jul 11, 2023
Copy link

@invweb invweb left a comment

Choose a reason for hiding this comment

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

поправить отступы в основном

catsPresenter.detachView()
}
super.onStop()
ViewModelProvider(this)[CatsViewModel::class.java]
Copy link

Choose a reason for hiding this comment

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

ViewModel как "плюс"

catsPresenter.detachView()
}
super.onStop()
ViewModelProvider(this)[CatsViewModel::class.java]
}
}
Copy link

Choose a reason for hiding this comment

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

отступ в конце файла

interface CatsImageService {
@GET("meow")
suspend fun getCatImageUrl() : CatsImage
}
Copy link

Choose a reason for hiding this comment

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

отступ


@GET("fact")
suspend fun getCatFact() : Fact
}
Copy link

Choose a reason for hiding this comment

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

отступ

}
return service
}
}
Copy link

Choose a reason for hiding this comment

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

отступ

data class CatsImage(
@field: SerializedName("url")
val url:String = ""
)
Copy link

Choose a reason for hiding this comment

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

отступ

)
}
}
}
Copy link

Choose a reason for hiding this comment

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

отступ

}
}

interface ICatsView {
Copy link

Choose a reason for hiding this comment

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

1 файл - 1 класс или интерфейс, мне кажется, что хорошо придерживать именно такого порядка

interface ICatsView {

fun populate()
}
Copy link

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 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