-
Notifications
You must be signed in to change notification settings - Fork 239
Terrible Coroutines Homework #157
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?
Conversation
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.
кое-что поправить
buildToolsVersion "30.0.3" | ||
|
||
defaultConfig { | ||
applicationId "otus.homework.coroutines" | ||
minSdkVersion 23 | ||
targetSdkVersion 30 | ||
targetSdkVersion 33 |
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.
отлично
suspend fun getCatFact() : Response<Fact> | ||
|
||
@GET("meow") | ||
suspend fun getCatImage() : Response<CatImage> | ||
} |
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.
добавить перенос, gitHub, даже, подсвечивает
|
||
class CatsView @JvmOverloads constructor( | ||
context: Context, | ||
attrs: AttributeSet? = null, | ||
defStyleAttr: Int = 0 | ||
) : ConstraintLayout(context, attrs, defStyleAttr), ICatsView { | ||
|
||
var presenter :CatsPresenter? = 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.
private?
override fun populate(data: Any) { | ||
if(data is Fact) textView.text = data.fact | ||
else if(data is CatImage) { | ||
Picasso.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.
хорошо
.fit() | ||
.into(imageView) | ||
} | ||
|
||
} | ||
} | ||
|
||
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 файл
app:layout_constraintEnd_toEndOf="@id/fact_textView" | ||
app:layout_constraintStart_toStartOf="@id/fact_textView" /> | ||
|
||
</otus.homework.coroutines.CatsView> |
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.
перенос
super.onCleared() | ||
scope.cancel() | ||
Log.d("PVM", "Coroutine canceled" ) | ||
} |
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.
форматирование и перенос
DataType.FACT -> getFactUseCase.getFact() | ||
DataType.CAT_IMAGE -> getImageUseCase.getImage() | ||
} | ||
}.await() |
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.
отлично
suspend fun getImage():Any{ | ||
return catsRepository.getImage() | ||
} | ||
} |
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 Error<T : Any>(val errorCode: Int?, val errorMessage: String?) : Result<T> | ||
|
||
class ResultException<T: Any>(val exceptionMessage: String?) : Result<T> | ||
|
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.