Skip to content

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

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

Conversation

toniwar
Copy link

@toniwar toniwar commented Jul 11, 2023

No description provided.

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.

кое-что поправить

buildToolsVersion "30.0.3"

defaultConfig {
applicationId "otus.homework.coroutines"
minSdkVersion 23
targetSdkVersion 30
targetSdkVersion 33
Copy link

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>
}
Copy link

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

Copy link

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()
Copy link

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 {
Copy link

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

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" )
}
Copy link

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()
Copy link

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()
}
}
Copy link

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>

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.

2 participants