-
Notifications
You must be signed in to change notification settings - Fork 239
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
base: development
Are you sure you want to change the base?
Homework Fedorov #155
Conversation
добавил обработку исключения запроса в сеть передал ошибку на вью, обработал вид исключения, вывел тост согласно заданию обновил гредл, добавил кастомный скоуп, обернул вызов саспенд функций в корутины Переписал логику на саспенд функции Заменил возвращаемый тип в CatService с колбека на датакласс и добавил модификатор suspend Обновил УРЛ сервиса
# Conflicts: # app/src/main/java/otus/homework/coroutines/CatsService.kt
…уя библиотеку Picasso, добавил в метод populate тип для ссылки, добавил зависимость в гредл лайфсайкл скоуп, изменил скоуп в активити с кастомного на lifecycle
Добавил эксепшен хендлер для перехвата ошибок Добавил необходимые зависимости для гредла, создал вью модель, убрал обращение к презентору
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.
поправить отступы в основном
catsPresenter.detachView() | ||
} | ||
super.onStop() | ||
ViewModelProvider(this)[CatsViewModel::class.java] |
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.
ViewModel как "плюс"
catsPresenter.detachView() | ||
} | ||
super.onStop() | ||
ViewModelProvider(this)[CatsViewModel::class.java] | ||
} | ||
} |
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.
отступ в конце файла
interface CatsImageService { | ||
@GET("meow") | ||
suspend fun getCatImageUrl() : CatsImage | ||
} |
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.
отступ
|
||
@GET("fact") | ||
suspend fun getCatFact() : Fact | ||
} |
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.
отступ
} | ||
return service | ||
} | ||
} |
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.
отступ
data class CatsImage( | ||
@field: SerializedName("url") | ||
val url:String = "" | ||
) |
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.
отступ
) | ||
} | ||
} | ||
} |
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.
отступ
} | ||
} | ||
|
||
interface ICatsView { |
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.
1 файл - 1 класс или интерфейс, мне кажется, что хорошо придерживать именно такого порядка
interface ICatsView { | ||
|
||
fun populate() | ||
} |
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.
переноса строки опять нету, гитхаб подсвечивает
No description provided.