Antoine Gagnon
05/21/2020, 4:25 PMsaveFlower(flowerData:FlowerData)
method in my viewModel from my Fragment and passing it all the fields values. The ViewModel that holds my FlowerRepository is then creating the proper Flower object and saving to the FlowerRepository
This feels wrong to have the ViewModel both presenting data and handling it, what should I do?ursus
05/22/2020, 7:48 AMursus
05/24/2020, 12:15 PMursus
05/24/2020, 12:16 PMursus
05/24/2020, 12:17 PMRahul Ch
05/24/2020, 5:44 PMnino
05/26/2020, 10:33 AMursus
05/27/2020, 2:19 AMursus
05/28/2020, 1:56 PMrkeazor
05/28/2020, 4:52 PMursus
06/13/2020, 11:20 PMfun <T> body(response: Response<T>): T? {
return if (!response.isSuccessful) {
val errorResponse = try {
val errorBody = response.errorBody()
if (errorBody != null) {
moshi.adapter(ErrorResponse::class.java).fromJson(errorBody.source())
} else {
null
}
} catch (ex: Exception) {
null
}
val retryAfterTimestampMillis = errorResponse
?.error
?.retryAfter
?.let(TimestampParserHelper::parseTimestampMillis)
throw ApiException(
path = response.raw().request.url.encodedPath,
errorCode = response.code(),
errorMessage = errorResponse?.error?.errorMessage,
retryAfterTimestamp = retryAfterTimestampMillis
)
} else {
response.body()
}
}
ursus
06/13/2020, 11:21 PMursus
06/13/2020, 11:21 PMursus
06/16/2020, 7:08 PMPaymentApi? PaymentService?
ApiCreditCard? ServiceCreditCard? RemoteCreditCard?
Steve
06/16/2020, 9:11 PMmattinger
06/18/2020, 6:29 PMOG
06/30/2020, 1:37 AMdewildte
06/30/2020, 7:58 PMSingleLiveEvent
anti pattern post.) or some sort of AA Component.
Kotlin Flow
or Channel
is good for this but it seems like that is not common knowledge.Hakob Astvacatryan
07/07/2020, 8:27 PMSlackbot
07/10/2020, 7:56 AMursus
07/16/2020, 4:17 AMursus
07/18/2020, 12:50 PMJoost Klitsie
07/19/2020, 8:29 AMursus
07/27/2020, 5:17 PM:payments
:payments-ui
?JC
07/30/2020, 6:48 PMVincent Williams
08/06/2020, 2:43 AMsealed class ViewState {
object Idle : ViewState()
data class Content(
val headerText: String,
val bodyText: String
) : ViewState()
data class Error(
val message: String
) : ViewState
}
How do I update just the title for example? I see a lot of examples use sealed classes but they dont seem so great in practice...ursus
08/14/2020, 3:56 AMFanilog
08/18/2020, 9:03 AMFlow<data>
from the Service layer to their Repository and Interactor. I was wondering if doing this way it’s breaking one the principles by having a strong dependency with the current implementation of the Flow (external service)?ursus
08/18/2020, 8:24 PMRaj Trivedi
08/21/2020, 10:57 AMRaj Trivedi
08/21/2020, 10:57 AMSusheel
08/21/2020, 4:36 PMJohn Leeroy
08/21/2020, 5:43 PM